From 1941e9fc342b3a2cb6d32e9658ad46f29f50a5df Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 22 七月 2024 15:36:11 +0800
Subject: [PATCH] 代码提交
---
wechat_jiaxuan/components/disCase/index.js | 36 +++++++++++++++++++++++++++++-------
1 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/wechat_jiaxuan/components/disCase/index.js b/wechat_jiaxuan/components/disCase/index.js
index 1059c35..835f66a 100644
--- a/wechat_jiaxuan/components/disCase/index.js
+++ b/wechat_jiaxuan/components/disCase/index.js
@@ -4,7 +4,7 @@
* 缁勪欢鐨勫睘鎬у垪琛�
*/
properties: {
-
+ menuButtonInfo: Object
},
data: {
activeIndex: -1,
@@ -15,9 +15,10 @@
cateList: [],
dataList: [],
+ total: 0,
pageNum: 1,
pageSize: 10,
- search: '',
+ query: '',
sortType: 'NORMAL',
catalogCode: 'whole_case'
},
@@ -28,7 +29,7 @@
getCatelist(){
const { catalogCode } = this.data
getCataLogTagList({
- catalogCode: 'real_case'
+ catalogCode
}).then(res => {
if(res.data && res.data.length > 0){
this.setData({
@@ -41,16 +42,35 @@
})
},
getList() {
- const { sortType, search, tagCodes, pageNum, pageSize } = this.data
+ const { sortType, query, tagCodes, pageNum, pageSize,catalogCode } = this.data
getZhongTaiWholecasePage({
- catalogCode: 'whole_case',tagCodes,pageNum,pageSize, sortType,search
+ catalogCode,pageNum,pageSize,tagCodes, sortType,query
}).then(res => {
- this.setData({ dataList: res.data.records })
+ if(res.data){
+ this.setData({
+ total: res.data.total,
+ dataList: [...this.data.dataList, ...res.data.records],
+ })
+ }
})
+ },
+ scrolltolower() {
+ console.log('瑙﹀簳浜嬩欢');
+ const { total, dataList, pageNum } = this.data
+ if(total > dataList.length){
+ this.setData({ pageNum: pageNum + 1 })
+ this.getList()
+ }else{
+ wx.showToast({
+ title: '鏆傛棤鏇村鏁版嵁',
+ icon: 'none'
+ })
+ }
},
statusChange(e) {
const sortType = e.currentTarget.dataset.status
this.setData({sortType})
+ this.setData({ pageNum: 1,dataList: [],total: 0})
this.getList()
},
handleAction(e){
@@ -64,8 +84,9 @@
})
},
handleDetail(e) {
+ const id = e.currentTarget.dataset.id
wx.navigateTo({
- url: '/pages/detailDis/case',
+ url: '/pages/detailDis/case?id=' + id,
})
},
tagClick(e) {
@@ -83,6 +104,7 @@
cateList[activeIndex].paramIndex = -1
cateList[activeIndex].paramName = ''
}
+ this.setData({ pageNum: 1,dataList: [],total: 0})
this.setData({ tagCodes, cateList })
console.log('tagCodes', tagCodes);
},
--
Gitblit v1.9.3