Fix:2398 【商城小程序】寻趣味--切换城市后很大概率刷新后店铺重复显示
This commit is contained in:
+11
-4
@@ -137,7 +137,8 @@ export default {
|
||||
cityName: '',
|
||||
hotelList: [],
|
||||
isLoad: false,
|
||||
pageKeyId: Object.freeze('findFunIndex')
|
||||
pageKeyId: Object.freeze('findFunIndex'),
|
||||
isNext: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -152,8 +153,10 @@ export default {
|
||||
},
|
||||
onReachBottom() {
|
||||
// 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求
|
||||
this.page++
|
||||
this.fetchList()
|
||||
if(this.isNext) {
|
||||
this.page++
|
||||
this.fetchList()
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
@@ -173,7 +176,6 @@ export default {
|
||||
this.cityName = memCityName
|
||||
uni.removeStorageSync('cityName')
|
||||
this.name = ''
|
||||
this.search()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -235,6 +237,11 @@ export default {
|
||||
data[i].videoCover = ''
|
||||
}
|
||||
this.hotelList.push(data[i])
|
||||
if(data.length < 10) {
|
||||
this.isNext = false
|
||||
} else {
|
||||
this.isNext = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
|
||||
Reference in New Issue
Block a user