|
@@ -595,7 +595,7 @@ if ($('.brand-search-page').length) { |
|
@@ -595,7 +595,7 @@ if ($('.brand-search-page').length) { |
595
|
if ($keyword.val().length) {
|
595
|
if ($keyword.val().length) {
|
596
|
$icon.css('color', '#000');
|
596
|
$icon.css('color', '#000');
|
597
|
$(this).closest('.search-box').css('width', '11.25rem');
|
597
|
$(this).closest('.search-box').css('width', '11.25rem');
|
598
|
- $searchAction.show();
|
598
|
+ $searchAction.show().find('.clear-text').show();
|
599
|
} else {
|
599
|
} else {
|
600
|
$icon.css('color', '#b2b2b2');
|
600
|
$icon.css('color', '#b2b2b2');
|
601
|
$(this).closest('.search-box').css('width', '12.5rem');
|
601
|
$(this).closest('.search-box').css('width', '12.5rem');
|
|
@@ -607,7 +607,7 @@ if ($('.brand-search-page').length) { |
|
@@ -607,7 +607,7 @@ if ($('.brand-search-page').length) { |
607
|
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
|
607
|
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
|
608
|
$icon.css('color', '#000');
|
608
|
$icon.css('color', '#000');
|
609
|
$keyword.closest('.search-box').css('width', '11.25rem');
|
609
|
$keyword.closest('.search-box').css('width', '11.25rem');
|
610
|
- $searchAction.show();
|
610
|
+ $searchAction.show().find('.clear-text').hide();
|
611
|
|
611
|
|
612
|
clearTextHammer = new Hammer($('.clear-text')[0]);
|
612
|
clearTextHammer = new Hammer($('.clear-text')[0]);
|
613
|
clearTextHammer.on('tap', function(e) {
|
613
|
clearTextHammer.on('tap', function(e) {
|
|
@@ -5412,9 +5412,6 @@ var $chosePanel = $('#chose-panel'), |
|
@@ -5412,9 +5412,6 @@ var $chosePanel = $('#chose-panel'), |
5412
|
$sizeRowList,
|
5412
|
$sizeRowList,
|
5413
|
$curColorBlock,
|
5413
|
$curColorBlock,
|
5414
|
$colorRowList,
|
5414
|
$colorRowList,
|
5415
|
- $curSizeRow,
|
|
|
5416
|
- $curColorRow,
|
|
|
5417
|
- rowIndex,
|
|
|
5418
|
cbFn,
|
5415
|
cbFn,
|
5419
|
$allChoseItems,
|
5416
|
$allChoseItems,
|
5420
|
queryString,
|
5417
|
queryString,
|
|
@@ -5432,9 +5429,6 @@ function init() { |
|
@@ -5432,9 +5429,6 @@ function init() { |
5432
|
$sizeRowList = $('.size-list ul');
|
5429
|
$sizeRowList = $('.size-list ul');
|
5433
|
$colorRowList = $('.color-list ul');
|
5430
|
$colorRowList = $('.color-list ul');
|
5434
|
$leftNum = $('#left-num');
|
5431
|
$leftNum = $('#left-num');
|
5435
|
- $curSizeRow = $sizeRowList.eq(0);
|
|
|
5436
|
- $curColorRow = $colorRowList.eq(0);
|
|
|
5437
|
- rowIndex = 0;
|
|
|
5438
|
curColorIndex = 0;
|
5432
|
curColorIndex = 0;
|
5439
|
curSizeIndex = 0;
|
5433
|
curSizeIndex = 0;
|
5440
|
}
|
5434
|
}
|
|
@@ -5502,6 +5496,60 @@ function updateConformButtonClassAndText() { |
|
@@ -5502,6 +5496,60 @@ function updateConformButtonClassAndText() { |
5502
|
}
|
5496
|
}
|
5503
|
}
|
5497
|
}
|
5504
|
|
5498
|
|
|
|
5499
|
+//显示剩余件数
|
|
|
5500
|
+function displayGoodNum(curGoodNum) {
|
|
|
5501
|
+
|
|
|
5502
|
+ //数量大于0
|
|
|
5503
|
+ if (curGoodNum > 0) {
|
|
|
5504
|
+ if ($soonSoldOut.length > 0) {
|
|
|
5505
|
+ $allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
5506
|
+ } else {
|
|
|
5507
|
+ $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
5508
|
+ }
|
|
|
5509
|
+
|
|
|
5510
|
+ $leftNum.val(curGoodNum);
|
|
|
5511
|
+
|
|
|
5512
|
+ //数量小于0
|
|
|
5513
|
+ } else {
|
|
|
5514
|
+ $allChoseItems.find('.num .left-num').html('');
|
|
|
5515
|
+ $leftNum.val(0);
|
|
|
5516
|
+ }
|
|
|
5517
|
+}
|
|
|
5518
|
+
|
|
|
5519
|
+//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
5520
|
+function changeSizeChosed(newSizeIndex) {
|
|
|
5521
|
+ var sizes,
|
|
|
5522
|
+ queryString,
|
|
|
5523
|
+ i;
|
|
|
5524
|
+
|
|
|
5525
|
+ if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
5526
|
+ $curSizeBlock.removeClass('chosed');
|
|
|
5527
|
+ sizes = $sizeRowList.eq(newSizeIndex).children();
|
|
|
5528
|
+ for (i = 0; i < sizes.length; i++) {
|
|
|
5529
|
+ if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
|
|
|
5530
|
+ $curSizeBlock = $(sizes[i]);
|
|
|
5531
|
+ queryString = '#' + $curSizeBlock.data('name');
|
|
|
5532
|
+ curColorIndex = $(queryString).data('index');
|
|
|
5533
|
+ }
|
|
|
5534
|
+ }
|
|
|
5535
|
+
|
|
|
5536
|
+ $curSizeBlock.addClass('chosed');
|
|
|
5537
|
+ return $curSizeBlock.data('num');
|
|
|
5538
|
+ }
|
|
|
5539
|
+ return 0;
|
|
|
5540
|
+}
|
|
|
5541
|
+
|
|
|
5542
|
+//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
5543
|
+function changeColorChosed(newColorIndex) {
|
|
|
5544
|
+ if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
|
|
|
5545
|
+ $curColorBlock.removeClass('chosed');
|
|
|
5546
|
+ $curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
|
|
|
5547
|
+ $curColorBlock.addClass('chosed');
|
|
|
5548
|
+ return $curColorBlock.data('num');
|
|
|
5549
|
+ }
|
|
|
5550
|
+ return 0;
|
|
|
5551
|
+}
|
|
|
5552
|
+
|
5505
|
init();
|
5553
|
init();
|
5506
|
|
5554
|
|
5507
|
$yohoPage.on('touchstart', '.chose-panel', function(e) {
|
5555
|
$yohoPage.on('touchstart', '.chose-panel', function(e) {
|
|
@@ -5517,13 +5565,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { |
|
@@ -5517,13 +5565,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { |
5517
|
|
5565
|
|
5518
|
$yohoPage.on('touchstart', '.color-list .block', function() {
|
5566
|
$yohoPage.on('touchstart', '.color-list .block', function() {
|
5519
|
var $this = $(this),
|
5567
|
var $this = $(this),
|
5520
|
- index,
|
|
|
5521
|
- curSizeBlock,
|
5568
|
+ index = $this.index(),
|
5522
|
curGoodNum;
|
5569
|
curGoodNum;
|
5523
|
|
5570
|
|
5524
|
- $this.siblings('.chosed').removeClass('chosed');
|
|
|
5525
|
- index = $this.index();
|
|
|
5526
|
-
|
|
|
5527
|
// 当前颜色已经是选中状态,再点击时
|
5571
|
// 当前颜色已经是选中状态,再点击时
|
5528
|
if ($this.hasClass('chosed')) {
|
5572
|
if ($this.hasClass('chosed')) {
|
5529
|
|
5573
|
|
|
@@ -5533,66 +5577,31 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
@@ -5533,66 +5577,31 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
5533
|
hasChooseColor = false;
|
5577
|
hasChooseColor = false;
|
5534
|
|
5578
|
|
5535
|
//当前尺码行隐藏
|
5579
|
//当前尺码行隐藏
|
5536
|
- $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
|
5580
|
+ $sizeRowList.eq(curSizeIndex).addClass('hide');
|
5537
|
|
5581
|
|
5538
|
//目标尺码行显示
|
5582
|
//目标尺码行显示
|
5539
|
- $sizeRowList.eq(0).removeClass('hide').addClass('show');
|
5583
|
+ $sizeRowList.eq(0).removeClass('hide');
|
5540
|
|
5584
|
|
5541
|
curSizeIndex = 0;
|
5585
|
curSizeIndex = 0;
|
5542
|
|
5586
|
|
5543
|
- //如果尺码已经是选择状态
|
|
|
5544
|
- if (curColorIndex) {
|
|
|
5545
|
-
|
|
|
5546
|
- // 之前选中的尺码去掉勾选样式,新尺码块勾选
|
|
|
5547
|
- if ($curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
5548
|
- $curSizeBlock.removeClass('chosed');
|
|
|
5549
|
- curSizeBlock = $sizeRowList.eq(0).children().get(curColorIndex - 1);
|
|
|
5550
|
- $curSizeBlock = $(curSizeBlock);
|
|
|
5551
|
- curGoodNum = $curSizeBlock.data('num');
|
|
|
5552
|
- $curSizeBlock.addClass('chosed');
|
|
|
5553
|
- }
|
|
|
5554
|
- }
|
5587
|
+ //老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
5588
|
+ changeSizeChosed(0);
|
5555
|
|
5589
|
|
5556
|
// 当前颜色不是选中状态,选中时
|
5590
|
// 当前颜色不是选中状态,选中时
|
5557
|
} else {
|
5591
|
} else {
|
5558
|
hasChooseColor = true;
|
5592
|
hasChooseColor = true;
|
5559
|
|
5593
|
|
5560
|
- //如果尺码已经是选择状态
|
|
|
5561
|
- if (curColorIndex) {
|
|
|
5562
|
-
|
|
|
5563
|
- // 之前选中的尺码去掉勾选样式,新尺码块勾选
|
|
|
5564
|
- if ($curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
5565
|
- $curSizeBlock.removeClass('chosed');
|
|
|
5566
|
-
|
|
|
5567
|
- //curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
|
|
|
5568
|
- curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
|
|
|
5569
|
- $curSizeBlock = $(curSizeBlock);
|
|
|
5570
|
- curGoodNum = $curSizeBlock.data('num');
|
|
|
5571
|
- $curSizeBlock.addClass('chosed');
|
|
|
5572
|
- }
|
|
|
5573
|
-
|
|
|
5574
|
- //数量大于0
|
|
|
5575
|
- if (curGoodNum > 0) {
|
|
|
5576
|
- if ($soonSoldOut.length > 0) {
|
|
|
5577
|
- $allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
5578
|
- } else {
|
|
|
5579
|
- $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
5580
|
- }
|
5594
|
+ // 尺码行当前行隐藏
|
|
|
5595
|
+ $sizeRowList.eq(curSizeIndex).addClass('hide');
|
5581
|
|
5596
|
|
5582
|
- $leftNum.val(curGoodNum);
|
5597
|
+ //老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
5598
|
+ curGoodNum = changeSizeChosed(index + 1);
|
5583
|
|
5599
|
|
5584
|
- //数量小于0
|
|
|
5585
|
- } else {
|
|
|
5586
|
- $allChoseItems.find('.num .left-num').html('');
|
|
|
5587
|
- $leftNum.val(0);
|
|
|
5588
|
- }
|
|
|
5589
|
- }
|
|
|
5590
|
-
|
|
|
5591
|
- // 尺码行当前行隐藏
|
|
|
5592
|
- $sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
|
5600
|
+ // 显示剩余数量
|
|
|
5601
|
+ displayGoodNum(curGoodNum);
|
5593
|
|
5602
|
|
5594
|
//尺码对应行显示
|
5603
|
//尺码对应行显示
|
5595
|
- $sizeRowList.eq(index + 1).removeClass('hide').addClass('show');
|
5604
|
+ $sizeRowList.eq(index + 1).removeClass('hide');
|
5596
|
|
5605
|
|
5597
|
curSizeIndex = index + 1;
|
5606
|
curSizeIndex = index + 1;
|
5598
|
$curColorBlock = $this;
|
5607
|
$curColorBlock = $this;
|
|
@@ -5601,7 +5610,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
@@ -5601,7 +5610,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
5601
|
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
|
5610
|
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
|
5602
|
}
|
5611
|
}
|
5603
|
|
5612
|
|
5604
|
- // 当前颜色块 切换勾选样式
|
5613
|
+ // 颜色块切换勾选样式
|
|
|
5614
|
+ $this.siblings('.chosed').removeClass('chosed');
|
5605
|
$this.toggleClass('chosed');
|
5615
|
$this.toggleClass('chosed');
|
5606
|
$('#good-num').val(1);
|
5616
|
$('#good-num').val(1);
|
5607
|
|
5617
|
|
|
@@ -5610,12 +5620,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
@@ -5610,12 +5620,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
5610
|
}).on('touchstart', '.size-list .block', function() {
|
5620
|
}).on('touchstart', '.size-list .block', function() {
|
5611
|
var $this = $(this),
|
5621
|
var $this = $(this),
|
5612
|
index,
|
5622
|
index,
|
5613
|
- curColorBlock,
|
|
|
5614
|
curGoodNum;
|
5623
|
curGoodNum;
|
5615
|
|
5624
|
|
5616
|
- $this.siblings('.chosed').removeClass('chosed');
|
|
|
5617
|
- index = $this.index();
|
|
|
5618
|
-
|
|
|
5619
|
// 当前尺码已经是选中状态,再点击时
|
5625
|
// 当前尺码已经是选中状态,再点击时
|
5620
|
if ($this.hasClass('chosed')) {
|
5626
|
if ($this.hasClass('chosed')) {
|
5621
|
|
5627
|
|
|
@@ -5625,70 +5631,40 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
|
@@ -5625,70 +5631,40 @@ $yohoPage.on('touchstart', '.color-list .block', function() { |
5625
|
hasChooseSize = false;
|
5631
|
hasChooseSize = false;
|
5626
|
|
5632
|
|
5627
|
//当前颜色行隐藏
|
5633
|
//当前颜色行隐藏
|
5628
|
- $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
|
5634
|
+ $colorRowList.eq(curColorIndex).addClass('hide');
|
5629
|
|
5635
|
|
5630
|
//目标颜色行显示
|
5636
|
//目标颜色行显示
|
5631
|
- $colorRowList.eq(0).removeClass('hide').addClass('show');
|
5637
|
+ $colorRowList.eq(0).removeClass('hide');
|
5632
|
|
5638
|
|
5633
|
curColorIndex = 0;
|
5639
|
curColorIndex = 0;
|
5634
|
|
5640
|
|
5635
|
- //如果颜色已经是选择状态
|
|
|
5636
|
- if (curSizeIndex) {
|
|
|
5637
|
-
|
|
|
5638
|
- // 之前选中的颜色去掉勾选样式,新颜色块勾选
|
|
|
5639
|
- if ($curColorBlock && $curColorBlock.length > 0) {
|
|
|
5640
|
- $curColorBlock.removeClass('chosed');
|
|
|
5641
|
- curColorBlock = $colorRowList.eq(0).children().get(curSizeIndex - 1);
|
|
|
5642
|
- $curColorBlock = $(curColorBlock);
|
|
|
5643
|
- curGoodNum = $curColorBlock.data('num');
|
|
|
5644
|
- $curColorBlock.addClass('chosed');
|
|
|
5645
|
- }
|
|
|
5646
|
- }
|
5641
|
+ //老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
5642
|
+ changeColorChosed(0);
|
5647
|
|
5643
|
|
5648
|
// 当前尺码不是选中状态,选中时
|
5644
|
// 当前尺码不是选中状态,选中时
|
5649
|
} else {
|
5645
|
} else {
|
5650
|
hasChooseSize = true;
|
5646
|
hasChooseSize = true;
|
5651
|
|
5647
|
|
5652
|
- //如果颜色已经是选择状态
|
|
|
5653
|
- if (curSizeIndex) {
|
5648
|
+ index = $('#' + $this.data('name')).data('index') - 1;
|
5654
|
|
5649
|
|
5655
|
- // 之前选中的颜色去掉勾选样式,新颜色块勾选
|
|
|
5656
|
- if ($curColorBlock && $curColorBlock.length > 0) {
|
|
|
5657
|
- $curColorBlock.removeClass('chosed');
|
5650
|
+ // 颜色当前行隐藏
|
|
|
5651
|
+ $colorRowList.eq(curColorIndex).addClass('hide');
|
5658
|
|
5652
|
|
5659
|
- //curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1);
|
|
|
5660
|
- curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
|
|
|
5661
|
- $curColorBlock = $(curColorBlock);
|
|
|
5662
|
- curGoodNum = $curColorBlock.data('num');
|
|
|
5663
|
- $curColorBlock.addClass('chosed');
|
|
|
5664
|
- }
|
5653
|
+ //老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
5654
|
+ curGoodNum = changeColorChosed(index + 1);
|
5665
|
|
5655
|
|
5666
|
- //数量大于0
|
|
|
5667
|
- if (curGoodNum > 0) {
|
|
|
5668
|
- if ($soonSoldOut.length > 0) {
|
|
|
5669
|
- $allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
5670
|
- } else {
|
|
|
5671
|
- $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
5672
|
- }
|
|
|
5673
|
- $leftNum.val(curGoodNum);
|
|
|
5674
|
-
|
|
|
5675
|
- //数量小于0
|
|
|
5676
|
- } else {
|
|
|
5677
|
- $allChoseItems.find('.num .left-num').html('');
|
|
|
5678
|
- $leftNum.val(0);
|
|
|
5679
|
- }
|
|
|
5680
|
- }
|
|
|
5681
|
-
|
|
|
5682
|
- // 颜色当前行隐藏
|
|
|
5683
|
- $colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
|
5656
|
+ // 显示剩余数量
|
|
|
5657
|
+ displayGoodNum(curGoodNum);
|
5684
|
|
5658
|
|
5685
|
//颜色对应行显示
|
5659
|
//颜色对应行显示
|
5686
|
- $colorRowList.eq(index + 1).removeClass('hide').addClass('show');
|
5660
|
+ $colorRowList.eq(index + 1).removeClass('hide');
|
5687
|
|
5661
|
|
5688
|
curColorIndex = index + 1;
|
5662
|
curColorIndex = index + 1;
|
5689
|
$curSizeBlock = $this;
|
5663
|
$curSizeBlock = $this;
|
5690
|
}
|
5664
|
}
|
5691
|
|
5665
|
|
|
|
5666
|
+ // 颜色块切换勾选样式
|
|
|
5667
|
+ $this.siblings('.chosed').removeClass('chosed');
|
5692
|
$this.toggleClass('chosed');
|
5668
|
$this.toggleClass('chosed');
|
5693
|
$('#good-num').val(1);
|
5669
|
$('#good-num').val(1);
|
5694
|
|
5670
|
|
|
@@ -5815,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
@@ -5815,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
5815
|
});
|
5791
|
});
|
5816
|
|
5792
|
|
5817
|
exports.init = init;
|
5793
|
exports.init = init;
|
5818
|
-exports.show = show;
|
|
|
5819
|
-
|
5794
|
+exports.show = show;
|
5820
|
});
|
5795
|
});
|
5821
|
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
|
5796
|
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
|
5822
|
/**
|
5797
|
/**
|