From f52c21331fa71bd3ae6be41117f35cb54b076119 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 03 四月 2024 19:34:01 +0800 Subject: [PATCH] 添加复制功能 --- packageBookService/pages/bookServices/detail/components/tree/index.js | 36 +++++++++++++++++++++++++----------- 1 files changed, 25 insertions(+), 11 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js index 079d169..58c7e5a 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.js +++ b/packageBookService/pages/bookServices/detail/components/tree/index.js @@ -41,6 +41,9 @@ type: Boolean, value: false, }, + checkAllState: { + type: Boolean, + }, }, data: { sonPurchaseSaleMethodId: "", @@ -165,7 +168,10 @@ ) { return wx.showToast({ icon: "error", - title: "璇峰厛璐拱璇ヨ祫婧�", + title: + item.saleMethod[0].Price > 0 + ? "璇峰厛璐拱璇ヨ祫婧�" + : "璇峰厛鐐瑰嚮棰嗗彇鏌ョ湅鎸夐挳", }); } wx.navigateTo({ @@ -307,16 +313,9 @@ ids.push(item.id); checked = item.checked; }); - const flag = - list.findIndex((item) => item.checked == false) > -1 ? true : false; - var myEventDetail = { - value: flag, - }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 - var myEventOption = { - bubbles: true, - composed: true, - }; // 瑙﹀彂浜嬩欢鐨勯�夐」 - this.triggerEvent("changeCheckAll", myEventDetail, myEventOption); + // const flag = + // list.findIndex((item) => item.checked == false) > -1 ? true : false; + const flag = this.properties.checkAllState; const updataList = this.findAndUpdateItemsByIds( this.properties.treeList, ids, @@ -331,6 +330,14 @@ this.setData({ treeList: updataList, }); + var myEventDetail = { + value: !flag, + }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("changeCheckAll", myEventDetail, myEventOption); }, // 绔犺妭鍕鹃�� @@ -422,6 +429,8 @@ }); if (shoppingCartGetId.includes(saleMethodId)) { console.log(111); + // this.data.updateShoppingCartHidden(); + // this.data.updateCloudLearning(); wx.showToast({ icon: "error", @@ -448,6 +457,11 @@ }); } }, + sadd() { + this.triggerEvent("updateShoppingCartHidden"); + this.triggerEvent("updateCloudLearning"); + console.log(789); + }, }, catchtap() {}, -- Gitblit v1.9.1