From f72f8966ba4e1715e8df82d5cf1c7e912b6da719 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期一, 01 四月 2024 10:21:07 +0800
Subject: [PATCH] 检索的bug

---
 pages/bookExhibitionList/index.js |  116 ++++++++++++++++++++++++++++------------------------------
 1 files changed, 56 insertions(+), 60 deletions(-)

diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js
index 1febd4e..bd39345 100644
--- a/pages/bookExhibitionList/index.js
+++ b/pages/bookExhibitionList/index.js
@@ -8,6 +8,7 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    keynoteDisabled: true,
     value: '',
     keyword: '',
     nameSort: null,
@@ -25,9 +26,7 @@
     },
     product: {
       value: '*',
-
-      options: [
-        {
+      options: [{
           value: '*',
           label: '鎬诲垎绫�',
         },
@@ -49,9 +48,7 @@
           price: 'jsek_teacherEducation',
           label: '鏁欏笀鏁欒偛',
         },
-
       ],
-
     },
     multipleSelect: {
       value: [],
@@ -60,42 +57,17 @@
     navBarHeight: '',
     barHeight: '',
     windowHeight: '',
+
   },
 
 
 
   /**
-    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
-    */
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
+   */
   onLoad(options) {
-    // 鑾峰彇灞忓箷楂樺害
-    wx.getSystemInfo({
-      success: function (res) {
-        // this.setData({
-        //   windowHeight: res.windowHeight
-        // })
 
-        // 鑾峰彇鑺傜偣鐨勭被鍚�
-        var query = wx.createSelectorQuery();
-        query.select('.assembleContent').boundingClientRect();
-        query.exec(function (res) {
-
-          // console.log(res, 'res');
-          let node = res[0];
-          node.setStyle({
-            backgroundColor: '#0256b9',
-          })
-          // // 淇敼鑺傜偣鏍峰紡
-          // if (node) {
-          //   node.setStyle({
-          //     backgroundColor: 'red',
-          //     color: 'white'
-          //   });
-          // }
-        });
-      }
-    });
-
+    console.log(this.data.keynoteDisabled, 'keynoteDisabled');
     // console.log(this.data.filteredItems, 88888);
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
@@ -114,25 +86,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,
     });
 
+
+    // 
   },
 
   /**
@@ -147,8 +121,8 @@
    */
   onShow() {
     this.bookExhibitionGet()
-
     this.keyProjectsGet()
+
   },
 
   /**
@@ -249,12 +223,24 @@
       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()
@@ -300,6 +286,24 @@
     const newValue = e.detail.value;
     const selectedOption = this.data.product.options.find(option => option.value === newValue);
     const newPrice = selectedOption ? selectedOption.price : null;
+    const bookExhibitionListsubsidiary = []
+    this.setData({
+      bookExhibitionListsubsidiary: this.data.bookExhibitionList
+    })
+    console.log(bookExhibitionListsubsidiary, 'bookExhibitionListsubsidiary');
+    console.log(newValue, 'newValue');
+    console.log(newPrice, 'newPrice');
+
+    if (newPrice) {
+      this.setData({
+        keynoteDisabled: false
+      })
+    }
+    if (!newPrice) {
+      this.setData({
+        keynoteDisabled: true
+      })
+    }
     this.setData({
       'product.value': newValue,
       'product.price': newPrice, // 灏嗛�変腑鐨� price 鍊间繚瀛樺湪鏁版嵁涓�
@@ -311,16 +315,9 @@
     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');
     }
-
   },
 
   // 閲嶇偣椤圭洰
@@ -328,9 +325,13 @@
     this.setData({
       'multipleSelect.value': e.detail.value,
     });
+
   },
   handleConfirm(event) {
-    const { value } = event.detail;
+
+    const {
+      value
+    } = event.detail;
     // 纭鎿嶄綔鐨勫鐞嗛�昏緫
 
     console.log('纭鎿嶄綔锛岄�変腑鐨勫�间负锛�', value);
@@ -338,16 +339,13 @@
     this.bookExhibitionGet()
   },
   handleReset() {
+
     // 閲嶇疆鎿嶄綔鐨勫鐞嗛�昏緫
     this.data.keynoteValue = []
     console.log('閲嶇疆鎿嶄綔');
     this.bookExhibitionGet()
   },
   onSwapRight() {
-    // console.log('xxxxxx');
-    // this.data.nameSort = 'Asc'
-
-
     if (!this.data.nameSort) {
       this.setData({
         nameSort: 'Desc',
@@ -369,8 +367,6 @@
     this.data.nameSort = 'Desc'
     // console.log('sssssss');
     this.bookExhibitionGet()
-
-
   },
   onBookExhibitionDetails: function (event) {
     const item = event.currentTarget.dataset.item;

--
Gitblit v1.9.1