diff --git a/pages/home/index.vue b/pages/home/index.vue index d366408..4500212 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -872,18 +872,35 @@ export default { changeOldPopup(state) { this.isOldUser = state }, + hasShownDrawPosterInSession() { + const app = getApp && getApp() + return Boolean(app && app.globalData && app.globalData.homeDrawPosterShownInSession) + }, + markDrawPosterShownInSession() { + const app = getApp && getApp() + if (!app) return + if (!app.globalData) { + app.globalData = {} + } + app.globalData.homeDrawPosterShownInSession = true + }, initPosterPopupState(data = {}) { const drawEntranceConfig = data.drawEntranceConfig || {} this.$set(this, 'drawEntranceConfig', drawEntranceConfig) const hasDrawPoster = Number(drawEntranceConfig.homePosterEnable) === 1 + const hasShownDrawPosterInSession = this.hasShownDrawPosterInSession() + const shouldShowDrawPoster = hasDrawPoster && !hasShownDrawPosterInSession + if (shouldShowDrawPoster) { + this.markDrawPosterShownInSession() + } this.canShowOldPoster = Boolean( (data.isOldUserPopupShow || 0) && data.oldUserPopup && data.oldUserPopup.image && (data.lotteryCanDraw || false) ) - this.isDrawPosterVisible = hasDrawPoster - this.isOldUser = !hasDrawPoster && this.canShowOldPoster + this.isDrawPosterVisible = shouldShowDrawPoster + this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster }, showNextPoster() { if (!this.isDrawPosterVisible && this.canShowOldPoster) {