...
|
...
|
@@ -595,7 +595,7 @@ if ($('.brand-search-page').length) { |
|
|
if ($keyword.val().length) {
|
|
|
$icon.css('color', '#000');
|
|
|
$(this).closest('.search-box').css('width', '11.25rem');
|
|
|
$searchAction.show();
|
|
|
$searchAction.show().find('.clear-text').show();
|
|
|
} else {
|
|
|
$icon.css('color', '#b2b2b2');
|
|
|
$(this).closest('.search-box').css('width', '12.5rem');
|
...
|
...
|
@@ -607,7 +607,7 @@ if ($('.brand-search-page').length) { |
|
|
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
|
|
|
$icon.css('color', '#000');
|
|
|
$keyword.closest('.search-box').css('width', '11.25rem');
|
|
|
$searchAction.show();
|
|
|
$searchAction.show().find('.clear-text').hide();
|
|
|
|
|
|
clearTextHammer = new Hammer($('.clear-text')[0]);
|
|
|
clearTextHammer.on('tap', function(e) {
|
...
|
...
|
@@ -5412,9 +5412,6 @@ var $chosePanel = $('#chose-panel'), |
|
|
$sizeRowList,
|
|
|
$curColorBlock,
|
|
|
$colorRowList,
|
|
|
$curSizeRow,
|
|
|
$curColorRow,
|
|
|
rowIndex,
|
|
|
cbFn,
|
|
|
$allChoseItems,
|
|
|
queryString,
|
...
|
...
|
@@ -5432,9 +5429,6 @@ function init() { |
|
|
$sizeRowList = $('.size-list ul');
|
|
|
$colorRowList = $('.color-list ul');
|
|
|
$leftNum = $('#left-num');
|
|
|
$curSizeRow = $sizeRowList.eq(0);
|
|
|
$curColorRow = $colorRowList.eq(0);
|
|
|
rowIndex = 0;
|
|
|
curColorIndex = 0;
|
|
|
curSizeIndex = 0;
|
|
|
}
|
...
|
...
|
@@ -5502,6 +5496,60 @@ function updateConformButtonClassAndText() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
//显示剩余件数
|
|
|
function displayGoodNum(curGoodNum) {
|
|
|
|
|
|
//数量大于0
|
|
|
if (curGoodNum > 0) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
|
|
|
$leftNum.val(curGoodNum);
|
|
|
|
|
|
//数量小于0
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
function changeSizeChosed(newSizeIndex) {
|
|
|
var sizes,
|
|
|
queryString,
|
|
|
i;
|
|
|
|
|
|
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
$curSizeBlock.removeClass('chosed');
|
|
|
sizes = $sizeRowList.eq(newSizeIndex).children();
|
|
|
for (i = 0; i < sizes.length; i++) {
|
|
|
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
|
|
|
$curSizeBlock = $(sizes[i]);
|
|
|
queryString = '#' + $curSizeBlock.data('name');
|
|
|
curColorIndex = $(queryString).data('index');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$curSizeBlock.addClass('chosed');
|
|
|
return $curSizeBlock.data('num');
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
function changeColorChosed(newColorIndex) {
|
|
|
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
|
|
|
$curColorBlock.removeClass('chosed');
|
|
|
$curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
|
|
|
$curColorBlock.addClass('chosed');
|
|
|
return $curColorBlock.data('num');
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
init();
|
|
|
|
|
|
$yohoPage.on('touchstart', '.chose-panel', function(e) {
|
...
|
...
|
@@ -5517,13 +5565,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { |
|
|
|
|
|
$yohoPage.on('touchstart', '.color-list .block', function() {
|
|
|
var $this = $(this),
|
|
|
index,
|
|
|
curSizeBlock,
|
|
|
index = $this.index(),
|
|
|
curGoodNum;
|
|
|
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
index = $this.index();
|
|
|
|
|
|
// 当前颜色已经是选中状态,再点击时
|
|
|
if ($this.hasClass('chosed')) {
|
|
|
|
...
|
...
|
@@ -5533,66 +5577,31 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
hasChooseColor = false;
|
|
|
|
|
|
//当前尺码行隐藏
|
|
|
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
|
|
|
$sizeRowList.eq(curSizeIndex).addClass('hide');
|
|
|
|
|
|
//目标尺码行显示
|
|
|
$sizeRowList.eq(0).removeClass('hide').addClass('show');
|
|
|
$sizeRowList.eq(0).removeClass('hide');
|
|
|
|
|
|
curSizeIndex = 0;
|
|
|
|
|
|
//如果尺码已经是选择状态
|
|
|
if (curColorIndex) {
|
|
|
|
|
|
// 之前选中的尺码去掉勾选样式,新尺码块勾选
|
|
|
if ($curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
$curSizeBlock.removeClass('chosed');
|
|
|
curSizeBlock = $sizeRowList.eq(0).children().get(curColorIndex - 1);
|
|
|
$curSizeBlock = $(curSizeBlock);
|
|
|
curGoodNum = $curSizeBlock.data('num');
|
|
|
$curSizeBlock.addClass('chosed');
|
|
|
}
|
|
|
}
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
changeSizeChosed(0);
|
|
|
|
|
|
// 当前颜色不是选中状态,选中时
|
|
|
} else {
|
|
|
hasChooseColor = true;
|
|
|
|
|
|
//如果尺码已经是选择状态
|
|
|
if (curColorIndex) {
|
|
|
|
|
|
// 之前选中的尺码去掉勾选样式,新尺码块勾选
|
|
|
if ($curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
$curSizeBlock.removeClass('chosed');
|
|
|
|
|
|
//curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
|
|
|
curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
|
|
|
$curSizeBlock = $(curSizeBlock);
|
|
|
curGoodNum = $curSizeBlock.data('num');
|
|
|
$curSizeBlock.addClass('chosed');
|
|
|
}
|
|
|
|
|
|
//数量大于0
|
|
|
if (curGoodNum > 0) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
// 尺码行当前行隐藏
|
|
|
$sizeRowList.eq(curSizeIndex).addClass('hide');
|
|
|
|
|
|
$leftNum.val(curGoodNum);
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
curGoodNum = changeSizeChosed(index + 1);
|
|
|
|
|
|
//数量小于0
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 尺码行当前行隐藏
|
|
|
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
|
|
|
// 显示剩余数量
|
|
|
displayGoodNum(curGoodNum);
|
|
|
|
|
|
//尺码对应行显示
|
|
|
$sizeRowList.eq(index + 1).removeClass('hide').addClass('show');
|
|
|
$sizeRowList.eq(index + 1).removeClass('hide');
|
|
|
|
|
|
curSizeIndex = index + 1;
|
|
|
$curColorBlock = $this;
|
...
|
...
|
@@ -5601,7 +5610,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
|
|
|
}
|
|
|
|
|
|
// 当前颜色块 切换勾选样式
|
|
|
// 颜色块切换勾选样式
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
$this.toggleClass('chosed');
|
|
|
$('#good-num').val(1);
|
|
|
|
...
|
...
|
@@ -5610,12 +5620,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
}).on('touchstart', '.size-list .block', function() {
|
|
|
var $this = $(this),
|
|
|
index,
|
|
|
curColorBlock,
|
|
|
curGoodNum;
|
|
|
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
index = $this.index();
|
|
|
|
|
|
// 当前尺码已经是选中状态,再点击时
|
|
|
if ($this.hasClass('chosed')) {
|
|
|
|
...
|
...
|
@@ -5625,70 +5631,40 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
|
hasChooseSize = false;
|
|
|
|
|
|
//当前颜色行隐藏
|
|
|
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
|
|
|
$colorRowList.eq(curColorIndex).addClass('hide');
|
|
|
|
|
|
//目标颜色行显示
|
|
|
$colorRowList.eq(0).removeClass('hide').addClass('show');
|
|
|
$colorRowList.eq(0).removeClass('hide');
|
|
|
|
|
|
curColorIndex = 0;
|
|
|
|
|
|
//如果颜色已经是选择状态
|
|
|
if (curSizeIndex) {
|
|
|
|
|
|
// 之前选中的颜色去掉勾选样式,新颜色块勾选
|
|
|
if ($curColorBlock && $curColorBlock.length > 0) {
|
|
|
$curColorBlock.removeClass('chosed');
|
|
|
curColorBlock = $colorRowList.eq(0).children().get(curSizeIndex - 1);
|
|
|
$curColorBlock = $(curColorBlock);
|
|
|
curGoodNum = $curColorBlock.data('num');
|
|
|
$curColorBlock.addClass('chosed');
|
|
|
}
|
|
|
}
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
changeColorChosed(0);
|
|
|
|
|
|
// 当前尺码不是选中状态,选中时
|
|
|
} else {
|
|
|
hasChooseSize = true;
|
|
|
|
|
|
//如果颜色已经是选择状态
|
|
|
if (curSizeIndex) {
|
|
|
index = $('#' + $this.data('name')).data('index') - 1;
|
|
|
|
|
|
// 之前选中的颜色去掉勾选样式,新颜色块勾选
|
|
|
if ($curColorBlock && $curColorBlock.length > 0) {
|
|
|
$curColorBlock.removeClass('chosed');
|
|
|
// 颜色当前行隐藏
|
|
|
$colorRowList.eq(curColorIndex).addClass('hide');
|
|
|
|
|
|
//curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1);
|
|
|
curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
|
|
|
$curColorBlock = $(curColorBlock);
|
|
|
curGoodNum = $curColorBlock.data('num');
|
|
|
$curColorBlock.addClass('chosed');
|
|
|
}
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
curGoodNum = changeColorChosed(index + 1);
|
|
|
|
|
|
//数量大于0
|
|
|
if (curGoodNum > 0) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
$leftNum.val(curGoodNum);
|
|
|
|
|
|
//数量小于0
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 颜色当前行隐藏
|
|
|
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
|
|
|
// 显示剩余数量
|
|
|
displayGoodNum(curGoodNum);
|
|
|
|
|
|
//颜色对应行显示
|
|
|
$colorRowList.eq(index + 1).removeClass('hide').addClass('show');
|
|
|
$colorRowList.eq(index + 1).removeClass('hide');
|
|
|
|
|
|
curColorIndex = index + 1;
|
|
|
$curSizeBlock = $this;
|
|
|
}
|
|
|
|
|
|
// 颜色块切换勾选样式
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
$this.toggleClass('chosed');
|
|
|
$('#good-num').val(1);
|
|
|
|
...
|
...
|
@@ -5815,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
});
|
|
|
|
|
|
exports.init = init;
|
|
|
exports.show = show;
|
|
|
|
|
|
exports.show = show;
|
|
|
});
|
|
|
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
|