闫增涛
2024-04-26 eb3cf68faee31402822350045ee08f3fea28cd5c
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -132,7 +132,6 @@
    goPlayer(e) {
      // 检查登录状态
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        const item = e.currentTarget.dataset.item;
        const parent = e.currentTarget.dataset.parent;
@@ -162,13 +161,31 @@
              "请先购买该资源" : "请先点击领取查看按钮",
          });
        }
        if (item.saleMethod.length == 0 && item.sysType == 'CmsItem' && this.properties.tab == "jsek_cloudLearning") {
          return wx.showToast({
            icon: 'error',
            title: '暂未开始销售,请联系管理员',
          })
        }
        if (this.properties.tab == "jsek_teachingResources" && item.fileMap) {
          if (item.file && item.fileMap[item.file].protectType !== "Public") {
            return wx.showToast({
              icon: 'error',
              title: '资源不可用,请联系管理员',
            })
          } else if (item.freeFile && item.fileMap[item.freeFile].protectType !== "Public") {
            return wx.showToast({
              icon: 'error',
              title: '资源不可用,请联系管理员',
            })
          }
        }
        wx.navigateTo({
          url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}`,
        });
        if (item.selectType == "document" || item.selectType == "pdf") {
          console.log(item, 'item789');
          // freeFile
          const fileLink = item.file ?
            app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.freeFile