Fix:2398 【商城小程序】寻趣味--切换城市后很大概率刷新后店铺重复显示

This commit is contained in:
modendeveloper
2024-09-21 11:23:51 +08:00
parent 1b56642743
commit 83be020182
+11 -4
View File
@@ -137,7 +137,8 @@ export default {
cityName: '', cityName: '',
hotelList: [], hotelList: [],
isLoad: false, isLoad: false,
pageKeyId: Object.freeze('findFunIndex') pageKeyId: Object.freeze('findFunIndex'),
isNext: false
} }
}, },
computed: { computed: {
@@ -152,8 +153,10 @@ export default {
}, },
onReachBottom() { onReachBottom() {
// 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求 // 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求
this.page++ if(this.isNext) {
this.fetchList() this.page++
this.fetchList()
}
}, },
onLoad() { onLoad() {
@@ -173,7 +176,6 @@ export default {
this.cityName = memCityName this.cityName = memCityName
uni.removeStorageSync('cityName') uni.removeStorageSync('cityName')
this.name = '' this.name = ''
this.search()
} }
}, },
methods: { methods: {
@@ -235,6 +237,11 @@ export default {
data[i].videoCover = '' data[i].videoCover = ''
} }
this.hotelList.push(data[i]) this.hotelList.push(data[i])
if(data.length < 10) {
this.isNext = false
} else {
this.isNext = true
}
} }
} }
}).finally(() => { }).finally(() => {