litian
2024-09-19 bd459420ad636263be458374319c20d3eeb6f61a
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -233,8 +233,8 @@
          //   title: '暂未开售',
          // })
          const buyList = learn.filter((citem) => this.properties.buyIds.includes(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').Id))
          // 资源和本身都未购买
          if (!buyList.length) {
          if (!buyList.length && learn.length) {
            // 资源和本身都未购买 且 父级或本身有销售方式
            const itemSaleMethod = item.saleMethod && item.saleMethod.length ? item.saleMethod.find(citem => citem.SaleType == 'Normal') : undefined
            return wx.showToast({
              icon: 'error',
@@ -253,7 +253,7 @@
      ) {
        url = "/packageDomain/pages/resourceDetails/myAudio/index";
      }
      if (item.selectType == "picture") {
      if (item.selectType == "picture" || item.selectType == 'document') {
        url = "/packageDomain/pages/resourceDetails/document/index";
      }
      wx.navigateTo({
@@ -326,6 +326,7 @@
    // 全选
    checkAll() {
      wx.showLoading()
      const ids = [];
      let list = [];
      let checked = "";
@@ -357,10 +358,12 @@
        composed: true,
      }; // 触发事件的选项
      this.triggerEvent("changeCheckAll", myEventDetail, myEventOption);
      wx.hideLoading()
    },
    // 章节勾选
    checkResourceTitle(e) {
      wx.showLoading()
      const flag = e.detail.checked;
      // 这个时候checked的值是fals
      const item = e.currentTarget.dataset.item;
@@ -409,9 +412,11 @@
      this.setData({
        openIds: this.data.openIds,
      });
      wx.hideLoading()
    },
    // 子项勾选
    checkResource(e) {
      wx.showLoading()
      const citem = e.currentTarget.dataset.item;
      const parent = e.currentTarget.dataset.parent;
      let outermost;
@@ -478,6 +483,7 @@
          this.triggerEvent("changeListChecked", myEventDetail, myEventOption);
        }
      }
      wx.hideLoading()
    },
    // 加入购物车
    async onCloudShoppingCart(e) {