Browse Source

feat: 优化弹窗样式

cuiyalong 5 tháng trước cách đây
mục cha
commit
1dabc963cc

+ 13 - 4
src/web/staticres/common-module/pc-dialog/js/pc-slide-verify.js

@@ -45,8 +45,17 @@ var slideVerify = {
   initModalZIndex: function() {
     // 修复首页多层弹窗层级问题
     if (!this.$dialog) return
-    var modalInstance = this.$dialog.data('bs.modal')
-    modalInstance.$backdrop.addClass('top-of-login')
+    try {
+      var modalInstance = this.$dialog.data('bs.modal')
+      if (modalInstance) {
+        var backdrop = modalInstance.$backdrop || modalInstance._backdrop
+        if (backdrop) {
+          $(backdrop).addClass('top-of-login')
+        }
+      }
+    } catch (error) {
+      console.log(error)
+    }
   },
   initSlideVerify: function() {
     var el = document.getElementById('slide-wrap');
@@ -86,13 +95,13 @@ var slideVerify = {
           if (res.error_code === 0 && res.data) {
             const pass = res.data && res.data.code === 0
             if (pass) {
+              _this.modalShow(false)
+              reset()
               try {
                 startSendSMSCodeTimer(_this.mold)
               } catch (error) {
                 console.log(error)
               }
-              _this.modalShow(false)
-              reset()
             } else {
               reset()
               _this.capt.refresh()

+ 3 - 3
src/web/templates/common/pc-slide-verify.html

@@ -16,18 +16,18 @@
     left: 50%;
     border-radius: 16px;
     width: unset!important;
+    pointer-events: auto;
   }
 </style>
 <div
   class="modal fade slide-verify-dialog bootstrap-center-dialog"
   id="pc-slide-verify-dialog"
-  class=""
-  tabindex="1"
+  tabindex="-1"
   role="dialog"
   data-backdrop="static"
   aria-hidden="true"
 >
-  <div class="modal-dialog pc-slide-verify-box is-show" style="max-width: 720px; height: 480px; width:100%;">
+  <div class="modal-dialog pc-slide-verify-box is-show">
     <div id="slide-wrap"></div>
   </div>
 </div>