From 42cc31916c043f681c271efeb73394260e7d77aa Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 05 三月 2024 18:53:11 +0800 Subject: [PATCH] 合并 --- 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