Fix:2958 【商城小程序】点击“换一换”,浏览店铺列表出现重复店铺数据

This commit is contained in:
linxi
2024-12-27 17:24:16 +08:00
parent cc2664f116
commit cd4bef91c2
+4 -3
View File
@@ -208,7 +208,8 @@ export default {
// 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求
if(this.isNext) {
this.page++
this.fetchList()
const random = this.randomSeed ? 1 : 0
this.fetchList(random, this.randomSeed)
}
},
onLoad() {
@@ -246,6 +247,7 @@ export default {
handleRefresh() {
uni.showLoading()
this.page = 1
this.hotelList = []
this.fetchList(1, this.randomSeed)
},
toTown(town) {
@@ -283,7 +285,7 @@ export default {
if (this.typeIndex === index) return
this.typeIndex = index
this.randomSeed = null
this.currType = index === -1 ? {} : this.typeList[index]
this.name = ''
this.search()
@@ -322,7 +324,6 @@ export default {
if (success) {
if(random === 1) {
this.randomSeed = msg
this.hotelList = []
}
for (let i = 0; i < data.length; i++) {
const cover = data[i].cover