Authored by 梁志锋

尺码颜色优化

... ... @@ -134,13 +134,18 @@ function displayGoodNum(curGoodNum) {
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(newSizeIndex) {
var sizes,
queryString,
i;
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
var sizes = $sizeRowList.eq(newSizeIndex).children();
for(var i = 0; i < sizes.length; i++){
if($(sizes[i]).data('name') === $curSizeBlock.data('name')){
sizes = $sizeRowList.eq(newSizeIndex).children();
for (i = 0; i < sizes.length; i++) {
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
$curSizeBlock = $(sizes[i]);
curColorIndex = $("#" + $curSizeBlock.data('name')).data('index');
queryString = '#' + $curSizeBlock.data('name');
curColorIndex = $(queryString).data('index');
}
}
... ... @@ -230,8 +235,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
updateConformButtonClassAndText();
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
index = $this.index(),
colorName,
index,
curGoodNum;
// 当前尺码已经是选中状态,再点击时
... ... @@ -257,8 +261,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
} else {
hasChooseSize = true;
colorName = $this.data('name');
index = $("#"+colorName).data('index') -1;
index = $('#' + $this.data('name')).data('index') - 1;
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).addClass('hide');
... ...