...
|
...
|
@@ -70,7 +70,6 @@ function show(html, cb) { |
|
|
init();
|
|
|
}
|
|
|
$('.chose-panel').show();
|
|
|
$('body').css('overflow', 'hidden');
|
|
|
$num = $('#good-num');
|
|
|
cbFn = cb;
|
|
|
}
|
...
|
...
|
@@ -78,7 +77,6 @@ function show(html, cb) { |
|
|
//隐藏当前Panel
|
|
|
function hide() {
|
|
|
$('.chose-panel').hide();
|
|
|
$('body').css('overflow', 'auto');
|
|
|
}
|
|
|
|
|
|
//修改加入购物车的文字和背景
|
...
|
...
|
@@ -208,11 +206,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
curColorIndex = index;
|
|
|
$('#good-num').val(1);
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
|
|
|
// 修改颜色时修改商品图片
|
|
|
changeGoodImgWhenClickColor();
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
}).on('touchstart', '.size-list .block', function() {
|
|
|
var $this = $(this),
|
|
|
index,
|
...
|
...
|
@@ -232,11 +230,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$('#left-num').val(0);
|
|
|
hasChooseSize = false;
|
|
|
curSizeIndex = null;
|
|
|
$curSizeBlock = null;
|
|
|
|
|
|
// 当前尺码不是选中状态,选中时
|
|
|
} else {
|
|
|
hasChooseSize = true;
|
|
|
|
|
|
curGoodNum = $this.data('num');
|
|
|
|
|
|
// 之前选中的尺码去掉勾选样式
|
...
|
...
|
@@ -253,18 +252,21 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
$('#left-num').val(0);
|
|
|
}
|
|
|
|
|
|
if (curGoodNum === 0 && hasChooseColor) {
|
|
|
$this.addClass('zero-stock');
|
|
|
}
|
|
|
curSizeIndex = index;
|
|
|
$curSizeBlock = $this;
|
|
|
}
|
|
|
|
|
|
$this.toggleClass('chosed');
|
|
|
curSizeIndex = index;
|
|
|
$curSizeBlock = $this;
|
|
|
$('#good-num').val(1);
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
|
|
|
// 重置颜色块的样式
|
|
|
resetColorZeroStock($siblingBlock);
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
});
|
|
|
|
|
|
$yohoPage.on('touchstart', '.btn-minus', function() {
|
...
|
...
|
@@ -281,7 +283,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
return;
|
|
|
}
|
|
|
if (num < 0) {
|
|
|
tip.show('您选择的数量不能为零~');
|
|
|
tip.show('您选择的数量不能为负数~');
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -295,7 +297,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (num - 0 === leftNum || 0 === leftNum) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
|