Selaa lähdekoodia

加loading提示

caiweigan 6 vuotta sitten
vanhempi
commit
621eccaf6b
4 muutettua tiedostoa jossa 21 lisäystä ja 7 poistoa
  1. 1 1
      images/style.css
  2. 3 1
      js/global.js
  3. 10 2
      js/index.js
  4. 7 3
      register.html

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
images/style.css


+ 3 - 1
js/global.js

@@ -1,5 +1,6 @@
 //网关对应地址
-var api = "http://192.168.2.40:8080/api/";
+var api = "http://gateway.js-dctech.com/api/";
+// var api = "http://192.168.2.35:8080/api/";
 
 //租户简称
 var abbreviationName = getUrlParam("abbreviationName");
@@ -65,6 +66,7 @@ function getLocation(successFun, cancelFun) {
             }
         },
         fail : function(res) {
+            $.hideLoading();
             alert("获取位置失败");
         }
     });

+ 10 - 2
js/index.js

@@ -129,7 +129,7 @@ function scanRecord(latitude,longitude) {
 function receiveReward() {
     if (!userIsSubscribeApp()) {
         // alert("未关注");
-        location.href = "/qrcode.html";
+        location.href = "http://ws.js-dctech.com/qrcode.html";
         return false;
     }
     if (!userIsRegister()) {
@@ -177,6 +177,9 @@ function userIsRegister() {
 
 //红包处理流程
 function redpackProcess() {
+
+    $.showLoading('红包发放中');
+
     getLocation(
         function (latitude,longitude) {
             $.ajax({
@@ -191,16 +194,21 @@ function redpackProcess() {
                     longitude: longitude
                 },
                 success: function (res) {
+                    $.hideLoading();
                     if (res.code == 0) {
                         $.toast(res.msg);
                     } else {
                         $.toast(res.msg, "cancel");
                     }
                     //TODO 跳转到对应领取成功页面
+                },
+                error: function (res) {
+                    $.hideLoading();
+                    $.toast("请求失败", "cancel");
                 }
             })
         }
     );
 
 
-}
+}

+ 7 - 3
register.html

@@ -90,6 +90,8 @@
     $("#birthDate").calendar();
 
     function submit() {
+        $.showLoading('数据提交中');
+
         //获取js-sdk签名
         createJsapiSignature(currentUrl);
 
@@ -112,10 +114,15 @@
 							json:JSON.stringify(json)
 						},
                         success: function (data) {
+                            $.hideLoading();
                             if (data.code == 0) {
                                 $.toast(data.msg);
                                 hrefIndex();
                             }
+                        },
+						error: function (data) {
+                            $.hideLoading();
+                            $.toast("请求失败", "cancel");
                         }
                     });
 
@@ -128,9 +135,6 @@
             alert("获取凭据失败:"+res);
         });
 
-
-
-
     }
 </script>
 </body>