From 232e4dcf0fc80bdcfff1bdf45431e67c25831fb6 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期五, 28 六月 2024 13:03:24 +0800
Subject: [PATCH] erweima

---
 packageBookService/pages/bookServices/detail/components/testResource/testResource.js |   65 +++++++++++++++++++-------------
 1 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
index 3bcfb6a..09b18ad 100644
--- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
+++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -25,6 +25,10 @@
       type: Object,
       value: {},
     },
+    storeInfo: {
+      type: String,
+      value: "",
+    },
   },
 
   /**
@@ -53,7 +57,7 @@
       })
     },
     async goTest(e) {
-      console.log(e, 666)
+      console.log(e.detail.value.item, 666)
       const value = e.detail.value.item;
       const token = wx.getStorageSync("jsek-token");
       if (!token) {
@@ -69,32 +73,41 @@
       });
       // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰
       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) {
+        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({
@@ -104,7 +117,7 @@
           this.properties.bookInfo.rootCmsItemId
         }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${
           value.name
-        }&answerType=${"option"}`,
+        }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}`,
       });
     },
     goMycollect(e) {

--
Gitblit v1.9.1