Authored by zhangxiaoru

问题解决

... ... @@ -60,6 +60,8 @@ var limitProductCode,
// 限购商品的skn。只有限购商品时才会设置。
skn;
var sizeInfo = $('.size-info');
//禁用数字编辑
function disableNumEdit() {
var $numBtn = $('.chose-panel').find('.num .btn>.iconfont');
... ... @@ -343,12 +345,15 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
});
function chosedLength() {
var $chosedL = $('.block-list>ul>li.chosed'),
infoHtml;
var $chosedL = $('.block-list li.chosed'),
infoHtml,
choosedInfo = $('.choosed-info'),
notChoose = $('.not-choose');
choosedInfo.removeClass('hide');
$('.choosed-info').removeClass('hide');
if (!$('.not-choose').hasClass('hide')) {
$('.not-choose').addClass('hide');
if (!notChoose.hasClass('hide')) {
notChoose.addClass('hide');
}
if ($chosedL.length === 2) {
... ... @@ -359,11 +364,11 @@ function chosedLength() {
} else if ($chosedL.length === 1) {
infoHtml = '已选:' + $chosedL.eq(0).html();
} else {
$('.choosed-info').addClass('hide');
$('.not-choose').removeClass('hide');
choosedInfo.addClass('hide');
notChoose.removeClass('hide');
}
$('.choosed-info').html(infoHtml);
choosedInfo.html(infoHtml);
}
$yohoPage.on('touchstart', '.color-list .block', function() {
... ... @@ -472,8 +477,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed(0);
if (!$('.size-info').hasClass('hide')) {
$('.size-info').addClass('hide');
if (!sizeInfo.hasClass('hide')) {
sizeInfo.addClass('hide');
}
// 当前尺码不是选中状态,选中时
... ... @@ -497,7 +502,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
curColorIndex = index + 1;
$curSizeBlock = $this;
$('.size-info').html($(this).data('info')).removeClass('hide');
sizeInfo.html($(this).data('info')).removeClass('hide');
}
// 颜色块切换勾选样式
... ... @@ -724,7 +729,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
});
$yohoPage.on('touchstart', '.close', function() {
$yohoPage.on('click', '.close', function() {
hide();
});
... ...
... ... @@ -958,11 +958,11 @@ class CartModel
$oneSize['colorId'] = $val['color_id'];
$oneSize['name'] = $sizeName;
$oneSize['sizeNum'] = intval($one['storage_number']);
$oneSize['sizeInfo'] = $one['size_info'];
$oneSize['sizeInfo'] = isset($one['size_info']) ? $one['size_info'] : '';
$sizeList[$val['product_skc']][] = $oneSize;
// 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
$allSizeList[$sizeName] = empty($allSizeList[$sizeName]['storage']) ? array('storage' => $one['storage_number'], 'id' => $one['size_id'], 'sizeInfo' => $one['size_info']) : $allSizeList[$sizeName];
$allSizeList[$sizeName] = empty($allSizeList[$sizeName]['storage']) ? array('storage' => $one['storage_number'], 'id' => $one['size_id'], 'sizeInfo' => $oneSize['sizeInfo'] : $allSizeList[$sizeName];
$colorNum += intval($one['storage_number']);
... ...