修改分页组件在部分场景中存在缓存问题导致部分数据无法查看的问题

This commit is contained in:
2024-08-08 10:30:55 +08:00
parent cf7756dd5c
commit b9e1b06d29
33 changed files with 56 additions and 886 deletions

View File

@@ -35,7 +35,6 @@ Component({
*/
methods: {
back() {
// this.triggerEvent("back")
wx.navigateBack();
}
}

View File

@@ -5,10 +5,26 @@ Component({
properties: {
currentIndex: { //当前页码
type: Number,
value: 1
value: 1,
observer(newVal,oldVal) {// 数据监听
const that = this;
this.setData({
index: newVal
}, () => {
that.updateBtnDis();
})
},
},
totalPage: {
type: Number
type: Number,
observer(newVal,oldVal) {// 数据监听
const that = this;
this.setData({
total: newVal
}, () => {
that.updateBtnDis();
})
},
}
},
@@ -124,17 +140,17 @@ Component({
})
}else if (index == total) { // 最后一页
this.setData({
nextBtnDis: true
nextBtnDis: true,
prevBtnDis: false,
})
} else if (index == 1){ // 第一页
this.setData({
prevBtnDis: true
prevBtnDis: true,
nextBtnDis: false,
})
}else{
this.setData({
prevBtnDis: false
})
this.setData({
prevBtnDis: false,
nextBtnDis: false
})
}

View File

@@ -14,3 +14,4 @@
</view>
</view>
</view>
{{totalPage}}

View File

@@ -15,13 +15,6 @@ Component({
title: String,
},
/**
* 组件的初始数据
*/
data: {
// columns:['杭州', '宁波', '温州', '嘉兴', '湖州']
},
/**
* 组件的方法列表
*/

View File

@@ -3,7 +3,7 @@ import { getTenementList } from "../../service/tenement";
import request from '../../utils/request'
const { OK } = request
// components/select/index.js
Component({
/**
@@ -30,10 +30,6 @@ Component({
*/
methods: {
async onInput(e) {
// this.setData({
// visible: true,
// list: [e.detail, e.detail, e.detail]
// })
switch(this.data.type) {
case 0:
const { data = [], code, message } = await getParkList({ keyword: e.detail });