Authored by 陈峰

购物车bug修改

@@ -10,5 +10,6 @@ @@ -10,5 +10,6 @@
10 <div class="cart-box"> 10 <div class="cart-box">
11 11
12 </div> 12 </div>
  13 + <div class="recommend-for-you box hide"></div>
13 <div id="chose-panel"></div> 14 <div id="chose-panel"></div>
14 </div> 15 </div>
@@ -88,12 +88,12 @@ @@ -88,12 +88,12 @@
88 {{/if}} 88 {{/if}}
89 {{#if hasNoSaleGoods}} 89 {{#if hasNoSaleGoods}}
90 <div class="disable-box box"> 90 <div class="disable-box box">
91 - {{#notValidGoods}}  
92 - {{> cart-good}}  
93 - {{/notValidGoods}}  
94 {{#offShelveGoods}} 91 {{#offShelveGoods}}
95 {{> cart-good}} 92 {{> cart-good}}
96 {{/offShelveGoods}} 93 {{/offShelveGoods}}
  94 + {{#notValidGoods}}
  95 + {{> cart-good}}
  96 + {{/notValidGoods}}
97 97
98 <div class="remove-all"> 98 <div class="remove-all">
99 <button class="btn btn-remove">清空失效商品</button> 99 <button class="btn btn-remove">清空失效商品</button>
@@ -39,6 +39,4 @@ @@ -39,6 +39,4 @@
39 </div> 39 </div>
40 {{/if}} 40 {{/if}}
41 <input id="cartType" type="hidden" value="{{cartType}}"> 41 <input id="cartType" type="hidden" value="{{cartType}}">
42 - <div class="recommend-for-you box hide">  
43 - </div>  
44 {{/if}} 42 {{/if}}
@@ -117,7 +117,7 @@ let goodObj = { @@ -117,7 +117,7 @@ let goodObj = {
117 let self = this; 117 let self = this;
118 118
119 if (!$(e.currentTarget).hasClass('checked') && $(e.delegateTarget).find('.low-stocks').length > 0) { 119 if (!$(e.currentTarget).hasClass('checked') && $(e.delegateTarget).find('.low-stocks').length > 0) {
120 - tip.show('库存不足,无法购买'); 120 + tip.show('您勾选的商品库存不足');
121 return false; 121 return false;
122 } 122 }
123 self.selectGood($(e.currentTarget)); 123 self.selectGood($(e.currentTarget));
@@ -160,16 +160,22 @@ let goodObj = { @@ -160,16 +160,22 @@ let goodObj = {
160 let checked = $(e.currentTarget).find('.chk.select').hasClass('checked'); 160 let checked = $(e.currentTarget).find('.chk.select').hasClass('checked');
161 161
162 if (checked) { 162 if (checked) {
163 - let promise = self.clearLowStock(); 163 + new Promise(resolve => {
  164 + let promise = self.clearLowStock();
164 165
165 - if (promise) {  
166 - tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');  
167 - promise.then(() => {  
168 - self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);  
169 - });  
170 - } else { 166 + if (promise) {
  167 + promise.then(() => {
  168 + resolve();
  169 + });
  170 + } else {
  171 + resolve();
  172 + }
  173 + }).then(() => {
  174 + if ($('.good-item.low-stocks').length) {
  175 + tip.show('您全选的商品中存在库存不足商品,已帮您自动取消勾选');
  176 + }
171 self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true); 177 self.selectGood($('.good-item:not(.low-stocks) .chk.select'), true);
172 - } 178 + });
173 } else { 179 } else {
174 self.selectGood($('.good-item .chk.select'), false); 180 self.selectGood($('.good-item .chk.select'), false);
175 } 181 }
@@ -298,6 +298,14 @@ @@ -298,6 +298,14 @@
298 } 298 }
299 } 299 }
300 300
  301 + .all-gift-box {
  302 + display: none;
  303 + }
  304 +
  305 + .total {
  306 + display: none;
  307 + }
  308 +
301 .cart-content.active { 309 .cart-content.active {
302 .cart-footer { 310 .cart-footer {
303 .check-all { 311 .check-all {