From a75b18a4157ab486e0b51c438ac165ab3a08e3e0 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 25 七月 2024 18:10:00 +0800
Subject: [PATCH] 代码提交
---
wechat_jiaxuan/components/disCase/index.js | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/wechat_jiaxuan/components/disCase/index.js b/wechat_jiaxuan/components/disCase/index.js
index f10577b..96fca1a 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,6 +15,7 @@
cateList: [],
dataList: [],
+ total: 0,
pageNum: 1,
pageSize: 10,
query: '',
@@ -46,13 +47,30 @@
catalogCode,pageNum,pageSize,tagCodes, sortType,query
}).then(res => {
if(res.data){
- this.setData({ dataList: res.data.records })
+ 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){
@@ -78,6 +96,15 @@
const index = tagCodes.indexOf(code)
if(index === -1){
+ // 鍚宲aram閲宑ode閲嶅
+ if(activeParam && activeParam.length > 0){
+ activeParam.forEach(item => {
+ const indexTemp = tagCodes.indexOf(item.labelValueCode)
+ if(indexTemp > -1){
+ tagCodes.splice(indexTemp, 1)
+ }
+ })
+ }
tagCodes.push(code)
cateList[activeIndex].paramIndex = paramIndex
cateList[activeIndex].paramName = activeParam[paramIndex].labelValueName
@@ -86,6 +113,7 @@
cateList[activeIndex].paramIndex = -1
cateList[activeIndex].paramName = ''
}
+ this.setData({ pageNum: 1,dataList: [],total: 0})
this.setData({ tagCodes, cateList })
console.log('tagCodes', tagCodes);
},
@@ -98,10 +126,12 @@
this.setData({ tagCodes: [],activeParam: [],cateList,activeIndex: -1 })
},
bindblur() {
+ this.setData({ pageNum: 1,dataList: [],total: 0})
this.getList()
},
subParam() {
this.setData({ activeParam: [] })
+ this.setData({ pageNum: 1,dataList: [],total: 0})
this.getList()
},
changeShowParams(e){
--
Gitblit v1.9.3