From 8e3ee81b6ed824866734b7034604121f370f4201 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期三, 09 七月 2025 17:55:14 +0800 Subject: [PATCH] 登录、购书码、申请阅读 --- src/views/index/index.vue | 121 ++++++++++++++++++++------------------- 1 files changed, 62 insertions(+), 59 deletions(-) diff --git a/src/views/index/index.vue b/src/views/index/index.vue index c2d1ba5..fb02c66 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -27,7 +27,7 @@ > <div :style="{ - background: 'url(' + item.icon + ') no-repeat 100%,center' + background: 'url(' + item.icon + ') no-repeat 100%,center', }" alt class="banner" @@ -131,10 +131,7 @@ <div class="more" @click="openBtn('true')" v-else>鏀惰捣 -</div> </div> <div class="partnerList"> - <div - :class="isOpen ? 'list' : 'list1'" - v-if="!partnersLoading && partnersList.length > 0" - > + <div class="list" v-if="!partnersLoading && partnersList.length > 0"> <div class="partnerItem" v-for="(item, index) in partnersList" @@ -142,11 +139,6 @@ > <div class="imgBox"> <img class="autoImg" :src="item.icon" /> - </div> - <div class="bookInfo"> - <div class="title" :title="item.name"> - {{ item.name }} - </div> </div> </div> </div> @@ -180,21 +172,21 @@ img: require("@/assets/images/home/guanwang3.png"), circleName: "瀹樼綉涓婚〉", url: "https://www.tepcb.com/mobile/website/", - itemN: "circle-one" + itemN: "circle-one", }, { img: require("@/assets/images/home/shuzijiaocai3.png"), circleName: "鏁板瓧鏁欐潗", url: "/bookList", - itemN: "circle-two" + itemN: "circle-two", }, { img: require("@/assets/images/home/jiaoshirenzheng3.png"), circleName: "鏁欏笀璁よ瘉", url: "/teacherCertificate", - itemN: "circle-three" - } - ] + itemN: "circle-three", + }, + ], }, bookRecommendList: [], bookRecommendLoading: true, @@ -203,7 +195,7 @@ partnersList: [], partnersLoading: false, isOpen: true, - token: "" + token: "", }; }, created() { @@ -219,26 +211,26 @@ that.getPartnersList(); }, computed: { - ...mapState(["userInfo"]) + ...mapState(["userInfo"]), }, methods: { getUserRoleMine() { let that = this; - that.MG.identity.getCurrentAppUser().then(res => { + that.MG.identity.getCurrentAppUser().then((res) => { if (res) { that.userId = res.userId; let teacherRole = res.roleLinks.find( - item => item.role?.refCode == "teacher" + (item) => item.role?.refCode == "teacher" ); let teacherInfo = res.infoList.find( - item => item.type == "teacherInfo" + (item) => item.type == "teacherInfo" ); - let wechatInfo = res.infoList.find(item => item.type == "WeChat"); + let wechatInfo = res.infoList.find((item) => item.type == "WeChat"); let studentInfo = res.infoList.find( - item => item.type == "basicInfo" || item.type == "Default" + (item) => item.type == "basicInfo" || item.type == "Default" ); let phoneInfo = res.secretList.find( - item => item.type == "MobilePhone" + (item) => item.type == "MobilePhone" ); if (teacherRole && teacherInfo) { this.$store.dispatch("setUserInfo", { @@ -246,20 +238,20 @@ phoneNumber: phoneInfo?.credential, icon: wechatInfo?.icon, role: "Teacher", - roleId: teacherRole.role.id + roleId: teacherRole.role.id, }); } else if (wechatInfo) { this.$store.dispatch("setUserInfo", { ...wechatInfo, phoneNumber: phoneInfo?.credential, - role: "Student" + role: "Student", }); } else if (studentInfo) { this.$store.dispatch("setUserInfo", { ...studentInfo, icon: wechatInfo?.icon, phoneNumber: phoneInfo?.credential, - role: "Student" + role: "Student", }); } } @@ -270,9 +262,9 @@ getBanner() { this.MG.resource .getItem({ - path: "tourism_digitalTextbook\\tourism_digitalBannerMobile" + path: "tourism_digitalTextbook\\tourism_digitalBannerMobile", }) - .then(res => { + .then((res) => { this.educate.swipePic = res.datas; console.log(res.datas); }); @@ -282,8 +274,8 @@ this.$router.push({ path: "/bookList", query: { - searchAllWords: this.searchAllWords - } + searchAllWords: this.searchAllWords, + }, }); }, //鎺ㄨ崘鏁欐潗 @@ -301,22 +293,22 @@ queryType: "*", paging: { start: 0, - size: 5 + size: 5, }, fields: { tourism_author: [], tourism_publicationDate: [], - viewCount: [] + viewCount: [], }, sort: { type: "Desc", - field: "CreateDate" + field: "CreateDate", }, coverSize: { - height: 560 - } + height: 560, + }, }) - .then(res => { + .then((res) => { this.bookRecommendList = res.datas; this.bookRecommendLoading = false; }); @@ -327,8 +319,8 @@ this.$router.push({ path: "/bookDetail", query: { - id: data.id - } + id: data.id, + }, }); }, // 杞挱鍥句笅鏂� 鍒楄〃璺宠浆椤甸潰 @@ -338,13 +330,13 @@ window.open(url); } else { this.$router.push({ - path: url + path: url, }); } }, showMore() { this.$router.push({ - path: "/bookList" + path: "/bookList", }); }, //瑙嗛璇存槑 @@ -354,12 +346,12 @@ path: "tourism_digitalTextbook\\tourism_digitalRecommendedTextbooks", fields: { tourism_file: [], - tourism_content: [] - } + tourism_content: [], + }, }) - .then(res => { + .then((res) => { if (res.datas.length > 0) { - res.datas.forEach(element => { + res.datas.forEach((element) => { if ( element.refCode == "tourism_digitalRecommendedTextbooksMobile" ) { @@ -382,7 +374,7 @@ }, getManual() { this.$router.push({ - path: "/manual" + path: "/manual", }); }, //鍚堜綔闄㈡牎 @@ -391,10 +383,16 @@ this.MG.resource .getItem({ path: "tourism_digitalTextbook\\tourism_digitalPartners", - fields: {} + fields: {}, }) - .then(res => { - this.partnersList = res.datas; + .then((res) => { + const data = res.datas; + if (this.isOpen) { + this.partnersList = data.slice(0, 4); + } else { + this.partnersList = data; + } + this.partnersLoading = false; }); }, @@ -404,11 +402,12 @@ } else { this.isOpen = false; } - } + this.getPartnersList(); + }, }, components: { - Footer - } + Footer, + }, }; </script> <style scoped> @@ -612,8 +611,8 @@ } .titleBox .operate img { margin-right: 6px; - width:24px; - height:24px; + width: 24px; + height: 24px; } .descriptionBox { @@ -635,24 +634,28 @@ .partnerList { margin-top: 10px; overflow: hidden; - min-height: 180px; + min-height: 150px; flex-wrap: wrap; } .list { - height: 160px; + min-height: 110px; + overflow: hidden; } -.list1 { +/* .list1 { + line-height: 1.5; min-height: 160px; -} +} */ .partnerItem { - width: calc(100% / 4 - 10px); + width: 25%; display: block; box-sizing: border-box; + float: left; + padding: 5px 20px; } .partnerItem .imgBox { position: relative; width: 100%; - height: 100px; + min-height: 60px; } .partnerItem .bookInfo { margin: 0; -- Gitblit v1.9.1