...
|
...
|
@@ -30,7 +30,7 @@ var TicketCat = { |
|
|
$biok: $('#bisubmit'),
|
|
|
$loading: $('.loading'),
|
|
|
$payTotal: $('.play-total'),
|
|
|
$toPay: $('.to-play em'),
|
|
|
$toPay: $('.ticket-play em'),
|
|
|
$errorTip: $('.errbitip'),
|
|
|
$tbody: $('table tbody', '.pay-wapper'),
|
|
|
|
...
|
...
|
@@ -40,7 +40,10 @@ var TicketCat = { |
|
|
$ticketModifyBtn: $('.ticket-modify-btn'),
|
|
|
$setTicketMobile: $('.set-ticket-mobile'),
|
|
|
$ticketMobileBtn: $('.ticket-mobile-btn'),
|
|
|
$ticketMobileInput: $('.ticket-mobile-input')
|
|
|
$ticketMobileInput: $('.ticket-mobile-input'),
|
|
|
|
|
|
//变量
|
|
|
phoneReg: /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
|
|
|
},
|
|
|
Data: {
|
|
|
buyNumber: 0,//购买总数量
|
...
|
...
|
@@ -115,10 +118,9 @@ var TicketCat = { |
|
|
|
|
|
//保存手机号按钮
|
|
|
el.$ticketMobileBtn.click(function() {
|
|
|
var val = el.$ticketMobileInput.val(),
|
|
|
phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
|
|
|
var val = el.$ticketMobileInput.val();
|
|
|
|
|
|
if (!phoneReg.test(val)) {
|
|
|
if (!el.phoneReg.test(val)) {
|
|
|
new dialog.Alert('请输入正确的手机号!').show();
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -140,6 +142,7 @@ var TicketCat = { |
|
|
}
|
|
|
});
|
|
|
|
|
|
//使用有货币确认按钮
|
|
|
el.$biok.click(function() {
|
|
|
var pan = $(this).parents('dl.pan');
|
|
|
var selectData = {};
|
...
|
...
|
@@ -221,6 +224,45 @@ var TicketCat = { |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 去支付
|
|
|
$('.ticket-play input.submit').click(function() {
|
|
|
var $this = $(this);
|
|
|
var selectData = _this.getSelectData();
|
|
|
|
|
|
selectData.mobile = el.$ticketMobile.text();
|
|
|
|
|
|
if (!el.phoneReg.test(selectData.mobile)) {
|
|
|
new dialog.Alert('手机号格式不正确!').show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
el.$loading.show();
|
|
|
|
|
|
if (!!$this.attr('disabled')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$this.attr('disabled', 'disabled');
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
url: '/cart/index/ticketOrderSub',
|
|
|
data: selectData
|
|
|
}).then(function(data) {
|
|
|
el.$loading.hide();
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
window.location.href = '/shopping/pay?ordercode=' + data.data.order_code;
|
|
|
} else {
|
|
|
new dialog.Alert('去付款失败!<br /><br />' + data.message).show();
|
|
|
}
|
|
|
}).always(function() {
|
|
|
el.$loading.hide();
|
|
|
$this.removeAttr('disabled');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
//渲染价格明细
|
...
|
...
|
|