...
|
...
|
@@ -113,6 +113,10 @@ var Order = { |
|
|
|
|
|
var pan = $(this).parent('dl.pan');
|
|
|
|
|
|
if ($(this).hasClass('not-btn')) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (pan.find('dd').is(':hidden')) {
|
|
|
c.winShow(pan);
|
|
|
|
...
|
...
|
@@ -273,16 +277,18 @@ var Order = { |
|
|
e.$toPay.html((data.last_order_amount).toFixed(2));
|
|
|
|
|
|
//有货币清零状态更新
|
|
|
$('#biprice').val(accMul(100, data.yohoCoinCompute.useYohoCoin));
|
|
|
if (~~data.yohoCoinCompute.useYohoCoin === 0) {
|
|
|
$('.errbitip').text('');
|
|
|
} else {
|
|
|
$('.errbitip').text('抵扣' + data.yohoCoinCompute.useYohoCoin.toFixed(2) + '元');
|
|
|
$('dl.play-bi-pan').find('dt').removeClass('not-btn');
|
|
|
if (!data.yohoCoinCompute.yohoCoinClick) {
|
|
|
$('dl.play-bi-pan').find('dt').addClass('not-btn');
|
|
|
}
|
|
|
$('#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);
|
|
|
|
|
|
//使用的红包
|
|
|
envelopesVal = e.$useEnvelopesInput.data('all') - data.use_red_envelopes;
|
|
|
|
|
|
if (~~data.use_red_envelopes > 0) {
|
|
|
e.$useEnvelopes.find('span').html('-¥' + data.use_red_envelopes.toFixed(2));
|
|
|
e.$useEnvelopes.find('input').attr('data-use', data.use_red_envelopes);
|
...
|
...
|
@@ -380,7 +386,7 @@ var Order = { |
|
|
|
|
|
var $juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked');
|
|
|
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
|
|
|
var biVal = $('#biprice.is-select').val();
|
|
|
var biVal = $('#biprice.is-select').data('yoho-coin-num');
|
|
|
var codeVal = $juangroupInput.val();
|
|
|
var cartType = $('.address-manage').attr('cart-type');
|
|
|
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
|
...
|
...
|
@@ -501,18 +507,18 @@ var Order = { |
|
|
|
|
|
// 优惠券修改
|
|
|
$(document).on('click', '.juan-modify', function() {
|
|
|
|
|
|
|
|
|
var $pan = $('.play-juan-pan');
|
|
|
|
|
|
c.winShow($pan);
|
|
|
c.winShow($('.play-juan-pan'));
|
|
|
});
|
|
|
|
|
|
e.$biok.click(function() {
|
|
|
|
|
|
var pan = $(this).parents('dl.pan');
|
|
|
var juanText;
|
|
|
|
|
|
if (!$('#biprice').data('yoho-coin-click')) {
|
|
|
$('.errbitip').html('抱歉,您的订单实付款不满足有货币使用条件');
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
$('#biprice').addClass('is-select');
|
|
|
|
|
|
getSelectData(function(d) {
|
...
|
...
|
@@ -521,43 +527,34 @@ var Order = { |
|
|
juanText = $('.play-juan input[value="' + d.couponCode + '"]').next().text();
|
|
|
}
|
|
|
|
|
|
//if (d.yohoCoin * 1 === 0) {
|
|
|
if (!/^\d+$/.test(d.yohoCoin + '') || d.yohoCoin * 1 === 0) {
|
|
|
if (d.yohoCoin * 1 <= 0) {
|
|
|
$('.errbitip').html('请输入一个正整数');
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
return false;
|
|
|
|
|
|
} else if (d.yohoCoin * 1 > $('.play-pan em').text() * 1) {
|
|
|
|
|
|
$('.errbitip').html('您的有货币不足');
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
|
|
|
} else {
|
|
|
e.$loading.show();
|
|
|
|
|
|
options = {
|
|
|
type: 'POST',
|
|
|
url: '/cart/index/orderCompute',
|
|
|
data: d,
|
|
|
success: function(data) {
|
|
|
}
|
|
|
|
|
|
e.$loading.hide();
|
|
|
e.$loading.show();
|
|
|
options = {
|
|
|
type: 'POST',
|
|
|
url: '/cart/index/orderCompute',
|
|
|
data: d,
|
|
|
success: function(data) {
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
e.$loading.hide();
|
|
|
|
|
|
u.render(data.data, juanText);
|
|
|
c.winHide(pan);
|
|
|
if (data.code === 200) {
|
|
|
|
|
|
//$('.play-bi-pan dt').hide();
|
|
|
u.render(data.data, juanText);
|
|
|
c.winHide(pan);
|
|
|
|
|
|
} else {
|
|
|
$('.errbitip').html(data.message);
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
}
|
|
|
} else {
|
|
|
$('.errbitip').html(data.message);
|
|
|
$('#biprice').removeClass('is-select');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$.ajax(options);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
$.ajax(options);
|
|
|
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -570,21 +567,6 @@ var Order = { |
|
|
|
|
|
c.winShow($pan);
|
|
|
});
|
|
|
//不须要手动输入有货币了。
|
|
|
// e.$bp.keyup(function() {
|
|
|
|
|
|
|
|
|
// var val = $(this).val();
|
|
|
|
|
|
// //if (val * 1 < 0 || val.indexOf('.') > 0) {
|
|
|
// if (!/^\d+$/.test(val + '')) {
|
|
|
// e.$errorTip.html('请输入一个正整数');
|
|
|
// } else if (val * 1 > $(this).data('bi') * 1) {
|
|
|
// e.$errorTip.html('您的有货币不足');
|
|
|
// } else {
|
|
|
// e.$errorTip.html('抵扣' + (val / 100).toFixed(2) + '元');
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
// 取消yoho 币
|
|
|
$('.cancel-bi').click(function() {
|
...
|
...
|
|