Fix:4032 【商城小程序】查看资讯图片会刷新返回到店铺顶部

This commit is contained in:
LinCyJang
2025-07-29 23:38:37 +08:00
parent 26d8fb88c5
commit 9ddb0b53f3
+10 -2
View File
@@ -587,7 +587,8 @@ export default {
isLoadInfoListSuccess: false, isLoadInfoListSuccess: false,
pageKeyId: '', pageKeyId: '',
shareImg: '', shareImg: '',
videoPlayers: [] videoPlayers: [],
isView: false
} }
}, },
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -669,16 +670,21 @@ export default {
} }
}, },
onShow() { onShow() {
console.log(this.infoArray);
if (!this.isLoad) { if (!this.isLoad) {
return return
} }
this.fetchInnDetail()
if(this.isView) return
if(this.activeIndex === 1) { if(this.activeIndex === 1) {
this.fetchInnInfoList() this.fetchInnInfoList()
return
} }
if (uni.getStorageSync('hotelInfoPublish') === '1') { if (uni.getStorageSync('hotelInfoPublish') === '1') {
this.fetchInnInfoList() this.fetchInnInfoList()
return
} }
this.fetchInnDetail()
}, },
watch: { watch: {
activeIndex: { activeIndex: {
@@ -854,6 +860,7 @@ export default {
} }
uni.$u.debounce(() => { uni.$u.debounce(() => {
hotelNewsView({ id: item.id }).finally(() => { hotelNewsView({ id: item.id }).finally(() => {
this.isView = true
this.infoArray.map(info => { this.infoArray.map(info => {
if (info.id === item.id) { if (info.id === item.id) {
info.pv += 1 info.pv += 1
@@ -1002,6 +1009,7 @@ export default {
_this.isLoad = true _this.isLoad = true
} }
}).finally(() => { }).finally(() => {
this.isView = false
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}) })
}, },