litian
2024-07-22 f4e7324c27b7c6ecb824029e22a13541c5033ade
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -13,9 +13,24 @@
      type: Object,
      value: "",
    },
    tab: {
      type: String,
      value: "",
    },
    openIds: {
      type: Array,
      value: [],
    },
    mockData: {
      type: Object,
      value: {},
    },
    storeInfo: {
      type: String,
      value: "",
    },
    jslx: {
      type: Boolean,
    },
  },
@@ -27,6 +42,8 @@
    radioItem: "test",
    loading: false,
  },
  ready() {},
  /**
   * 组件的方法列表
@@ -43,7 +60,7 @@
      })
    },
    async goTest(e) {
      const value = e.currentTarget.dataset.value;
      const value = e.detail.value.item;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
@@ -58,32 +75,42 @@
      });
      // 获取章节下是否有题目
      let idPathList = [];
      let query = {
        path: "*",
        queryType: "*",
        productId: this.properties.bookInfo.id,
        cmsPath: value.productLinkPath,
        pading: {
          start: 0,
          size: 999,
        },
      };
      if (value.childrenFolderCount == 0) {
        wx.hideLoading();
        return wx.showToast({
          icon: "error",
          title: "暂无数据",
        });
      if (this.properties.storeInfo || this.properties.jslx) {
        idPathList.push({
          id: this.properties.bookInfo.id,
          name: this.properties.bookInfo.name,
          productLinkPath: value.productLinkPath,
          type: value.type,
        })
      } else {
        const res = await app.MG.store.getProductDetail(query);
        res.datas.cmsDatas[0].datas.forEach((item) => {
          idPathList.push({
            id: item.id,
            name: item.name,
            productLinkPath: item.productLinkPath,
            type: item.type,
        let query = {
          path: "*",
          queryType: "*",
          productId: this.properties.bookInfo.id,
          cmsPath: value.productLinkPath,
          pading: {
            start: 0,
            size: 999,
          },
        };
        if (value.childrenFolderCount == 0) {
          wx.hideLoading();
          return wx.showToast({
            icon: "error",
            title: "暂无数据",
          });
        });
        } else {
          const res = await app.MG.store.getProductDetail(query);
          res.datas.cmsDatas[0].datas.forEach((item) => {
            idPathList.push({
              id: item.id,
              name: item.name,
              productLinkPath: item.productLinkPath,
              type: item.type,
            });
          });
        }
      }
      wx.hideLoading();
      wx.navigateTo({
@@ -93,7 +120,7 @@
          this.properties.bookInfo.rootCmsItemId
        }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${
          value.name
        }&answerType=${"option"}`,
        }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`,
      });
    },
    goMycollect(e) {