...
|
...
|
@@ -51,7 +51,8 @@ |
|
|
orderCode = $('#orderCode').html(),
|
|
|
oldUserCouponPic = $('#oldUserCouponPic').html(),
|
|
|
newUserCouponPic = $('#newUserCouponPic').html(),
|
|
|
tipMessage = $('#tipMessage').html();
|
|
|
tipMessage = $('#tipMessage').html(),
|
|
|
activityID = $('#activityID').html();
|
|
|
|
|
|
$('#phone').bind('input propertychange', function() {
|
|
|
if ($(this).val().length === 11) {
|
...
|
...
|
@@ -93,11 +94,11 @@ |
|
|
reg = /[0-9]{11}/;
|
|
|
if (!reg.test(phone)) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
return;
|
...
|
...
|
@@ -111,6 +112,12 @@ |
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
if (data.result.code === 200) {
|
|
|
if (window._yas) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
activityID: activityID,
|
|
|
returnCode: data.result.returnCode
|
|
|
}, false);
|
|
|
}
|
|
|
if (!data.result.newUser) {
|
|
|
$('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic);
|
|
|
} else {
|
...
|
...
|
@@ -122,48 +129,48 @@ |
|
|
} else if (data.result.geted) {
|
|
|
$('.page .gain-coupon-centent').removeClass('hidden');
|
|
|
$('.page .coupon-centent').addClass('hidden');
|
|
|
$('#mobile').html('优惠券已发放至账户' + data.result.mobile);
|
|
|
$('#mobile').html('优惠券已放至' + data.result.mobile);
|
|
|
} else if (data.result.newUser) {
|
|
|
$('.coupon-centent .phone-input-content').addClass('hidden');
|
|
|
$('.coupon-centent .vertify-input-content').removeClass('hidden');
|
|
|
} else if (data.result.wrongNumb) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
return;
|
|
|
} else if (data.result.oldUserAskCouponOnceMore) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
$('.page .gain-coupon-centent').removeClass('hidden');
|
|
|
$('.page .coupon-centent').addClass('hidden');
|
|
|
$('#mobile').html('优惠券已发放至账户' + data.result.mobile);
|
|
|
$('#mobile').html('优惠券已放至' + data.result.mobile);
|
|
|
}, 2500);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">网络错误<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
}
|
|
|
},
|
|
|
error: function(data) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
|
|
|
console.log(data);
|
|
|
}
|
...
|
...
|
@@ -182,6 +189,12 @@ |
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
if (data.result.code === 200) {
|
|
|
if (window._yas) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
activityID: activityID,
|
|
|
returnCode: data.result.returnCode
|
|
|
}, false);
|
|
|
}
|
|
|
if (!data.result.newUser) {
|
|
|
$('.gain-coupon-centent .coupon img').attr('src', oldUserCouponPic);
|
|
|
} else {
|
...
|
...
|
@@ -199,31 +212,31 @@ |
|
|
$('.coupon-centent .vertify-input-content').removeClass('hidden');
|
|
|
} else if (data.result.wrongNumb) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">手机号错误,请重新输入。<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
return;
|
|
|
} else if (data.result.vertifyWrong) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
return;
|
|
|
} else if (data.result.oldUserAskCouponOnceMore) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">您今天已经领过咯,速度去有货购潮流!<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
$('.page .gain-coupon-centent').removeClass('hidden');
|
|
|
$('.page .coupon-centent').addClass('hidden');
|
...
|
...
|
@@ -235,51 +248,51 @@ |
|
|
// oldUserAskCouponOnceMore
|
|
|
} else {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">' + data.result.message + '<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
}
|
|
|
},
|
|
|
error: function(data) {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">网络错误,稍后再试!<p>');
|
|
|
console.log(data);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
$('#dialog').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
$('#dialog .content').html('<p class="phone-error">验证码错误,请重新输入。<p>');
|
|
|
setTimeout(function() {
|
|
|
$('.messages').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
}, 1400);
|
|
|
}
|
|
|
});
|
|
|
$('.close').on('click', function() {
|
|
|
$('.dialog').addClass('hidden');
|
|
|
$('.keep-out').addClass('hidden');
|
|
|
$('.mask').addClass('hidden');
|
|
|
$('#dialog .content').html(' ');
|
|
|
});
|
|
|
$('.coupon-description span').on('click', function() {
|
|
|
$('#message').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
});
|
|
|
$('.description').on('click', function() {
|
|
|
$('#message').removeClass('hidden');
|
|
|
$('.keep-out').removeClass('hidden');
|
|
|
$('.mask').removeClass('hidden');
|
|
|
});
|
|
|
|
|
|
$('.input-content').on('click', '.get', function() {
|
|
|
if (window._yas) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
receiveCoupon: 'Y'
|
|
|
activityID: activityID
|
|
|
}, true);
|
|
|
}
|
|
|
});
|
...
|
...
|
|