闫增涛
2024-09-11 51ad1f2614bc1f976aad98254649bb3c207332ee
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -137,17 +137,15 @@
    goPlayer(e) {
      // 检查登录状态
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
      if (!token) return false
        const item = e.currentTarget.dataset.item;
        const parent = e.currentTarget.dataset.parent;
        const parentProductLinkPath = parent ?
          parent.productLinkPath :
          wx.getStorageSync("teachResourcesPath");
        const parentName = parent ? parent.name : "教学资源";
        if (this.properties.isShowCheck && this.resourceIsBuy(item)) {
          return false;
        }
      // 资源购买页面(只展示未购买资源) 点击不跳转
      if (this.properties.isShowCheck) return false;
        if (
          this.properties.tab == "jsek_cloudLearning" &&
          this.resourceIsBuy(item)
@@ -158,8 +156,6 @@
              "请先购买该资源" : "请先点击领取查看按钮",
          });
        }
        if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) {
          let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile]
          if (file && file.protectType !== "Public") {
@@ -168,13 +164,13 @@
              title: "资源不可用,请联系管理员",
            });
          }
        } else if ((this.properties.tab == "jsek_teachingResources" || this.properties.tab == "jsek_cloudLearning") && (!item.file && !item.freeFile && !item.protectedFile)) {
      }
      if (!item.file && !item.freeFile && !item.protectedFile) {
          return wx.showToast({
            icon: 'error',
            title: '暂无资源',
          })
        }
        if (item.selectType == 'zip') {
          if (this.properties.applyState == 'Normal') {
            return wx.showToast({
@@ -188,7 +184,6 @@
            })
          }
        }
        let url;
        if (item.selectType == "webpage") {
          // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里
@@ -218,7 +213,6 @@
        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}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`,
        });
      }
    },
    // 拿到所有项