...
|
...
|
@@ -33,6 +33,7 @@ var TicketCat = { |
|
|
$toPay: $('.ticket-play em'),
|
|
|
$errorTip: $('.errbitip'),
|
|
|
$tbody: $('table tbody', '.pay-wapper'),
|
|
|
$yohoCoinHelp: $('.yoho-coin-help'),
|
|
|
|
|
|
//门票js
|
|
|
$showTicketMobile: $('.show-ticket-mobile'),
|
...
|
...
|
@@ -147,6 +148,10 @@ var TicketCat = { |
|
|
el.$pan.find('dt').click(function() {
|
|
|
var pan = $(this).parent('dl.pan');
|
|
|
|
|
|
if ($(this).hasClass('not-btn')) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (pan.find('dd').is(':hidden')) {
|
|
|
c.winShow(pan);
|
|
|
$(this).addClass('active');
|
...
|
...
|
@@ -161,33 +166,35 @@ var TicketCat = { |
|
|
var pan = $(this).parents('dl.pan');
|
|
|
var selectData = {};
|
|
|
|
|
|
if (!$('#biprice').data('yoho-coin-click')) {
|
|
|
$('.errbitip').html('抱歉,您的订单实付款不满足有货币使用条件');
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
$('#biprice').addClass('is-select');
|
|
|
selectData = _this.getSelectData();
|
|
|
|
|
|
if (!/^\d+$/.test(selectData.yohoCoin + '') || selectData.yohoCoin * 1 === 0) {
|
|
|
if (selectData.yohoCoin * 1 <= 0) {
|
|
|
$('.errbitip').html('请输入一个正整数');
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
} else if (selectData.yohoCoin * 1 > $('.play-pan em').text() * 1) {
|
|
|
$('.errbitip').html('您的有货币不足');
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
} else {
|
|
|
el.$loading.show();
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/cart/index/setTicket',
|
|
|
data: selectData,
|
|
|
success: function(data) {
|
|
|
el.$loading.hide();
|
|
|
if (data.code === 200) {
|
|
|
_this.render(data.data);
|
|
|
c.winHide(pan);
|
|
|
} else {
|
|
|
$('.errbitip').html(data.message);
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
el.$loading.show();
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/cart/index/setTicket',
|
|
|
data: selectData,
|
|
|
success: function(data) {
|
|
|
el.$loading.hide();
|
|
|
if (data.code === 200) {
|
|
|
_this.render(data.data);
|
|
|
c.winHide(pan);
|
|
|
} else {
|
|
|
$('.errbitip').html(data.message);
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 修改有货币
|
...
|
...
|
@@ -280,6 +287,12 @@ var TicketCat = { |
|
|
});
|
|
|
});
|
|
|
|
|
|
//有货币帮助弹框
|
|
|
el.$yohoCoinHelp.hover(function() {
|
|
|
$(this).find('.yoho-coin-help-dialog').removeClass('hide');
|
|
|
}, function() {
|
|
|
$(this).find('.yoho-coin-help-dialog').addClass('hide');
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//渲染价格明细
|
...
|
...
|
@@ -312,17 +325,22 @@ var TicketCat = { |
|
|
e.$toPay.html((data.shopping_cart_data.last_order_amount).toFixed(2));
|
|
|
|
|
|
//有货币清零状态更新
|
|
|
$('#biprice').val(accMul(100, data.shopping_cart_data.use_yoho_coin));
|
|
|
if (data.use_yoho_coin === 0) {
|
|
|
$('.errbitip').text('');
|
|
|
} else {
|
|
|
$('.errbitip').text('抵扣' + data.shopping_cart_data.use_yoho_coin.toFixed(2) + '元');
|
|
|
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
|
|
|
$('.not-btn-tip').addClass('hide');
|
|
|
if (!data.yohoCoinCompute.yohoCoinClick) {
|
|
|
//不可以使用状态
|
|
|
$('dl.play-bi-pan').find('dt').addClass('not-btn');
|
|
|
$('.not-btn-tip').removeClass('hide');
|
|
|
}
|
|
|
|
|
|
$('#biprice').data('.yoho-coin-click', data.yohoCoinCompute.yohoCoinClick);
|
|
|
$('#biprice').find('.num-limit-coin').html(data.yohoCoinCompute.yoho_coin_pay_rule.num_limit);
|
|
|
$('#biprice').find('.totalYohoCoinNum').html(data.yohoCoinCompute.totalYohoCoinNum);
|
|
|
$('#biprice').find('.yohoCoinNum').html(data.yohoCoinCompute.yohoCoinNum);
|
|
|
$('#biprice').find('.yohoCoin').html(data.yohoCoinCompute.yohoCoin);
|
|
|
},
|
|
|
getSelectData: function() {
|
|
|
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
|
|
|
var biVal = $('#biprice.is-select').val();
|
|
|
var biVal = $('#biprice.is-select').data('yoho-coin-num') * 1;
|
|
|
var cartType = $('.address-manage').attr('cart-type');
|
|
|
var resultData;
|
|
|
|
...
|
...
|
|