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 |   91 +++++++++++++++++++++++++++++++--------------
 1 files changed, 62 insertions(+), 29 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
index 88b146f..09b18ad 100644
--- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
+++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -13,9 +13,21 @@
       type: Object,
       value: "",
     },
+    tab: {
+      type: String,
+      value: "",
+    },
+    openIds: {
+      type: Array,
+      value: [],
+    },
     mockData: {
       type: Object,
       value: {},
+    },
+    storeInfo: {
+      type: String,
+      value: "",
     },
   },
 
@@ -28,12 +40,25 @@
     loading: false,
   },
 
+  ready() {},
+
   /**
    * 缁勪欢鐨勬柟娉曞垪琛�
    */
   methods: {
+    testBtn() {
+      this.setData({
+        radioItem: 'test'
+      })
+    },
+    mockBtn() {
+      this.setData({
+        radioItem: 'mock'
+      })
+    },
     async goTest(e) {
-      const value = e.currentTarget.dataset.value;
+      console.log(e.detail.value.item, 666)
+      const value = e.detail.value.item;
       const token = wx.getStorageSync("jsek-token");
       if (!token) {
         return wx.getUserProfile({
@@ -48,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({
@@ -83,7 +117,7 @@
           this.properties.bookInfo.rootCmsItemId
         }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${
           value.name
-        }&answerType=${"option"}`,
+        }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}`,
       });
     },
     goMycollect(e) {
@@ -110,8 +144,7 @@
       this.setData({
         radioItem: e.detail.value,
       });
-      if (e.detail.value == "mock") {
-      }
+      if (e.detail.value == "mock") {}
     },
     async getMockId() {
       wx.showLoading({
@@ -160,4 +193,4 @@
       });
     },
   },
-});
+});
\ No newline at end of file

--
Gitblit v1.9.1