Authored by 梁志锋

购物车功能修改 review br xuqi

... ... @@ -43,9 +43,10 @@ $.get('/cart/index/giftinfoTpl', function(html) {
//初始化购物车面板显示
function init() {
var $firstRow = $sizeRowList.eq(0);
var $firstRow;
$sizeRowList = $('.size-list ul');
$firstRow = $sizeRowList.eq(0);
$curSizeBlock = null,
hasChooseSize = false,
... ... @@ -68,8 +69,6 @@ function checkColorSizeNum() {
return true;
}
init();
function show(data) {
if (data) {
$chosePanel.html(panelTmpl(data));
... ... @@ -128,6 +127,8 @@ function changeGoodImgWhenClickColor() {
}
}
init();
$('.yoho-page').on('touchstart', '.chose-panel', function(e) {
var $cur = $(e.target);
... ... @@ -205,7 +206,6 @@ $('.color-list').on('touchstart', '.block', function(e) {
// 修改颜色时修改商品图片
changeGoodImgWhenClickColor();
});
$('.size-list').on('touchstart', '.block', function(e) {
... ... @@ -244,8 +244,6 @@ $('.size-list').on('touchstart', '.block', function(e) {
$that.find('.num .left-num').html('剩余' + curGoodNum + '件');
$('#left-num').val(curGoodNum);
} else {
//$colorChosed.removeClass('zero-stock').addClass('zero-stock');
$that.find('.num .left-num').html('');
$('#left-num').val(0);
}
... ... @@ -308,6 +306,7 @@ $('#chose-btn-sure').on('touchstart', function() {
numInCart = $('.num-tag').html() - 0,
num = $num.val();
//颜色尺码没有选择
if (!checkColorSizeNum()) {
return;
}
... ...