旅游教育出版社-数字教材移动端
QYF-GitLab1
22 小时以前 8e3ee81b6ed824866734b7034604121f370f4201
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>
@@ -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;