zhongshujie
5 天以前 dc19fdf86993b2ddeb6b92e2561cb01176ded889
packageBookService/pages/psychologyAnswer/psychologyAnswer.js
@@ -56,20 +56,40 @@
        }
      }
      const indexof = listIndex
      const questionId = questionList[indexof].id;
      const idPath = questionList[indexof].idPath;
      const bookId = questionList[indexof].bookId;
      const bookName = "大学生心理健康(第3版)(融媒体版)"
      const formPath = "questionBank"
      // 进行处理
      const query = {
        "cmsItemId": Number(questionId)
        path: "*",
        queryType: "*",
        productId: bookId,
        cmsPath: "161796",
        cmsType: "*"
      };
      app.MG.file.checkCmsItem(query)
        .then((res) => {
          const isBuys = res;
      app.MG.store.getProductDetail(query).then(async (res) => {
        const linkPathList = res.datas.cmsDatas[0].datas
        const isBuyList = res.datas.purchasedSaleMethodIdList
        let isBuy = false
        const idParhList = idPath.split("/").reverse()
        for (let index = 0; index < idParhList.length; index++) {
          const item = idParhList[index];
          const thisItem = linkPathList.find(citem => item == citem.id);
          if (thisItem.saleMethod.length > 0) {
            if (isBuyList.includes(thisItem.saleMethod[0].Id)) {
              isBuy = true
              break
            } else {
              isBuy = false
              break
            }
          }
        }
          this.setData({
            isBuy: isBuys
          isBuy: isBuy
          });
          if (!isBuys) {
        if (!isBuy) {
            wx.showModal({
              icon: 'error',
              title: '温馨提示',
@@ -88,8 +108,7 @@
          }
          // 其他逻辑
          this.initialize()
        })
        .catch((err) => {
      }).catch((err) => {
          console.error('检查题库失败:', err);
          wx.showToast({
            icon: 'error',