Authored by 郝肖肖

有货币不可使用,提示

... ... @@ -366,12 +366,12 @@
</dl>
{{/if}}
<dl class="play-bi-pan pan">
<dt>使用有货币支付</dt>
<dt class="{{#unless yohoCoinCompute.yohoCoinClick}}not-btn{{/unless}}">使用有货币支付</dt>
<dd>
<ul class="play-pan" id="biprice" data-yoho-coin-num={{yohoCoinCompute.yohoCoinNum}} data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
<li>
<div class="float-left">
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数
有货币满<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>个即可使用,每次使用有货币为<span class="sign-amount num-limit-coin">{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}</span>的整数
</div>
<div class="float-right yoho-coin-help">?
<div class="yoho-coin-help-dialog hide">
... ... @@ -389,8 +389,7 @@
</div>
</li>
<li>
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,
可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span> 个
您当前共有有货币<span class="sign-amount totalYohoCoinNum">{{yohoCoinCompute.totalYohoCoinNum}}</span>个,可用<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span> 个
</li>
<li>
本次使用有货币<span class="sign-amount yohoCoinNum">{{yohoCoinCompute.yohoCoinNum}}</span>个 抵扣<span class="sign-amount yohoCoin">¥{{yohoCoinCompute.yohoCoin}}</span>
... ... @@ -405,6 +404,7 @@
</div>
</li>
</ul>
<div class="errbitip red"></div>
</dd>
</dl>
... ...
... ... @@ -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() {
... ...
... ... @@ -152,6 +152,11 @@
margin-bottom:5px;
}
.pan dt.not-btn {
background: resolve(/order/not-btn.png) no-repeat center center;
cursor: auto;
}
.pan dd {
display: none;
border: 1px #ccc solid;
... ...