...
|
...
|
@@ -4,12 +4,11 @@ |
|
|
|
|
|
var $ = require('yoho-jquery');
|
|
|
var dialog = require('../common/dialog');
|
|
|
var Dialog = dialog.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'),
|
|
|
$payWapper = $('.pay-wapper'),
|
...
|
...
|
@@ -22,7 +21,7 @@ $cartnewTips.find('.btn_close').click(function() { |
|
|
});
|
|
|
|
|
|
// 滚动到第一个选中的商品
|
|
|
function scrollToFirst() {
|
|
|
/*function scrollToFirst() {
|
|
|
var $selected = $payWapper.find('li[data-role="pitem"] .cart-item-check.cart-item-checked:eq(0)');
|
|
|
var top = 0;
|
|
|
|
...
|
...
|
@@ -32,7 +31,7 @@ function scrollToFirst() { |
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
function toastNoStore(parent) {
|
|
|
|
...
|
...
|
@@ -45,10 +44,10 @@ function toastNoStore(parent) { |
|
|
}, 2000);
|
|
|
}
|
|
|
|
|
|
var Cart = {
|
|
|
addToCart: function(params) {
|
|
|
Cart = {
|
|
|
/* addToCart: function(params) {
|
|
|
|
|
|
},
|
|
|
},*/
|
|
|
toggleSelectOne: function() { // 单选
|
|
|
|
|
|
var $this = $(this);
|
...
|
...
|
@@ -143,6 +142,7 @@ var Cart = { |
|
|
|
|
|
var $chk = $(this);
|
|
|
var $item = $chk.closest('[data-role=pitem]');
|
|
|
|
|
|
if ($chk.hasClass('cart-item-checked')) {
|
|
|
|
|
|
if ($item.data('id')) {
|
...
|
...
|
@@ -240,6 +240,7 @@ var Cart = { |
|
|
|
|
|
var $item = $(this);
|
|
|
var $chk = $item.find('.cart-item-check');
|
|
|
|
|
|
if ($chk.hasClass('cart-item-checked')) {
|
|
|
|
|
|
if ($item.data('id')) {
|
...
|
...
|
@@ -299,11 +300,23 @@ var Cart = { |
|
|
},
|
|
|
submit: function() {
|
|
|
|
|
|
var content = '<div><i class="iconfont"></i>您还未选择赠品</div><p>是否去选择赠品?</p>';
|
|
|
|
|
|
if ($(this).hasClass('btn-account-disable')) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if ($('[data-role="gift-sel-btn"]').length) {
|
|
|
alert('还有赠品未领取!');
|
|
|
|
|
|
new RConfirm(content, function() {
|
|
|
var firstGift = $('[data-role="gift-sel-btn"]')[0];
|
|
|
|
|
|
$('html,body').animate({scrollTop: $(firstGift).offset().top + 'px'}, 500);
|
|
|
}, function(){
|
|
|
capi.showMDialog('#Y_CartSelectDialog');
|
|
|
}, '去选择', '不要赠品');
|
|
|
}
|
|
|
|
|
|
capi.showMDialog('#Y_CartSelectDialog');
|
|
|
// $('.cart-preSell-dialog').show();
|
|
|
|
|
|
// $('.cart-togetherGoods').show();
|
...
|
...
|
|