diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index 4d6776e..4fc75f6 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -587,7 +587,8 @@ export default { isLoadInfoListSuccess: false, pageKeyId: '', shareImg: '', - videoPlayers: [] + videoPlayers: [], + isView: false } }, // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 @@ -669,16 +670,21 @@ export default { } }, onShow() { + console.log(this.infoArray); + if (!this.isLoad) { return } + this.fetchInnDetail() + if(this.isView) return if(this.activeIndex === 1) { this.fetchInnInfoList() + return } if (uni.getStorageSync('hotelInfoPublish') === '1') { this.fetchInnInfoList() + return } - this.fetchInnDetail() }, watch: { activeIndex: { @@ -854,6 +860,7 @@ export default { } uni.$u.debounce(() => { hotelNewsView({ id: item.id }).finally(() => { + this.isView = true this.infoArray.map(info => { if (info.id === item.id) { info.pv += 1 @@ -1002,6 +1009,7 @@ export default { _this.isLoad = true } }).finally(() => { + this.isView = false uni.stopPullDownRefresh() }) },