litian
2025-03-11 2c1a13eae201887fdee0a7e0007b7dccdfb4e1db
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -211,12 +211,13 @@
        let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile]
        if (file && file.protectType !== "Public") {
          return wx.showToast({
            icon: "error",
            icon: "none",
            title: "资源不可用,请联系管理员",
          });
        }
      }
      if (this.properties.tab == "jsek_cloudLearning") {
        // 1.找出所有父级目录和本身(有销售方式) 和 云学习本身(有销售方式) 放到一个数组  为空则暂未开放销售
        let learn = []
        if (this.properties.isCloundHaveSaleMethod) {
@@ -226,7 +227,7 @@
          // 1.2 云学习无销售方式,将父级目录和本身加入数组
          learn = this.handleTreeData(this.properties.learnList).filter(
            (citem) => citem.saleMethod &&
            citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal') &&
            citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal' && ditem.Price > 0) &&
            new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() &&
            new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() &&
            item.productLinkPath.includes(citem.productLinkPath)
@@ -236,10 +237,20 @@
        let buyList = []
        if (learn.length) buyList = learn.filter((item) => this.properties.buyIds.includes(item.saleMethod.find((citem) => citem.SaleType == 'Normal').Id))
        // 有父级(包含销售方式),且未购买
        if (learn.length && !buyList.length) return wx.showToast({
          icon: 'error',
          title: '请先购买该资源',
        })
        // if (learn.length && !buyList.length) return wx.showToast({
        //   icon: 'error',
        //   title: '请先购买该资源',
        // })
        if (item.protectedFile || item.freeFile) {
          let file = item.fileMap[item.protectedFile] ? item.fileMap[item.protectedFile] : item.fileMap[item.freeFile]
          if (file && file.protectType !== "Public") {
            return wx.showToast({
              icon: 'none',
              title: "资源不可用,请联系管理员",
            });
          }
        }
      }
      let url;
      if (item.selectType == "video" || item.learnSelectType == "video") {
@@ -255,7 +266,7 @@
        url = "/packageDomain/pages/resourceDetails/document/index";
      }
      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}`,
        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}&source=qrcode`,
      });
    },
@@ -498,7 +509,7 @@
      });
      if (shoppingCartGetId.includes(saleMethodId)) {
        wx.showToast({
          icon: "error",
          icon: "success",
          title: "已添加",
        });
        this.setData({