Authored by 陈峰

购物车量贩bug

... ... @@ -17,12 +17,12 @@ module.exports = {
assetUrl: '//127.0.0.1:5001',
testCode: 'yoho4946abcdef#$%&!@',
domains: {
// api: 'http://api-test2.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://dev-api.yohops.com:9999/',
// api: 'http://dev-api.yohops.com:9999/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
... ...
... ... @@ -47,20 +47,20 @@
<div class="num">
<span class="name">数量</span>
<div class="clearfix">
<a class="btn btn-minus {{#if @root.discountBuy}}discount-gray{{/if}}" href="javascript:void(0);">
<span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe625;</span>
<a class="btn btn-minus {{#if discountBuy}}discount-gray{{/if}}" href="javascript:void(0);">
<span class="iconfont {{#if ../promotionId}}disabled{{/if}}">&#xe625;</span>
</a>
<input id="good-num" class="good-num disabled" type="text" {{#if @root.discountBuy}}value="{{@root.discountBuy.num}}" {{^}} value="1"{{/if}} disabled="true">
<input id="good-num" class="good-num disabled" type="text" {{#if discountBuy}}value="{{discountBuy.num}}" {{^}} value="1"{{/if}} disabled="true">
<a class="btn btn-plus" href="javascript:void(0);">
<span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe624;</span>
<span class="iconfont {{#if ../promotionId}}disabled{{/if}}">&#xe624;</span>
</a>
</div>
{{#if @root.discountBuy}}
<input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">
{{#if @root.discountBuy.discount}}
<span class="left-num-discount" style="color: #e10;position: absolute;top: 0.5rem;left: 9.5rem;overflow: hidden;white-space: nowrap;width: 5.2rem;-o-text-overflow: ellipsis;text-overflow: ellipsis;">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span>
{{#if discountBuy}}
<input id="mnum" type="hidden" value="{{discountBuy.num}}">
{{#if discountBuy.discount}}
<span class="left-num-discount" style="color: #e10;position: absolute;top: 0.5rem;left: 9.5rem;overflow: hidden;white-space: nowrap;width: 5.2rem;-o-text-overflow: ellipsis;text-overflow: ellipsis;">{{discountBuy.num}}件起购享{{discountBuy.discount}}</span>
{{^}}
<span class="left-num-discount" style="color: #e10;position: absolute;top: 0.5rem;left: 9.5rem;overflow: hidden;white-space: nowrap;width: 5.2rem;-o-text-overflow: ellipsis;text-overflow: ellipsis;">{{@root.discountBuy.num}}件起购</span>
<span class="left-num-discount" style="color: #e10;position: absolute;top: 0.5rem;left: 9.5rem;overflow: hidden;white-space: nowrap;width: 5.2rem;-o-text-overflow: ellipsis;text-overflow: ellipsis;">{{discountBuy.num}}件起购</span>
{{/if}}
{{^}}
<span class="left-num"></span>
... ... @@ -77,4 +77,4 @@
</div>
{{/ cartInfo}}
<input id="promotionId" type="hidden" value="{{promotionId}}">
<input id="single" type="hidden" value="{{@root.single}}">
\ No newline at end of file
<input id="single" type="hidden" value="{{@root.single}}">
... ...
... ... @@ -83,6 +83,7 @@ function disableNumEdit() {
// 初始化购物车面板显示
function init() {
discountNum = $('#mnum').val() - 0;
hasChooseColor = false;
hasChooseSize = false;
$curSizeBlock = null;
... ...
... ... @@ -130,7 +130,7 @@ let cartObj = {
tip.show('请先勾选商品');
return false;
}
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
window.location.href = '/cart/index/new/orderEnsure?cartType=' + cartType;
}
};
... ...
... ... @@ -99,7 +99,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid = true, inValidLow = f
promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id
};
if (goodData.min_buy_number && goodData.min_buy_number > 0) {
if (goodData.min_buy_number && goodData.min_buy_number > 1) {
result.minNumber = parseInt(goodData.min_buy_number, 10);
}
result.maxNumber = parseInt(goodData.storage_number, 10);
... ...