Browse Source

feat: 优化弹窗展示逻辑

zhangyuhan 1 year ago
parent
commit
0d132af4d1
1 changed files with 12 additions and 10 deletions
  1. 12 10
      src/web/staticres/public-pc/js/check-power-and-switch.js

+ 12 - 10
src/web/staticres/public-pc/js/check-power-and-switch.js

@@ -13,8 +13,8 @@ var checkPowerAndSwitchTemplate = `
         </div>
         <div class="check-power-switch-header">
             <p class="check-power-switch-title">身份切换提醒</p>
-        </div> 
-        <div class="check-power-switch-content"></div> 
+        </div>
+        <div class="check-power-switch-content"></div>
         <div class="check-power-switch-footer">
             <button class="j-switch-button confirm">立即切换</button>
             <button class="j-switch-button cancel">暂不切换</button>
@@ -141,7 +141,7 @@ var checkVipExpireStyle = `
     left: 0;
     top: 100px;
   }
-  
+
 .check-vip-expire-header,
 .check-vip-expire-footer {
     position: absolute;
@@ -153,7 +153,7 @@ var checkVipExpireStyle = `
     text-align: center;
     padding: 0 20px;
 }
-  
+
 .check-vip-expire-header {
     top: 10px;
 }
@@ -171,7 +171,7 @@ var checkVipExpireStyle = `
 .text-container.expire-text-center {
     margin-bottom: 20px;
 }
-  
+
 .activity-tip {
     margin-top: 4px;
     display: flex;
@@ -184,7 +184,7 @@ var checkVipExpireStyle = `
     border-radius: 4px;
     background: linear-gradient(90deg, #FF9347 0%, #FF4236 100%);
 }
-  
+
 .confirm-button {
     display: flex;
     align-items: center;
@@ -379,10 +379,12 @@ var checkVipExpireDialog = {
             this.$modal.modal('hide')
         }
     },
-    onDialogClose: function() {
+    onDialogClose: function(type) {
         this.vipRenewReminder(true)
         this.showDialog(false)
-        this.showNext()
+        if (type !== true) {
+          this.showNext()
+        }
     },
     onClickConfirm: function() {
         this.rechargeNow()
@@ -495,9 +497,9 @@ var checkVipExpireDialog = {
         })
     },
     rechargeNow: function() {
-        this.onDialogClose()
+        this.onDialogClose(true)
         setTimeout(() => {
-          window.open('/swordfish/page_big_pc/free/svip/buy?type=renew')
+          window.top.location.href = ('/swordfish/page_big_pc/free/svip/buy?type=renew')
         }, 50)
     }
 };