闫增涛
2024-04-09 3b22db15cfc9f3704c4654df9d694ebfc16875bf
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -166,8 +166,7 @@
          return wx.showToast({
            icon: "error",
            title: item.saleMethod[0].Price > 0 ?
              "请先购买该资源" :
              "请先点击领取查看按钮",
              "请先购买该资源" : "请先点击领取查看按钮",
          });
        }
        wx.navigateTo({
@@ -378,11 +377,20 @@
    // 子项勾选
    checkResource(e) {
      const citem = e.currentTarget.dataset.item;
      console.log(citem, "5648");
      const parent = e.currentTarget.dataset.parent
      const childrenList = parent.children.filter(item => item.id !== citem.id)
      const flag = childrenList.findIndex(item => item.checked == false)
      const updataList = this.checkResoucrceInfo(
        this.properties.treeList,
        citem.id
      );
      if (flag == -1) {
        if (citem.checked == false) {
          this.findAndUpdateItemsByIds(this.properties.treeList, [parent.id], true)
        } else {
          this.findAndUpdateItemsByIds(this.properties.treeList, [parent.id], false)
        }
      }
      if (!citem.checked) {
        //选中的时候添加id
        let sonPurchaseSaleMethodId = this.data.sonPurchaseSaleMethodId || [];