From 47e86f543415585ab1e1b2b1ed1d98830817a1be Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 19 九月 2022 09:41:07 +0800
Subject: [PATCH] 2022.9.16
---
pages/m_consult/consultresult/consultresult.js | 125 ++++++++++++-----------------------------
1 files changed, 36 insertions(+), 89 deletions(-)
diff --git a/pages/m_consult/consultresult/consultresult.js b/pages/m_consult/consultresult/consultresult.js
index 7365b04..9c6aa11 100644
--- a/pages/m_consult/consultresult/consultresult.js
+++ b/pages/m_consult/consultresult/consultresult.js
@@ -10,7 +10,21 @@
*/
data: {
keyword: '',
- result: []
+ tabList: [
+ {name: '鍏ㄩ儴',tag: 0},
+ {name: '闂瓟',tag: 0},
+ {name: '妗堜緥',tag: 0},
+ {name: '鏉$洰',tag: 0},
+ {name: '鏂囦欢',tag: 0},
+ ],
+ refresh: false,
+ // keyAll: {keyword: '', type: undefined},
+ // key1: {keyword: '', type: 1},
+ // key2: {keyword: '', type: 2},
+ // key3: {keyword: '', type: 3},
+ // key4: {keyword: '', type: 4},
+ reachBottom: [false, false, false, false, false],
+ tabIndex: 0
},
/**
@@ -21,103 +35,36 @@
this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
console.log(data);
that.setData({
- keyword: data.keyword
+ keyAll: {keyword: data.keyword, type: undefined},
+ key1: {keyword: data.keyword, type: 1},
+ key2: {keyword: data.keyword, type: 2},
+ key3: {keyword: data.keyword, type: 3},
+ key4: {keyword: data.keyword, type: 4},
})
- that.search()
+ // that.search()
})
},
- search () {
- var that = this
- wx.showLoading({
- title: '鎼滅储涓�',
- mask: true,
- success: (res) => {},
- fail: (res) => {},
- complete: (res) => {},
+ onReachBottom() {
+ let reachBottom = [false, false, false, false, false]
+ reachBottom[this.data.tabIndex] = true
+ this.setData({reachBottom})
+ },
+
+ loadingDone(e){
+ this.setData({
+ refresh: false
})
- setTimeout(() => {
- wx.hideLoading()
- }, 20000);
- consultservice.searchLaw(app.globalData.accessToken.userId, this.data.keyword, 1, 5, {
- success (res) {
- let result = []
- let thisTypeId = ''
- let thisIndex = -1
- res.forEach(r => {
- r.des = r.des.replaceAll('\\n', '<br/>')
- if (thisTypeId === '' || thisTypeId != r.typeId) {
- thisTypeId = r.typeId
- thisIndex++
- result.push({
- typeId: r.typeId,
- typeName: r.typeName,
- contents: [r]
- })
- } else {
- result[thisIndex].contents.push(r)
- }
- });
- that.setData({
- result
- })
- console.log(result);
- },
- complete (res) {
- wx.hideLoading()
- }
+ this.setData({
+ refresh: true
})
},
- // gotoDetail (e) {
- // const iList = e.currentTarget.dataset.index.split(',')
- // const i1 = iList[0]
- // const i2 = iList[1]
- // const r = this.data.result[i1]
- // switch (r.typeId) {
- // //娉曞緥娉曡鏂囦欢
- // case 1:
- // const fileId = r.contents[i2].id
- // wx.navigateTo({
- // url: '/pages/m_consult/consultdetail/consultdetail',
- // success: (res) => {
- // // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- // res.eventChannel.emit('acceptDataFromOpenerPage', {
- // fileId: fileId
- // })
- // },
- // })
- // break;
- // //娉曞緥娉曡鏉$洰
- // case 2:
-
- // break;
- // //鎵ф硶妗堜緥
- // case 3:
-
- // break;
- // //鐜繚闂
- // case 4:
-
- // break;
- // default:
- // break;
- // }
- // },
-
- gotoMore(e){
- const typeId = e.currentTarget.dataset.typeid
- const keyword = this.data.keyword
- wx.navigateTo({
- url: '/pages/m_consult/consultresultmore/consultresultmore',
- success: (res) => {
- // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- typeId: typeId,
- keyword: keyword
- })
- },
+ onTabChange(e) {
+ console.log(e.detail);
+ this.setData({
+ tabIndex: e.detail
})
}
})
\ No newline at end of file
--
Gitblit v1.9.3