Authored by OF1706

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

... ... @@ -299,8 +299,18 @@ var Cart = {
},
submit: function() {
if ($(this).hasClass('btn-account-disable')) {
return false;
}
if ($('[data-role="gift-sel-btn"]').length) {
alert('还有赠品未领取!');
var content = '<div><i class="iconfont">&#xe6c2;</i>您还未选择赠品</div><p>是否去选择赠品?</p>';
new RConfirm(content, function() {
var firstGift = $('[data-role="gift-sel-btn"]')[0];
$("html,body").animate({scrollTop: $(firstGift).offset().top + "px"}, 500);
}, '去选择', '不要赠品');
}
capi.showMDialog('#Y_CartSelectDialog');
... ...
... ... @@ -79,6 +79,8 @@ function isCheckFav() {
$(function() {
var $itemChecked = $('[data-role=pitem] .cart-item-checked');
$('.bottom-tab .change').click(function() {
$('.img-brand-switch .next').trigger('click');
});
... ... @@ -93,6 +95,10 @@ $(function() {
isCheckAll();
isCheckFav();
if ($itemChecked.length === 0) {
$('#Y_SubmitBtn').addClass('btn-account-disable');
}
});
require('./cart-action');
... ...
... ... @@ -23,13 +23,13 @@ RDialog.prototype = new Dialog({
});
RDialog.prototype.constructor = RDialog;
function RConfirm(content, ok, cancel) {
function RConfirm(content, ok, cancel, okName, cancelName) {
var rd = new RDialog({
content: content,
btns: [{
id: 'confirm-btn-ok',
btnClass: ['alert-sure'],
name: '确定',
name: okName || '确定',
cb: function() {
rd.close();
(typeof ok === 'function') && ok();
... ... @@ -37,7 +37,7 @@ function RConfirm(content, ok, cancel) {
}, {
id: 'confirm-btn-cencel',
btnClass: ['btn-cancel'],
name: '取消',
name: cancelName || '取消',
cb: function() {
rd.close();
}
... ...
... ... @@ -1125,6 +1125,9 @@
cursor: pointer;
float: right;
}
.btn-account-disable {
background-color: #b0b0b0;
}
}
.shop-cart-empty {
... ...