diff --git a/pages/home/index.vue b/pages/home/index.vue index 858c2ea..47a992e 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -916,6 +916,18 @@ export default { } app.globalData.homeDrawPosterShownInSession = true }, + hasShownOldUserPopupInSession() { + const app = getApp && getApp() + return Boolean(app && app.globalData && app.globalData.homeOldUserPopupShownInSession) + }, + markOldUserPopupShownInSession() { + const app = getApp && getApp() + if (!app) return + if (!app.globalData) { + app.globalData = {} + } + app.globalData.homeOldUserPopupShownInSession = true + }, initPosterPopupState(data = {}) { const drawEntranceConfig = data.drawEntranceConfig || {} this.$set(this, 'drawEntranceConfig', drawEntranceConfig) @@ -932,10 +944,19 @@ export default { (data.lotteryCanDraw || false) ) this.isDrawPosterVisible = shouldShowDrawPoster - this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster + const shouldShowOldUserPopup = + !shouldShowDrawPoster && + !hasShownDrawPosterInSession && + this.canShowOldPoster && + !this.hasShownOldUserPopupInSession() + if (shouldShowOldUserPopup) { + this.markOldUserPopupShownInSession() + } + this.isOldUser = shouldShowOldUserPopup }, showNextPoster() { - if (!this.isDrawPosterVisible && this.canShowOldPoster) { + if (!this.isDrawPosterVisible && this.canShowOldPoster && !this.hasShownOldUserPopupInSession()) { + this.markOldUserPopupShownInSession() this.isOldUser = true } },