Commit a3dfc727 by 颜景龙

礼物领取

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