123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <template>
- <common-header />
- <div class="content">
- <div class="title">
- 在线学习 <span>智慧教研-</span><span>在线学习</span>
- </div>
- <div class="jy-header">
- <p>在线学习</p>
- <div class="search">
- <input v-model="keyword" type="text" placeholder="搜索关键字" />
- <span class="inp-sear" @click="getData"></span>
- </div>
- </div>
- <div class="nav">
- <div class="search-list">
- <div class="label">年级</div>
- <div class="valueDiv">
- <div class="item pointer" :class="activeGrade==item.grade_id?'active':''" @click="initGrade(item)" v-for="item in gradeData" :key="item.grade_id">{{item.grade_name}}</div>
- </div>
- </div>
- <div class="search-list">
- <div class="label">科目</div>
- <div class="valueDiv">
- <div class="item pointer" :class="activeSubject==item.subject_id?'active':''" @click="initSubject(item)" v-for="item in subjectData" :key="item.subject_id">{{item.subject_name}}</div>
- </div>
- </div>
- <div class="search-list">
- <div class="label">分类</div>
- <div class="valueDiv">
- <div class="item pointer" :class="activeType==item.v?'active':''" @click="initType(item)" v-for="item in typeData" :key="item.v">{{item.n}}</div>
- </div>
- </div>
- </div>
- <div class="ysgc-kind">
- <ul class="specail">
- <li class="kc" v-for="(item, index) in listData" :key="index">
- <div>
- <video v-if="item.zz_video" class="mask" @click="zxxxspDetail(item.zz_id)" style="width: 100%"></video>
- </div>
- <img @click="zxxxxqDetail(item.zz_id)" class="kc-back" :src="https + item.zz_img" alt="" />
- <div class="kc-des">
- <p class="kc-name">{{ item.zz_name }}</p>
- <div class="rate">
- <!-- <el-rate v-model="item.zz_star_num"></el-rate> -->
- <img v-for="star in Number(item.zz_star_num)" :key="star" src="@/assets/img/zhjyzxxx/star.png" alt="" />
- </div>
- </div>
- <div class="dataShow">
- <div class="baseInfoPart">
- <img src="/kczy/fingerIcon.png" alt="">
- <span>{{item.zz_like_num}}</span>
- </div>
- <div class="baseInfoPart">
- <img src="/kczy/cellectIcon.png" alt="">
- <span>{{item.zz_fav_num}}</span>
- </div>
- </div>
- </li>
- </ul>
- </div>
- <div class="footer">
- <div style="width: 1400px; height: 50px; position: relative; margin: 0 auto">
- <el-pagination background layout="total,prev, pager, next" :total="total" style="position: absolute; top: 0; right: 0" @current-change="handleCurrentChange" :page-size="limit">
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { zxxx_list, grade_list, subject_list } from "./api";
- import CommonHeader from "@/components/CommonHeader/index.vue";
- export default {
- name: "index",
- components: {
- CommonHeader,
- },
- data() {
- return {
- listData: [],
- keyword: "",
- limit: 10,
- total: 0,
- cur_page: 1,
- https: window.GLOBAL_CONFIG.api,
- gradeList: [],
- subjectList: [],
- grade_id: "",
- subject_id: "",
- firstForm: {
- grade: "",
- subject: "",
- },
- gradeData: [],
- activeGrade: "",
- subjectData: [],
- activeSubject: "",
- typeData: [],
- activeType: "",
- };
- },
- methods: {
- //跳转
- zxxxxqDetail(id) {
- this.$router.push({ name: "zhjy_zhjyzxxx_zxxxxq", params: { id: id } });
- },
- zxxxspDetail(id) {
- this.$router.push({ name: "zhjy_zhjyzxxx_zxxxsp", params: { id: id } });
- },
- //数据获取
- getData() {
- let data = {
- page: this.cur_page,
- limit: this.limit,
- keyword: this.keyword,
- grade_id: this.activeGrade,
- subject_id: this.activeSubject,
- zz_type: this.activeType,
- };
- zxxx_list(data).then((res) => {
- this.listData = res.data.page_data;
- console.log(this.listData);
- this.cur_page = Number(res.data.page_now);
- this.total = Number(res.data.total_rows);
- });
- },
- handleCurrentChange(val) {
- this.cur_page = val;
- this.listData();
- },
- //年级
- initGradeData() {
- this.gradeData = [
- {
- grade_id: "",
- grade_name: "全部",
- }
- ];
- grade_list().then((res) => {
- if (res.code == 1) {
- this.gradeData = this.gradeData.concat(res.data.page_data);
- }
- });
- },
- initGrade(value) {
- this.activeGrade = value.grade_id;
- this.getData();
- },
- //科目
- initSubjectData() {
- this.subjectData = [
- {
- subject_id: "",
- subject_name: "全部",
- }
- ];
- subject_list().then((res) => {
- if (res.code == 1) {
- this.subjectData = this.subjectData.concat(res.data.page_data);
- }
- });
- },
- initSubject(value) {
- console.log(value, 123);
- this.activeSubject = value.subject_id;
- this.getData();
- },
- // 分类
- initTypeData() {
- this.typeData = [
- {
- v: "",
- n: "全部"
- }
- ];
- zxxx_list().then((res) => {
- if (res.code == 1) {
- this.typeData = this.typeData.concat(res.data.table_structure.field.zz_type.option);
- }
- });
- },
- initType(value) {
- this.activeType = value.v;
- this.getData();
- },
- },
- mounted() {
- this.getData();
- this.initGradeData();
- this.initSubjectData();
- this.initTypeData();
- },
- };
- </script>
- <style lang="scss" scoped>
- .dataShow {
- position: absolute;
- right: 0;
- top: 0;
- z-index: 13;
- width: 160px;
- height: 32px;
- line-height: 32px;
- background: rgba(0, 0, 0, 0.5);
- border-bottom-left-radius: 12px;
- border-top-right-radius: 12px;
- display: flex;
- padding-left: 5px;
- .baseInfoPart {
- width: 50%;
- box-sizing: border-box;
- padding-left: 4px;
- img {
- display: inline-block;
- vertical-align: middle;
- }
- span {
- font-size: 14px;
- font-weight: 400;
- text-align: left;
- color: #ffffff;
- margin-left: 5px;
- }
- }
- }
- .search-list {
- display: flex;
- align-items: baseline;
- font-size: 14px;
- margin: 20px 0;
- .label {
- color: #000;
- margin-right: 25px;
- }
- .valueDiv {
- flex: 1;
- display: flex;
- color: #949494;
- border-bottom: 1px dashed #e4e6e8;
- padding-bottom: 15px;
- font-weight: 400;
- cursor: pointer;
- .item + .item {
- margin-left: 20px;
- }
- .item {
- padding: 3px 5px;
- &.active {
- color: #00a3ff;
- border-radius: 6px;
- background: rgba($color: #00a3ff, $alpha: 0.1);
- }
- }
- }
- }
- .content {
- width: 100%;
- min-width: 1400px;
- margin: 0 auto;
- }
- .title {
- width: 1400px;
- height: 55px;
- line-height: 55px;
- font-size: 18px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- color: #050026;
- margin: 0 auto;
- span:first-of-type {
- width: 56px;
- height: 20px;
- font-size: 14px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- text-align: left;
- color: #949494;
- line-height: 20px;
- margin-left: 30px;
- }
- span:last-of-type {
- width: 56px;
- height: 20px;
- font-size: 14px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- text-align: left;
- color: #000000;
- line-height: 20px;
- }
- }
- .jy-header {
- width: 100%;
- height: 200px;
- background: url("@/assets/img/zhjyzxxx/zxxx_bg.png");
- background-size: 100% 200px;
- background-repeat: no-repeat;
- padding-top: 40px;
- p {
- width: 192px;
- height: 67px;
- font-size: 48px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- text-align: left;
- color: #ffffff;
- line-height: 67px;
- margin: 0 auto;
- margin-bottom: 15px;
- }
- .search {
- position: relative;
- height: 50px;
- width: 497px;
- margin: 0 auto;
- input {
- background: #ffffff;
- border-radius: 8px;
- border: 1px solid #00a3ff;
- height: 50px;
- padding: 20px;
- width: 100%;
- outline: none;
- }
- .inp-sear {
- display: block;
- width: 26px;
- height: 26px;
- background-color: #00a3ff;
- border-radius: 6px;
- position: absolute;
- top: 11px;
- right: 10px;
- background-image: url("@/assets/img/zhjyzxxx/search.png");
- background-size: 60%;
- background-position: center;
- background-repeat: no-repeat;
- }
- }
- }
- .nav {
- width: 1400px;
- margin: 0 auto;
- display: flex;
- flex-direction: column;
- margin-bottom: 20px;
- div {
- display: flex;
- span {
- padding-top: 10px;
- display: inline-block;
- width: 50px;
- height: 50px;
- font-size: 16px;
- font-family: PingFangSC, PingFangSC-Semibold;
- font-weight: 600;
- text-align: center;
- color: #000000;
- line-height: 21px;
- }
- }
- }
- .ysgc-kind {
- // width: 1650px;
- width: 1400px;
- margin: 0 auto;
- .specail {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- li {
- height: 278px;
- display: inline-block;
- margin: 0 13px 17px 0;
- overflow: hidden;
- box-shadow: 0px 10px 24px 0px rgba(161, 153, 168, 0.18);
- }
- .kc {
- width: 330px;
- background: #ffffff;
- border-radius: 12px;
- box-shadow: 0px 10px 24px 0px rgba(161, 153, 168, 0.18);
- position: relative;
- .kc-back {
- width: 100%;
- height: 196px;
- display: block;
- }
- .mask {
- z-index: 4;
- width: 100%;
- height: 196px;
- display: block;
- position: absolute;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.4) url("@/assets/img/zhjy/start.png")
- no-repeat center;
- }
- .kc-des {
- padding: 11px 6px;
- box-sizing: border-box;
- .kc-name {
- height: 22px;
- font-size: 16px;
- font-family: PingFangSC, PingFangSC-Regular;
- font-weight: 400;
- color: #000000;
- line-height: 22px;
- }
- .rate {
- display: flex;
- margin: 11px 0;
- img {
- margin-right: 6px;
- }
- }
- }
- }
- }
- }
- .footer {
- width: 100%;
- height: 50px;
- margin-top: 100px;
- display: inline-block;
- }
- </style>
|