Przeglądaj źródła

Merge branch 'master' of http://192.168.2.88:3000/caiweigan/weixin-h5

caiweigan 6 lat temu
rodzic
commit
95f3b6f612
3 zmienionych plików z 18 dodań i 1 usunięć
  1. 3 1
      js/global.js
  2. 8 0
      js/index.js
  3. 7 0
      register.html

+ 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 batch = getUrlParam("batch");
@@ -90,6 +91,7 @@ function getLocation(successFun, cancelFun) {
             }
         },
         fail : function(res) {
+            $.hideLoading();
             alert("获取位置失败");
         }
     });

+ 8 - 0
js/index.js

@@ -164,6 +164,9 @@ function userIsRegister() {
 
 //红包处理流程
 function redpackProcess() {
+
+    $.showLoading('红包发放中');
+
     getLocation(
         function (latitude,longitude) {
             $.authAjax({
@@ -174,12 +177,17 @@ 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 - 0
register.html

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