Authored by 陈峰

购物车量贩bug

@@ -17,12 +17,12 @@ module.exports = { @@ -17,12 +17,12 @@ module.exports = {
17 assetUrl: '//127.0.0.1:5001', 17 assetUrl: '//127.0.0.1:5001',
18 testCode: 'yoho4946abcdef#$%&!@', 18 testCode: 'yoho4946abcdef#$%&!@',
19 domains: { 19 domains: {
20 - // api: 'http://api-test2.yohops.com:9999/', 20 + api: 'http://api-test3.yohops.com:9999/',
21 // service: 'http://service-test3.yohops.com:9999/', 21 // service: 'http://service-test3.yohops.com:9999/',
22 // liveApi: 'http://testapi.live.yohops.com:9999/', 22 // liveApi: 'http://testapi.live.yohops.com:9999/',
23 // singleApi: 'http://api-test3.yohops.com:9999/', 23 // singleApi: 'http://api-test3.yohops.com:9999/',
24 24
25 - api: 'http://dev-api.yohops.com:9999/', 25 + // api: 'http://dev-api.yohops.com:9999/',
26 service: 'http://service.yoho.cn/', 26 service: 'http://service.yoho.cn/',
27 liveApi: 'http://api.live.yoho.cn/', 27 liveApi: 'http://api.live.yoho.cn/',
28 singleApi: 'http://single.yoho.cn/', 28 singleApi: 'http://single.yoho.cn/',
@@ -47,20 +47,20 @@ @@ -47,20 +47,20 @@
47 <div class="num"> 47 <div class="num">
48 <span class="name">数量</span> 48 <span class="name">数量</span>
49 <div class="clearfix"> 49 <div class="clearfix">
50 - <a class="btn btn-minus {{#if @root.discountBuy}}discount-gray{{/if}}" href="javascript:void(0);">  
51 - <span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe625;</span> 50 + <a class="btn btn-minus {{#if discountBuy}}discount-gray{{/if}}" href="javascript:void(0);">
  51 + <span class="iconfont {{#if ../promotionId}}disabled{{/if}}">&#xe625;</span>
52 </a> 52 </a>
53 - <input id="good-num" class="good-num disabled" type="text" {{#if @root.discountBuy}}value="{{@root.discountBuy.num}}" {{^}} value="1"{{/if}} disabled="true"> 53 + <input id="good-num" class="good-num disabled" type="text" {{#if discountBuy}}value="{{discountBuy.num}}" {{^}} value="1"{{/if}} disabled="true">
54 <a class="btn btn-plus" href="javascript:void(0);"> 54 <a class="btn btn-plus" href="javascript:void(0);">
55 - <span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe624;</span> 55 + <span class="iconfont {{#if ../promotionId}}disabled{{/if}}">&#xe624;</span>
56 </a> 56 </a>
57 </div> 57 </div>
58 - {{#if @root.discountBuy}}  
59 - <input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">  
60 - {{#if @root.discountBuy.discount}}  
61 - <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> 58 + {{#if discountBuy}}
  59 + <input id="mnum" type="hidden" value="{{discountBuy.num}}">
  60 + {{#if discountBuy.discount}}
  61 + <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>
62 {{^}} 62 {{^}}
63 - <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> 63 + <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>
64 {{/if}} 64 {{/if}}
65 {{^}} 65 {{^}}
66 <span class="left-num"></span> 66 <span class="left-num"></span>
@@ -77,4 +77,4 @@ @@ -77,4 +77,4 @@
77 </div> 77 </div>
78 {{/ cartInfo}} 78 {{/ cartInfo}}
79 <input id="promotionId" type="hidden" value="{{promotionId}}"> 79 <input id="promotionId" type="hidden" value="{{promotionId}}">
80 -<input id="single" type="hidden" value="{{@root.single}}">  
  80 +<input id="single" type="hidden" value="{{@root.single}}">
@@ -83,6 +83,7 @@ function disableNumEdit() { @@ -83,6 +83,7 @@ function disableNumEdit() {
83 83
84 // 初始化购物车面板显示 84 // 初始化购物车面板显示
85 function init() { 85 function init() {
  86 + discountNum = $('#mnum').val() - 0;
86 hasChooseColor = false; 87 hasChooseColor = false;
87 hasChooseSize = false; 88 hasChooseSize = false;
88 $curSizeBlock = null; 89 $curSizeBlock = null;
@@ -130,7 +130,7 @@ let cartObj = { @@ -130,7 +130,7 @@ let cartObj = {
130 tip.show('请先勾选商品'); 130 tip.show('请先勾选商品');
131 return false; 131 return false;
132 } 132 }
133 - window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; 133 + window.location.href = '/cart/index/new/orderEnsure?cartType=' + cartType;
134 } 134 }
135 }; 135 };
136 136
@@ -99,7 +99,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid = true, inValidLow = f @@ -99,7 +99,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid = true, inValidLow = f
99 promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id 99 promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id
100 }; 100 };
101 101
102 - if (goodData.min_buy_number && goodData.min_buy_number > 0) { 102 + if (goodData.min_buy_number && goodData.min_buy_number > 1) {
103 result.minNumber = parseInt(goodData.min_buy_number, 10); 103 result.minNumber = parseInt(goodData.min_buy_number, 10);
104 } 104 }
105 result.maxNumber = parseInt(goodData.storage_number, 10); 105 result.maxNumber = parseInt(goodData.storage_number, 10);