litian
2024-09-06 8dc4e50769a7ebc5f0a3d766f61aa08b8f23b772
pages/digitalTextbooks/digitalTextbooksDetails/index.js
@@ -89,6 +89,12 @@
    this.setData({
      digitalTextId: options.id
    })
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {} else {}
      })
    }
    this.digitalTextbooksDetailsGet(this.data.digitalTextId)
    this.getType()
    this.getCertificateList()
@@ -720,14 +726,14 @@
  },
  onCertificate() {
    // if (!this.data.isBuy) {
    //   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: "您的学习任务还未完成,暂不能申请证书,加油哦!",
@@ -736,14 +742,14 @@
    //   });
    //   return false
    // }
    // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') {
    //   wx.showToast({
    //     title: "您申请的证书正在审核中",
    //     icon: "none",
    //     duration: 1000,
    //   });
    //   return false
    // }
    if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') {
      wx.showToast({
        title: this.data.isCertificate.state == 'WaitAudit' ? "您申请的证书正在审核中" : this.data.isCertificate.state == 'Normal' ? '您已申请证书' : '',
        icon: "none",
        duration: 1000,
      });
      return false
    }
    var page = getCurrentPages().pop(); // 获取当前页面实例
    page.setData({