litian
2024-07-10 92a0bff4761945ea8fb7a682915ba342cbb51b8d
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -122,15 +122,16 @@
    },
    // 判断资源是否购买
    resourceIsBuy(data) {
      if (data.saleMethod && data.saleMethod.length) {
        if (data.saleMethod[0].State == "Disable") return false;
        const isSHow = this.properties.buyIds.some(
          (item) => item == data.saleMethod[0].Id
        );
        return !isSHow;
      } else {
        return false;
      }
      return true
      // if (data.saleMethod && data.saleMethod.length) {
      //   if (data.saleMethod[0].State == "Disable") return false;
      //   const isSHow = this.properties.buyIds.some(
      //     (item) => item == data.saleMethod[0].Id
      //   );
      //   return !isSHow;
      // } else {
      //   return false;
      // }
    },
    // 跳转音视频播放器
    goPlayer(e) {
@@ -173,7 +174,8 @@
        }
        if (
          this.properties.tab == "jsek_cloudLearning" &&
          this.resourceIsBuy(item)
          // this.resourceIsBuy(item)
          item.saleMethod.length > 0
        ) {
          return wx.showToast({
            icon: "error",
@@ -181,16 +183,16 @@
              "请先购买该资源" : "请先点击领取查看按钮",
          });
        }
        if (
          item.saleMethod.length == 0 &&
          item.sysType == "CmsItem" &&
          this.properties.tab == "jsek_cloudLearning"
        ) {
          return wx.showToast({
            icon: "error",
            title: "暂未开始销售,请联系管理员",
          });
        }
        // 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.file || item.freeFile)) {
          let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile]
          if (file && file.protectType !== "Public") {
@@ -208,11 +210,8 @@
        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}`,
        });
<<<<<<< Updated upstream
=======
        // debugger
>>>>>>> Stashed changes
        if (item.selectType == "pdf" || item.selectType == "document") {
          const fileLink = item.file ? item.file : item.freeFile
          console.log(fileLink);
@@ -221,12 +220,7 @@
              fileLink +
              "&fileName=" +
              item.name +
<<<<<<< Updated upstream
              "&fileType=pdf" +
              "&bookBuy=true"
=======
              "&fileType=pdf" + "&bookBuy=true"
>>>>>>> Stashed changes
          });
        }
        // if (item.selectType == "document") {