Browse Source

bind phone page

zz 6 năm trước cách đây
mục cha
commit
2dc9c3dcff
1 tập tin đã thay đổi với 39 bổ sung8 xóa
  1. 39 8
      resources/views/pay/order/bindPhone.blade.php

+ 39 - 8
resources/views/pay/order/bindPhone.blade.php

@@ -120,7 +120,6 @@
             border: 1px solid transparent;
             line-height: 45px;
             background: #ff7130;
-            display: inline-block;
         }
 
         .bind-form .submit-wrap button.to-refuse {
@@ -201,6 +200,20 @@
             margin: 0 auto 26px;
             text-align: center;
         }
+
+        .toast-wrap {
+            position: fixed;
+            background: rgba(0, 0, 0, 0.7);
+            color: #fff;
+            left: 50%;
+            top: 50%;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            max-width: 70%;
+            padding: 10px 20px;
+            border-radius: 6px;
+            z-index: 9999;
+        }
     </style>
 </head>
 <body>
@@ -248,6 +261,9 @@
         <button class="close" id="close">知道了</button>
     </div>
 </div>
+<div class="toast-wrap" style="display: none">
+    <p class="toast-content">我是toast内容</p>
+</div>
 </body>
 <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
 <script>
@@ -257,6 +273,19 @@
     var order = "{{ $order }}"
     var from = "{{ $from }}"
 
+    // toast
+    var toast = {
+        show: function(content, cb,last) {
+            $(".toast-wrap")
+                    .text(content)
+                    .fadeIn();
+            setTimeout(function() {
+                $(".toast-wrap").fadeOut();
+                cb && cb();
+            }, last);
+        }
+    };
+
     // 倒计时
     function countDown(time, cb) {
         var timer = null
@@ -270,7 +299,9 @@
     // 残忍拒绝事件
     $("#refuse").on("click", function() {
         if(!$(this).attr('disabled')){
-            location.href = "{!! $url !!}";
+            toast.show('xxx',function(){
+                location.href = "{!! $url !!}";
+            },1000);
         }
     });
      function refuse(){
@@ -314,10 +345,10 @@
     $(".get-code").on("click", function() {
         var phone = $("#phone").val();
         if (!phone) {
-            alert("请输入手机号!");
+            toast.show("请输入手机号!",'',2000);
             return;
         } else if (!reg.test(phone)) {
-            alert("手机号不合法!");
+            toast.show("手机号不合法!",'',2000);
             return;
         }
         $.ajax({
@@ -343,7 +374,7 @@
     $("#bind").on("click", function() {
         var phone = $("#phone").val();
         var code = $("#code").val();
-        if (!phone || !code) alert("手机号或验证码不能为空");
+        if (!phone || !code) toast.show("手机号或验证码不能为空",'',2000);
         else {
             // 绑定逻辑
             $.ajax({
@@ -356,17 +387,17 @@
                         return ;
                     }
                     if($res.code == 10029 || $res.code == 10031){
-                        alert($res.msg);
+                        toast.show($res.msg,'',2000);
                         return ;
                     }
                     if($res.code == 10030){
-                        alert($res.msg);
+                        toast.show($res.msg,'',2000);
                         setTimeout(function(){
                             location.href = "{!! $url !!}";
                         },50);
                         return ;
                     }
-                    alert("系统异常");
+                    toast.show("系统异常",'',2000);
                     return ;
                 }
             })