Commit a3dfc727 by 颜景龙

礼物领取

parent 57ac99e5
正在显示 包含 24 行增加10 行删除
...@@ -348,8 +348,8 @@ ...@@ -348,8 +348,8 @@
<script src="../js/zepto.alert.js"></script> <script src="../js/zepto.alert.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var HTTP_URL = 'http://192.168.31.182:8080/wedo-fit'; //var HTTP_URL = 'http://192.168.31.182:8080/wedo-fit';
//var HTTP_URL = 'http://192.168.31.217:8080/wedo'; var HTTP_URL = 'http://192.168.31.217:8080/wedo';
function getUrlParam(name) { function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
...@@ -409,6 +409,7 @@ ...@@ -409,6 +409,7 @@
}); });
if (id && customerUserId) { if (id && customerUserId) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: HTTP_URL+"/wedofit/gift/info", url: HTTP_URL+"/wedofit/gift/info",
...@@ -436,13 +437,17 @@ ...@@ -436,13 +437,17 @@
} }
$('#submitBtn').on('click', function(e) {
$('#submitBtn').addClass("disabled");
});
$("#uploadForm").mvalidate({ $("#uploadForm").mvalidate({
type:1, type:1,
onKeyup:true, onKeyup:true,
sendForm:true, sendForm:true,
firstInvalidFocus: true, firstInvalidFocus: true,
invalid:function() { invalid:function() {
$('#submitBtn').removeClass("disabled");
}, },
valid:function(event,options){ valid:function(event,options){
//点击提交按钮时,表单通过验证触发函数 //点击提交按钮时,表单通过验证触发函数
...@@ -456,6 +461,7 @@ ...@@ -456,6 +461,7 @@
userId: parseInt($("#customerUserId").val()) userId: parseInt($("#customerUserId").val())
}; };
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: HTTP_URL+"/wedofit/gift/getGift", url: HTTP_URL+"/wedofit/gift/getGift",
...@@ -463,6 +469,7 @@ ...@@ -463,6 +469,7 @@
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
success: function(result){ success: function(result){
$('#submitBtn').removeClass("disabled");
if (result.code == 0) { if (result.code == 0) {
$("#uploadForm")[0].reset(); $("#uploadForm")[0].reset();
$.dialog({ $.dialog({
...@@ -473,7 +480,7 @@ ...@@ -473,7 +480,7 @@
}); });
} else { } else {
$.dialog({ $.dialog({
content : result.data, content : result.message,
title: 'alert', title: 'alert',
width: 600, width: 600,
time : 2000 time : 2000
...@@ -481,7 +488,13 @@ ...@@ -481,7 +488,13 @@
} }
}, },
error: function(xhr, type){ error: function(xhr, type){
alert('系统错误!'); $.dialog({
content : "系统错误!",
title: 'alert',
width: 600,
time : 2000
});
$('#submitBtn').removeClass("disabled");
} }
}); });
......
...@@ -85,9 +85,9 @@ ...@@ -85,9 +85,9 @@
if (r != null) return unescape(r[2]); return null; //返回参数值 if (r != null) return unescape(r[2]); return null; //返回参数值
} }
var HTTP_URL = 'http://192.168.31.182:8080/wedo-fit'; //var HTTP_URL = 'http://192.168.31.182:8080/wedo-fit';
//var HTTP_URL = 'http://192.168.31.217:8080/wedo'; var HTTP_URL = 'http://192.168.31.217:8080/wedo';
var id = getUrlParam('id'); var id = getUrlParam('id');
var customerUserId = getUrlParam('customerUserId'); var customerUserId = getUrlParam('customerUserId');
...@@ -101,6 +101,10 @@ ...@@ -101,6 +101,10 @@
$('html').css({'font-size':$(window).width()/375*16}); $('html').css({'font-size':$(window).width()/375*16});
}); });
setTimeout(function() {
$('.loading').remove();
}, 200);
if (id && customerUserId) { if (id && customerUserId) {
$.ajax({ $.ajax({
type: 'get', type: 'get',
...@@ -115,9 +119,6 @@ ...@@ -115,9 +119,6 @@
location.href = './gift.html?id=' + id + "&customerUserId=" + customerUserId; location.href = './gift.html?id=' + id + "&customerUserId=" + customerUserId;
} }
}); });
setTimeout(function() {
$('.loading').remove();
}, 200);
} }
}, },
error: function(xhr, type){ error: function(xhr, type){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此消息的编辑!
注册登录 后发表评论