...
|
...
|
@@ -4,10 +4,11 @@ |
|
|
|
|
|
var $ = require('yoho-jquery');
|
|
|
var dialog = require('../common/dialog');
|
|
|
var Alert = dialog.Alert;
|
|
|
var Confirm = dialog.Confirm;
|
|
|
var rDialog = require('./rdialog');
|
|
|
var RConfirm = rDialog.RConfirm;
|
|
|
var RAlert = rDialog.RAlert;
|
|
|
|
|
|
var Cart;
|
|
|
|
|
|
var $cartnewTips = $('.cartnew-tips'),
|
...
|
...
|
@@ -187,13 +188,13 @@ Cart = { |
|
|
capi.cartItemDel(selectArray, true, PromotionArray);
|
|
|
});
|
|
|
} else {
|
|
|
new Alert('请至少选择一件商品').show();
|
|
|
var content = '<div class="alert-main"><i class="iconfont"></i>请至少选中一件商品!</div>';
|
|
|
new RAlert(content).show();
|
|
|
}
|
|
|
},
|
|
|
cleanAllDisable: function() {
|
|
|
var selectArray = [];
|
|
|
var PromotionArray = [];
|
|
|
var content = '<div><i class="iconfont"></i>删除商品</div><p>确定从购物车中删除所有失效商品?</p>';
|
|
|
|
|
|
$payWapper.find('.tr-disabled[data-role=pitem]').each(function() {
|
|
|
|
...
|
...
|
@@ -220,14 +221,13 @@ Cart = { |
|
|
});
|
|
|
|
|
|
if (!$.isEmptyObject(selectArray)) {
|
|
|
new Confirm({
|
|
|
content: content,
|
|
|
cb: function() {
|
|
|
capi.cartItemDel(selectArray, true, PromotionArray);
|
|
|
}
|
|
|
var content = '<div><i class="iconfont"></i>清除失效商品</div><p>确定要清除失效商品吗?</p>';
|
|
|
new RConfirm(content, function() {
|
|
|
capi.cartItemDel(selectArray, true, PromotionArray);
|
|
|
}).show();
|
|
|
} else {
|
|
|
new Alert('请至少选择一件商品').show();
|
|
|
var content = '<div class="alert-main"><i class="iconfont"></i>购物车中没有失效商品!</div>';
|
|
|
new RAlert(content).show();
|
|
|
}
|
|
|
},
|
|
|
toFav: function() {
|
...
|
...
|
@@ -253,6 +253,7 @@ Cart = { |
|
|
toFavAll: function() {
|
|
|
|
|
|
var selectArray = [];
|
|
|
var content = '<div><i class="iconfont"></i>移入收藏</div><p>确定要将已选中的商品从购物车中移入收藏夹吗?<br/>移入收藏后已选中的商品将不在购物车中显示</p>';
|
|
|
|
|
|
$payWapper.find('[data-role=cart-item-check]').each(function() {
|
|
|
|
...
|
...
|
@@ -272,9 +273,14 @@ Cart = { |
|
|
});
|
|
|
|
|
|
if (!$.isEmptyObject(selectArray)) {
|
|
|
capi.cartItemDel(selectArray);
|
|
|
|
|
|
new RConfirm(content, function() {
|
|
|
capi.cartItemDel(selectArray);
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
new Alert('请至少选择一件商品').show();
|
|
|
var content = '<div class="alert-main"><i class="iconfont"></i>请至少选中一件商品!</div>';
|
|
|
new RAlert(content).show();
|
|
|
}
|
|
|
},
|
|
|
modNum: function() {
|
...
|
...
|
|