Browse Source

feat: pc超级订阅到期提醒弹窗添加关闭按钮

cuiyalong 1 year ago
parent
commit
c6d58e92c0
1 changed files with 26 additions and 5 deletions
  1. 26 5
      src/web/staticres/public-pc/js/check-power-and-switch.js

+ 26 - 5
src/web/staticres/public-pc/js/check-power-and-switch.js

@@ -44,6 +44,9 @@ var checkVipExpireDialogTemplate = `
                 </button>
             </div>
         </div>
+        <div class="dialog-close pointer">
+            <img src="/images/pc/close-icon.png">
+        </div>
     </div>
 </div>
 `
@@ -191,6 +194,15 @@ var checkVipExpireStyle = `
     border-radius: 8px;
     background: linear-gradient(117.49deg, #3E3835 8.4%, #242120 100%);
 }
+.check-vip-expire-box .dialog-close {
+    position: absolute;
+    bottom: -40px;
+    left: 50%;
+    transform: translateX(-50%);
+    display: block;
+    width: 24px;
+    height: 24px;
+}
 </style>
 `
 
@@ -345,6 +357,9 @@ var checkVipExpireDialog = {
         this.$modal.find('.confirm-button').on('click', function() {
             _this.onClickConfirm()
         })
+        this.$modal.find('.dialog-close').on('click', function() {
+            _this.onDialogClose()
+        })
     },
     showDialog(f) {
         if (f) {
@@ -450,15 +465,21 @@ var checkVipExpireDialog = {
             success: function(res) {
                 if (res && res.data && res.data.endDays !== undefined) {
                     _this.pInfo = res.data
-                    _this.initDOM()
-                    _this.renderDialogContentText()
-                    _this.showDialog(true)
+                    if (_this.pInfo.endDays >= 0) {
+                        _this.initDOM()
+                        _this.renderDialogContentText()
+                        _this.showDialog(true)
+                    }
                 } else {
-                    _this.showNext()
+                    if (!clear) {
+                        _this.showNext()
+                    }
                 }
             },
             error: function() {
-                _this.showNext()
+                if (!clear) {
+                    _this.showNext()
+                }
             }
         })
     },