Browse Source

feat:工作台首页活动广告位展示时机处理

zhangsiya 11 months ago
parent
commit
486603b1c6
1 changed files with 3 additions and 20 deletions
  1. 3 20
      apps/bigmember_pc/src/components/ad/activity-dialog.vue

+ 3 - 20
apps/bigmember_pc/src/components/ad/activity-dialog.vue

@@ -145,9 +145,9 @@ export default {
       try {
       try {
         const { info } = await this.getAdInfoFromRequest(codes)
         const { info } = await this.getAdInfoFromRequest(codes)
         this.info = info || {}
         this.info = info || {}
-        const needShow = this.checkDialogShow()
-        if (this.hasAdPic && needShow) {
-          this.showDialog(needShow)
+        // p599需求更改为,有则展示,无广告图片则不展示,展示时机由服务端处理
+        if (this.hasAdPic) {
+          this.showDialog(true)
         } else {
         } else {
           // 无广告位或者展示过了,可以初始化下一个广告位
           // 无广告位或者展示过了,可以初始化下一个广告位
           this.initNextDialog()
           this.initNextDialog()
@@ -170,19 +170,6 @@ export default {
         console.warn(msg)
         console.warn(msg)
       }
       }
     },
     },
-    checkDialogShow() {
-      const { week } = this.dateInfo
-      const { storageKey } = this
-      let needShowDialog = false
-      // 获取localStorage存的值
-      const mark = localStorage.getItem(storageKey)
-      if (mark && mark === String(week)) {
-        // 说明今天弹窗出现过了,此时不在弹
-      } else {
-        needShowDialog = true
-      }
-      return needShowDialog
-    },
     async openAD() {
     async openAD() {
       if (this.beforeOpen) {
       if (this.beforeOpen) {
         const prevent = await this.beforeOpen()
         const prevent = await this.beforeOpen()
@@ -212,10 +199,6 @@ export default {
       this.$emit('initNext')
       this.$emit('initNext')
     },
     },
     onDialogClose() {
     onDialogClose() {
-      // 刷新localStorage的值
-      const { week } = this.dateInfo
-      const { storageKey } = this
-      localStorage.setItem(storageKey, week)
       this.initNextDialog()
       this.initNextDialog()
     }
     }
   }
   }