From 1845fc66deb7676c7cf8a1b73ac1f72517557861 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期日, 28 四月 2024 19:26:14 +0800
Subject: [PATCH] 书展bug1

---
 pages/bookExhibitionList/index.js |   67 ++++++++++++++-------------------
 1 files changed, 29 insertions(+), 38 deletions(-)

diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js
index 2731d08..91e0257 100644
--- a/pages/bookExhibitionList/index.js
+++ b/pages/bookExhibitionList/index.js
@@ -87,7 +87,7 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
-    console.log(this.data.multipleSelect.options.length, '44444');
+
     // this.setData({
     //   'product.value': '*',
     // });
@@ -127,7 +127,7 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-    // debugger
+
     this.bookExhibitionGet()
 
     this.keyProjectsGet(this.data.newPrice)
@@ -309,14 +309,11 @@
 
   },
   //閲嶇偣椤圭洰鎺ュ彛
-  keyProjectsGet() {
-    // debugger
-    if (this.data.multipleSelect.options.length !== 0) {
-      console.log('寮犱竴楦�');
-      this.setData({
-        'multipleSelect.options': [],
-      });
-    }
+  keyProjectsGet(newPrice) {
+    this.setData({
+      filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁�
+    });
+
     //楠ㄦ灦灞�
     this.setData({
       loading: true,
@@ -336,13 +333,8 @@
 
       // 寰幆鐒跺悗鍒ゆ柇鐩稿尮閰嶇殑鏁版嵁璧嬪�肩粰filteredItems
       checkData.option.forEach(item => {
-        if (this.data.newPrice == item.value) {
+        if (newPrice == item.value) {
 
-          if (this.data.filteredItems.length !== 0) {
-            this.setData({
-              filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁�
-            });
-          }
 
 
           this.setData({
@@ -351,13 +343,8 @@
         }
       })
 
-      this.setData({
-        'multipleSelect.options': [],
-      });
+      let singleSelectOptions = []
 
-      const singleSelectOptions = []
-      console.log(this.data.multipleSelect.options, 'multipleSelect.options');
-      console.log(singleSelectOptions, 'singleSelectOptions');
       // 鍗曞垪閫夋嫨鍣ㄩ�夐」
       // 鍗曞垪閫夋嫨鍣ㄩ�夐」
       this.data.filteredItems.forEach(item => {
@@ -381,6 +368,7 @@
       this.setData({
         'multipleSelect.options': singleSelectOptions,
       });
+
 
       // 鍙栨秷楠ㄦ灦灞�
       this.setData({
@@ -407,33 +395,36 @@
   // 鎬诲垎绫�
   onChange(e) {
 
-    this.setData({
-      'multipleSelect.options': [],
-    });
-    console.log(this.data.multipleSelect.options);
+
+
     const newValue = e.detail.value;
-    console.log(newValue);
+
     this.setData({
       'product.value': newValue,
       newValue: newValue
     });
 
-    // let newPrice = ''
+    let newPrice = ''
     if (newValue == 'jsek_bFHigherEducation') {
-      this.setData({
-        newPrice: 'jsek_higherEducation'
-      })
+      newPrice = 'jsek_higherEducation'
+      // this.setData({
+      //   newPrice: 'jsek_higherEducation'
+      // })
     } else if (newValue == 'jsek_bFVocationalEducation') {
-      this.setData({
-        newPrice: 'jsek_vocationalEducation'
-      })
+      // this.setData({
+      //   newPrice: 'jsek_vocationalEducation'
+      // })
+      newPrice = 'jsek_vocationalEducation'
     } else if (newValue == 'jsek_bFTeacherEducation') {
-      this.setData({
-        newPrice: 'jsek_teacherEducation'
-      })
+      // this.setData({
+      //   newPrice: 'jsek_teacherEducation'
+      // })
+      newPrice = 'jsek_teacherEducation'
+    } else {
+      newPrice = ''
     }
 
-    this.keyProjectsGet(this.data.newPrice)
+    this.keyProjectsGet(newPrice)
     this.bookExhibitionGet(newValue);
     if (this.data.keynoteValue) {
       //濡傛灉鏈夋暟鎹氨娓呯┖骞跺埛鏂伴〉闈�

--
Gitblit v1.9.1