From 4ef1826180997bac879913bf17867bd3e390c29d Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期四, 28 三月 2024 09:24:46 +0800
Subject: [PATCH] 微信支付修改

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   91 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 77 insertions(+), 14 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index a8c4313..1486ac7 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -34,9 +34,19 @@
     isShowCheck: {
       type: Boolean,
       value: false,
+    },
+    paymentPage: {
+      type: Boolean,
+      value: false,
+    },
+    superior: {
+      type: Boolean,
+      value: false,
     }
   },
   data: {
+    sonPurchaseSaleMethodId: '',
+    superiorPurchaseSaleMethodId: [],
     activeValues: [1, 2],
     webpageSrc: '',
     cloudShoppingCart: []
@@ -48,16 +58,25 @@
     console.log('鍑嗗');
   },
   onShow() {
+    debugger
+    this.setData({
+      sonPurchaseSaleMethodId: ''
+    })
+  },
+  onLoad() {
+    this.setData({
+      sonPurchaseSaleMethodId: ''
+    })
   },
   observers: {
     'openIds': function (newValue) {
-      var myEventDetail = {
-      }
-      var myEventOption = {
-        bubbles: true,
-        composed: true
-      }
-      this.triggerEvent('handleTree', myEventDetail, myEventOption)
+      // var myEventDetail = {
+      // }
+      // var myEventOption = {
+      //   bubbles: true,
+      //   composed: true
+      // }
+      // this.triggerEvent('handleTree', myEventDetail, myEventOption)
     }
   },
 
@@ -285,17 +304,37 @@
     // 绔犺妭鍕鹃��
     checkResourceTitle(e) {
       // 杩欎釜鏃跺�檆hecked鐨勫�兼槸fals
+      let checkResourceTitleList = []
       const item = e.currentTarget.dataset.item
+      //
       let list = this.flattenTree([item])
       let ids = []
       list.forEach(item => {
         ids.push(item.id)
       })
+      // console.log(list, 'list789');
       const updatedTreeList = this.findAndUpdateItemsByIds(this.properties.treeList, ids);
       this.setData({
         treeList: updatedTreeList  // 鏇存柊 treeList 鏁版嵁
       });
-      console.log(list, 'list');
+
+      if (!list.checked) {
+        if (this.properties.superior) {
+          console.log(852);
+
+          this.properties.superior = false
+          this.setData({
+            superiorPurchaseSaleMethodId: []
+          })
+        }
+        if (!this.properties.superior) {
+          this.setData({
+            superiorPurchaseSaleMethodId: list
+          })
+        }
+      }
+
+      // console.log(this.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId');
       list.forEach(items => {
         console.log(items.checked, 'itesasd');
         if (!items.checked) {
@@ -304,16 +343,40 @@
           })
         }
       })
-      this.onCloudShoppingCart()
+      // this.onCloudShoppingCart()
     },
     // 瀛愰」鍕鹃��
     checkResource(e) {
       const citem = e.currentTarget.dataset.item
-      console.log(e);
+      console.log(citem, '5648');
       const updataList = this.checkResoucrceInfo(this.properties.treeList, citem.id)
-      console.log(updataList);
+      console.log(citem.checked, 'citem.checked');
+      if (!citem.checked) {
+        //閫変腑鐨勬椂鍊欐坊鍔爄d
+        let sonPurchaseSaleMethodId = this.data.sonPurchaseSaleMethodId || []
+        console.log(this.properties.paymentPage, 'this.properties.paymentPage');
+        if (this.properties.paymentPage) {
+          console.log(789987);
+          sonPurchaseSaleMethodId = []
+          this.properties.paymentPage = false
+        }
+        if (!this.properties.paymentPage) {
+          sonPurchaseSaleMethodId.push(citem.saleMethod[0].Id)
+        }
+
+
+        this.setData({
+          sonPurchaseSaleMethodId: sonPurchaseSaleMethodId
+        })
+        console.log(this.data.sonPurchaseSaleMethodId);
+      } else {
+        // 鍙栨秷閫変腑鐨勬椂鍊欏垹闄d
+
+      }
+
       this.setData({
-        treeList: updataList
+        treeList: updataList,
+
       })
     },
     // 鍔犲叆璐墿杞�
@@ -348,8 +411,8 @@
     },
   },
   onCheckAllChange(e) {
-    debugger
-    console.log('checkbox', e.detail.value);
+    // debugger
+    // console.log('checkbox', e.detail.value);
     // this.setData({
     //   checkAllValues: event.detail,
     // });

--
Gitblit v1.9.1