闫增涛
2024-11-28 dce885689d308043450f199981722b5c80360fe7
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -5,6 +5,12 @@
   * 组件的属性列表
   */
  properties: {
    isBuyBank: {
      type: Boolean
    },
    bankSaleData: {
      type: Object
    },
    list: {
      type: Array,
      value: [],
@@ -70,12 +76,15 @@
          },
        });
      }
      if (!this.data.isBuyBank) return wx.showToast({
        icon: 'error',
        title: '请先购买题库',
      })
      wx.showLoading({
        title: "加载中",
      });
      // 获取章节下是否有题目
      let idPathList = [];
      if (this.properties.storeInfo || this.properties.jslx) {
        idPathList.push({
          id: this.properties.bookInfo.id,
@@ -94,6 +103,7 @@
            size: 999,
          },
        };
        console.log(value.childrenFolderCount, 1234578)
        if (value.childrenFolderCount == 0) {
          wx.hideLoading();
          return wx.showToast({
@@ -110,6 +120,7 @@
              type: item.type,
            });
          });
          console.log(idPathList, 123413456578)
        }
      }
      wx.hideLoading();
@@ -195,5 +206,14 @@
        loading: type,
      });
    },
    // 题库购买
    buyBank() {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {
        bubbles: true,
        composed: true
      } // 触发事件的选项
      this.triggerEvent('buyBank', myEventDetail, myEventOption)
    }
  },
});