闫增涛
2024-04-26 eb3cf68faee31402822350045ee08f3fea28cd5c
packageBookService/pages/bookServices/detail/buyResource/index.js
@@ -19,7 +19,8 @@
    checkAllState: true,
    productLinkPath: '',
    refCode: '',
    haider: false
    haider: false,
    naData: false
  },
  /**
@@ -89,7 +90,6 @@
  getTreeList(rootList, pathLength, newArr, path) {
    for (const item of rootList) {
      if (item.productLinkPath.length == pathLength && item.productLinkPath.includes(path)) {
        item.checked = false;
        if (item.sysType == 'CmsItem') {
          if (item.selectType == 'webpage') {
            item.disabled = true
@@ -101,9 +101,6 @@
          if (item.file && item.fileMap && item.fileMap[item.file]) {
            if (item.fileMap[item.file].protectType == 'Private') item.disabled = true
          }
          item.isbuy = this.isShowNeedBuy(item);
          item.isShopCar = this.isShoppingCart(item);
        }
        // newArr.push(item)
        // 在插入过程中对数据进行排序
@@ -239,7 +236,16 @@
            }
          }
        });
        this.getTreeList(res.datas.cmsDatas[0].datas, 17, list, '\\')
        // 显示 需要购买的和需要免费领取的
        const arr = res.datas.cmsDatas[0].datas.filter(item => this.resourceIsBuy(item))
        if (!arr.length) {
          return this.setData({
            loading: false,
            haider: true,
            noData: true
          })
        }
        this.getTreeList(arr, 17, list, '\\')
        list = this.ensureTreeConsistency(list)
        console.log('修改后云', list);
        let result = [];
@@ -594,6 +600,12 @@
  },
  //购买按钮
  batchPurchase() {
    if (!this.data.learn.length) {
      return wx.showToast({
        icon: "error",
        title: '暂无数据',
      })
    }
    let saleMethodIds = [];
    let requests = [];
    let item = [];