Authored by yyq

结算页库存不足提示

... ... @@ -150,6 +150,13 @@ const orderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, p
});
}
if (other.continueBuy) {
Object.assign(param, {
is_continue_buy: 'Y'
});
}
return api.get('', param);
};
... ...
... ... @@ -71,7 +71,7 @@
</div>
<div class="goods-wrap">
<div class="block-title">订单商品信息<a href="/cart" class="right">返回购物车修改 ></a></div>
<div class="block-title">订单商品信息<a href="/cart" id="go-cart-btn" class="right">返回购物车修改 ></a></div>
{{#with shoppingCartData}}
{{#isY is_multi_package}}
<div class="multi-package-row">
... ...
... ... @@ -5,7 +5,8 @@
*/
var $ = require('yoho-jquery');
var Hbs = require('yoho-handlebars');
var Hbs = require('yoho-handlebars'),
dialog = require('../common/dialog');
var $balanceDetail = $('#balance-detail'),
$orderPrice = $('#order-price');
... ... @@ -577,9 +578,43 @@ $('#order-submit').click(function() {
url: '/cart/ensure/submit',
data: order
}).then(function(data) {
var rdata, subTip;
if (data.code === 200) {
rdata = data.data;
if (rdata && rdata.is_hint === 'Y') {
if(rdata.hintInfo) {
subTip = rdata.hintInfo.productName || '';
if(subTip && subTip.length > 20) {
subTip = subTip.substr(0, 20) + '...';
}
subTip += rdata.hintInfo.suffix + '<br/>' + rdata.hintInfo.lastLine;
}
new dialog.Dialog({
content: subTip,
className: 'ensure-hint-confirm',
btns: [{
btnClass: ['confirm-sure'],
name: '重新选择商品',
cb: function() {
$('#go-cart-btn').trigger('click');
}
}, {
btnClass: ['confirm-cancel'],
name: '继续结算',
cb: function() {
order.continueBuy = true;
$('#order-submit').trigger('click');
}
}]
}).show();
} else {
location.href = data.data.url;
}
}
});
});
... ...
... ... @@ -1410,3 +1410,16 @@
}
}
}
.ensure-hint-confirm {
.content {
min-height: 90px;
padding: 20px 0;
line-height: 2;
}
.btns > .btn {
width: auto;
padding: 0 6px;
}
}
... ...