闫增涛
2024-09-18 c96612e8a63ecef9590be0f8b5199277ec94e5b9
pages/digitalCourses/digitalCoursesDetails/index.js
@@ -177,6 +177,7 @@
    this.setData({
      userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).name,
    })
    console.log('1', options.id);
  },
  /**
@@ -190,6 +191,10 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (this.data.tabValue == 2) {
      this.getPlayerList()
      this.getResource()
    }
  },
@@ -231,7 +236,7 @@
    app.MG.identity
      .getUserKey({
        domain: 'videoPlayer',
        keys: [this.data.bookId]
        keys: [this.data.bookId + '']
      })
      .then((res) => {
        if (res.length > 0) {
@@ -311,6 +316,10 @@
      }
      if (res.datas.datas.speaker && res.datas.datas.speaker.length > 0) {
        this.getSpeaker(res.datas.datas.speaker)
      } else {
        this.setData({
          lecturerList: []
        })
      }
      if (this.data.bookPath) {
        this.getAboutBook(this.data.bookPath)
@@ -330,6 +339,9 @@
  },
  //获取主讲人
  getSpeaker(list) {
    this.setData({
      lecturerList: []
    })
    let query = {
      path: 'jsek_speaker',
      fields: {
@@ -414,6 +426,9 @@
    this.setData({
      tabValue: value
    })
    if (this.data.tabValue == 0) {
      this.digitalCoursesDetailsGet(this.data.bookId)
    }
    if (this.data.tabValue == 1) {
      this.saveAsImage()
    }
@@ -471,7 +486,6 @@
        res.datas.cmsDatas[0].datas.forEach((item) => {
          if (item.type == 'questionBankFolder' || item.type == 'questionBankItem') {
            test.push(item)
          } else if (item.type != "resourceItem") {
            this.data.playerList.forEach(pItem => {
              if (pItem.cmsItemId == item.id) {
@@ -483,9 +497,7 @@
          if (item.type == 'productItem') {
            learnItemList.push(item)
          }
        })
        if (this.data.selectActive === 'learn') {
          let list = []
          // 测试 6位// 正式 5位//  测试调用传20,内部7  正式调用传17 内部传6
@@ -504,6 +516,7 @@
              learnList: list,
              openTeachids: result,
            });
            console.log(1, this.data.learnList, this.data.playerList)
          }
        } else {
          const data = test.filter(
@@ -733,8 +746,6 @@
  onCorrelationBook(e) {
    const item = e.currentTarget.dataset.item;
    // this.digitalCoursesDetailsGet(item.id)
    // this.getPlayerList()
    this.onLoad({
      loading: true,
      id: item.id,
@@ -870,12 +881,13 @@
            })
            .then((res) => {
              if (res) {
                this.digitalCoursesDetailsGet(this.data.digitalsData.id);
                wx.showToast({
                  title: "领取成功",
                  icon: "none",
                  duration: 1000,
                });
                this.getBookInfo(this.data.bookDetail.id);
                this.digitalCoursesDetailsGet(this.data.bookId);
              }
            });
        } else {
@@ -1044,7 +1056,9 @@
        item.content = JSON.parse(item.content)
        if (item.content.id == this.data.bookId) {
          this.setData({
            isCertificate: item
            isCertificate: item,
            userName: item.content.userName,
            userPicture: app.config.requestCtx + `/file/GetPreViewImage?md5=` + item.content.userPicture
          })
        }
      })
@@ -1055,22 +1069,22 @@
  onCertificate() {
    // if (!this.data.isBuy) {
    //   wx.showToast({
    //     title: "请先购买,体验完整服务",
    //     icon: "none",
    //     duration: 1000,
    //   });
    //   return false
    // }
    // if (!this.data.isLearn) {
    //   wx.showToast({
    //     title: "您的学习任务还未完成,暂不能申请证书,加油哦!",
    //     icon: "none",
    //     duration: 1000,
    //   });
    //   return false
    // }
    if (!this.data.isBuy) {
      wx.showToast({
        title: "请先购买,体验完整服务",
        icon: "none",
        duration: 1000,
      });
      return false
    }
    if (!this.data.isLearn) {
      wx.showToast({
        title: "您的学习任务还未完成,暂不能申请证书,加油哦!",
        icon: "none",
        duration: 1000,
      });
      return false
    }
    if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') {
      wx.showToast({
        title: "您申请的证书正在审核中",