Merge branch 'feature/shopping' into release/1.0
Showing
2 changed files
with
24 additions
and
20 deletions
@@ -222,26 +222,30 @@ var Cart = { | @@ -222,26 +222,30 @@ var Cart = { | ||
222 | var msg = '确定要将该商品从购物车中移入收藏吗?<br/>移入收藏后该商品将不在购物车中显示'; | 222 | var msg = '确定要将该商品从购物车中移入收藏吗?<br/>移入收藏后该商品将不在购物车中显示'; |
223 | var dialog; | 223 | var dialog; |
224 | 224 | ||
225 | - if (products.length > 1) { | ||
226 | - msg = '确定要将已选中的商品从购物车中移入收藏吗?<br/>移入收藏后已选中的商品将不在购物车中显示'; | ||
227 | - } | ||
228 | - | ||
229 | - dialog = new _confirm({ | ||
230 | - content: msg, | ||
231 | - cb: function() { | ||
232 | - dialog.close(); | ||
233 | - Util.ajax({ | ||
234 | - url: '/shopping/cart/product/send_to_favorite', | ||
235 | - type: 'POST', | ||
236 | - data: {skuList: JSON.stringify(products)}, | ||
237 | - success: function(res) { | ||
238 | - Util.refreshCart(res, function() { | ||
239 | - Stepper.init(); | ||
240 | - }); | ||
241 | - } | ||
242 | - }); | 225 | + if (!products.length) { |
226 | + new _alert('请至少选中一件商品!').show(); | ||
227 | + } else { | ||
228 | + if (products.length > 1) { | ||
229 | + msg = '确定要将已选中的商品从购物车中移入收藏吗?<br/>移入收藏后已选中的商品将不在购物车中显示'; | ||
243 | } | 230 | } |
244 | - }).show(); | 231 | + |
232 | + dialog = new _confirm({ | ||
233 | + content: msg, | ||
234 | + cb: function() { | ||
235 | + dialog.close(); | ||
236 | + Util.ajax({ | ||
237 | + url: '/shopping/cart/product/send_to_favorite', | ||
238 | + type: 'POST', | ||
239 | + data: {skuList: JSON.stringify(products)}, | ||
240 | + success: function(res) { | ||
241 | + Util.refreshCart(res, function() { | ||
242 | + Stepper.init(); | ||
243 | + }); | ||
244 | + } | ||
245 | + }); | ||
246 | + } | ||
247 | + }).show(); | ||
248 | + } | ||
245 | }, | 249 | }, |
246 | 250 | ||
247 | // 编辑商品的颜色和尺寸 | 251 | // 编辑商品的颜色和尺寸 |
-
Please register or login to post a comment