From b6923adb7b6a5fcbe4a2eaa06e1ebe0e044ba0e2 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 28 三月 2024 14:22:42 +0800
Subject: [PATCH] 代码合并

---
 pages/bookExhibitionList/index.js |   90 +++++++++++++++++++++++++++++++--------------
 1 files changed, 62 insertions(+), 28 deletions(-)

diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js
index 067ceae..babb3d4 100644
--- a/pages/bookExhibitionList/index.js
+++ b/pages/bookExhibitionList/index.js
@@ -8,6 +8,7 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    keynoteDisabled: true,
     value: '',
     keyword: '',
     nameSort: null,
@@ -25,11 +26,9 @@
     },
     product: {
       value: '*',
-
       options: [
         {
           value: '*',
-
           label: '鎬诲垎绫�',
         },
         {
@@ -57,7 +56,8 @@
       options: [],
     },
     navBarHeight: '',
-    barHeight: ''
+    barHeight: '',
+    windowHeight: '',
 
   },
 
@@ -67,6 +67,8 @@
     * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
     */
   onLoad(options) {
+
+
     // console.log(this.data.filteredItems, 88888);
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
@@ -85,25 +87,27 @@
 
     if (this.data.filteredItems = []) {
       console.log(11111);
-      singleSelectOptions.push({
-        label: '绂佺敤閫夐」',
-        value: 'disabled',
-        disabled: true,
-      });
+      // singleSelectOptions.push({
+      //   label: '鏆傛棤鏁版嵁',
+      //   value: 'disabled',
+      //   disabled: true,
+      // });
+    } else {
+      console.log(7889);
     }
 
-    // singleSelectOptions.push({
-    //   label: '绂佺敤閫夐」',
-    //   value: 'disabled',
-    //   disabled: true,
-    // });
 
 
+
+
+    console.log(this.data.bookExhibitionList.length, 'this.data.bookExhibitionList.length');
     // 鏇存柊鏁版嵁
     this.setData({
       'multipleSelect.options': singleSelectOptions,
     });
 
+
+    // 
   },
 
   /**
@@ -118,8 +122,8 @@
    */
   onShow() {
     this.bookExhibitionGet()
-
     this.keyProjectsGet()
+
   },
 
   /**
@@ -142,7 +146,10 @@
   onPullDownRefresh() {
 
   },
-
+  onPullDownRefresh() {
+    this.data.page.size = 16 //鏇存敼鏄剧ず鐨勫��
+    this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁
+  },
   /**
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
    */
@@ -168,7 +175,9 @@
         'page.size': newSize
       });
       this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁
-      console.log(1111);
+
+
+
     }
   },
 
@@ -199,6 +208,7 @@
       queryType: '*',
       fields: {
         jsek_link: [],
+        subtitle: [],
         'bookClassification*': this.data.keynoteValue || [],
         ...searchObj
       },
@@ -208,16 +218,31 @@
       //   width: 100
       // },
     }).then(res => {
-
+      res.datas.forEach((item) => {
+        item.subtitleName = item.subtitle + item.name
+      })
+      console.log(res, 'item');
       this.data.total = res.total
 
-      //  list.push(res.datas)
+      // list.push(res.datas)
+      console.log(res.datas.length);
+
+
+      if (res.datas.length == 0) {
+        this.setData({
+          keynoteDisabled: true
+        })
+      }
+
       const list = [...res.datas]
 
       this.setData({
         bookExhibitionList: list
       })
-        
+      // 鍒ゆ柇鏁版嵁闀垮害
+      console.log(list.length, 'list.length');
+
+
       //鍙栨秷
       wx.hideLoading()
       // console.log(this.data.bookExhibitionList, '鏁版嵁');
@@ -262,6 +287,18 @@
     const newValue = e.detail.value;
     const selectedOption = this.data.product.options.find(option => option.value === newValue);
     const newPrice = selectedOption ? selectedOption.price : null;
+    console.log(newValue, 'newValue');
+    console.log(newPrice, 'newPrice');
+    if (newPrice) {
+      this.setData({
+        keynoteDisabled: false
+      })
+
+    } else {
+      this.setData({
+        keynoteDisabled: true
+      })
+    }
     this.setData({
       'product.value': newValue,
       'product.price': newPrice, // 灏嗛�変腑鐨� price 鍊间繚瀛樺湪鏁版嵁涓�
@@ -273,15 +310,11 @@
     if (this.data.keynoteValue) {
       //濡傛灉鏈夋暟鎹氨娓呯┖骞跺埛鏂伴〉闈�
       this.data.keynoteValue = []
-
       this.bookExhibitionGet(newValue)
       this.onLoad()
-      console.log('true');
-    } else {
-      // this.bookExhibitionGet(newValue);
-      // this.keyProjectsGet(newPrice);
-      console.log('fals');
     }
+
+
 
   },
 
@@ -290,8 +323,10 @@
     this.setData({
       'multipleSelect.value': e.detail.value,
     });
+
   },
   handleConfirm(event) {
+
     const { value } = event.detail;
     // 纭鎿嶄綔鐨勫鐞嗛�昏緫
 
@@ -300,6 +335,7 @@
     this.bookExhibitionGet()
   },
   handleReset() {
+
     // 閲嶇疆鎿嶄綔鐨勫鐞嗛�昏緫
     this.data.keynoteValue = []
     console.log('閲嶇疆鎿嶄綔');
@@ -331,14 +367,12 @@
     this.data.nameSort = 'Desc'
     // console.log('sssssss');
     this.bookExhibitionGet()
-
-
   },
   onBookExhibitionDetails: function (event) {
     const item = event.currentTarget.dataset.item;
     console.log(item);
     wx.navigateTo({
-      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟
+      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name + '&subtitleName=' + item.subtitleName // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟
     });
   },
   // 鎼滅储妗�

--
Gitblit v1.9.1