From 08bcd17001c34265d77b684cfe1bfb1eb1a08113 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期三, 27 三月 2024 16:34:47 +0800
Subject: [PATCH] 电子书,样书

---
 packageBookService/pages/bookServices/detail/buyResource/index.js |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/buyResource/index.js b/packageBookService/pages/bookServices/detail/buyResource/index.js
index bc7e7eb..77e65ca 100644
--- a/packageBookService/pages/bookServices/detail/buyResource/index.js
+++ b/packageBookService/pages/bookServices/detail/buyResource/index.js
@@ -14,12 +14,14 @@
     loading: false,
     shoppingList: [],
     shoppingCartGetId: [],
+    methodId: []
   },
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
+
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
     const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴�
@@ -34,7 +36,46 @@
     this.getShoppingCartProductGet()
     this.getBookInfo(options.bookId)
   },
+  batchPurchase() {
+    let saleMethodIds = []
+    let requests = []
+    const child = this.selectComponent('#tree')
 
+    console.log(child.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId');
+    const item = child.data.superiorPurchaseSaleMethodId
+    if (item) {
+      item.forEach(item => {
+        if (item.saleMethod != 0) {
+          saleMethodIds = item.saleMethod[0].Id
+          requests.push({ saleMethodIds, count: 1 })
+        }
+      })
+      console.log(requests, 'saleMethodId');
+      let query = {
+        remarks: '浜戝涔�',
+        requests,
+
+
+
+      }
+
+      // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉
+      const res = app.MG.store.initOrder(query)
+      let bookOrdersId = res.orderNumber
+      // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪
+      if (bookOrdersId) {
+        const url = '/pages/cart/paymentPage/index?orderNumber=' + bookOrdersId
+        wx.navigateTo({
+          url
+        })
+      }
+    }
+
+    // console.log(child.data.sonPurchaseSaleMethodId, 'child.data.');
+    // this.data.methodId.push(child.data.sonPurchaseSaleMethodId)
+
+
+  },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
@@ -329,12 +370,12 @@
     for (let i = 0; i < data.length; i++) {
       if (index < 3) {
         const item = data[i]
-        if (item.childrenFolderCount > 0) {
+        if (item.children && item.children.length > 0) {
           result.push(item.id)
           for (let j = 0; j < item.children.length; j++) {
             if (index < 3) {
               const childrenItme = item.children[j]
-              if (item.childrenCount > 0) {
+              if (item.children && item.children.length > 0) {
                 result.push(childrenItme.id)
                 index += 1
               }
@@ -342,7 +383,7 @@
               break
             }
           }
-        } else if (item.childrenCount > 0) {
+        } else if (item.children && item.children.length > 0) {
           result.push(item.id)
           index += 1
         }
@@ -365,5 +406,6 @@
   checkAll() {
     const child = this.selectComponent('#tree')
     child.checkAll()
-  }
+  },
+
 })
\ No newline at end of file

--
Gitblit v1.9.1