From e03417edfeaf52c017e4a5539f3b41ad0204a2f0 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期二, 05 三月 2024 19:03:51 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/jsek-applet

---
 pages/bookExhibitionList/index.js |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js
index c4d4a70..937d286 100644
--- a/pages/bookExhibitionList/index.js
+++ b/pages/bookExhibitionList/index.js
@@ -8,6 +8,8 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    value: '',
+    keyword: '',
     nameSort: null,
     total: null,
     page: {
@@ -17,7 +19,6 @@
     keynoteValue: null,
     filteredItems: [],
     newValue: null,
-    value: '',
     bookExhibitionList: [],
     sorter: {
       value: 'default',
@@ -138,7 +139,10 @@
     wx.showLoading({
       title: '鍔犺浇涓�...',
     })
-
+    let searchObj = {
+      'Name*': this.data.keyword,
+      '||subtitle*': this.data.keyword
+    }
     // console.log(this.data.keynoteValue);
     let sort = {
       Name: this.data.nameSort || 'Desc'
@@ -149,7 +153,8 @@
       queryType: '*',
       fields: {
         jsek_link: [],
-        'bookClassification*': this.data.keynoteValue || []
+        'bookClassification*': this.data.keynoteValue || [],
+        ...searchObj
       },
       paging: this.data.page,
       sort: sort,
@@ -290,13 +295,32 @@
   },
   onSwapRight() {
     // console.log('xxxxxx');
-    this.data.nameSort = 'Asc'
+    // this.data.nameSort = 'Asc'
+
+
+    if (!this.data.nameSort) {
+      this.setData({
+        nameSort: 'Desc',
+      });
+    } else if (this.data.nameSort == 'Desc') {
+      this.setData({
+        nameSort: 'Asc',
+      });
+    } else if (this.data.nameSort == 'Asc') {
+      this.setData({
+        nameSort: '',
+      });
+    }
+
     this.bookExhibitionGet()
+
   },
   onSwapLeft() {
     this.data.nameSort = 'Desc'
     // console.log('sssssss');
     this.bookExhibitionGet()
+
+
   },
   onBookExhibitionDetails: function (event) {
     const item = event.currentTarget.dataset.item;
@@ -304,5 +328,13 @@
     wx.navigateTo({
       url: '/pages/bookExhibitionDetails/index?id=' + item.id // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟
     });
+  },
+  // 鎼滅储妗�
+  onSearchSubmit(e) {
+    this.setData({
+      keyword: e.detail.value
+    })
+    console.log(this.data.keyword, 'keyword');
+    this.bookExhibitionGet()
   }
 })
\ No newline at end of file

--
Gitblit v1.9.1