|
@@ -67,7 +67,9 @@ var $listNav = $('#list-nav'), |
|
@@ -67,7 +67,9 @@ var $listNav = $('#list-nav'), |
67
|
introHammer,
|
67
|
introHammer,
|
68
|
brandColHammer;
|
68
|
brandColHammer;
|
69
|
|
69
|
|
70
|
-var getChannel, C_ID, RES_QTY, qwert;
|
70
|
+var getChannel, C_ID, RES_QTY, argument, optype;
|
|
|
71
|
+
|
|
|
72
|
+var category = $('#category-point').val();
|
71
|
|
73
|
|
72
|
require('../../common');
|
74
|
require('../../common');
|
73
|
|
75
|
|
|
@@ -373,7 +375,7 @@ function search(opt) { |
|
@@ -373,7 +375,7 @@ function search(opt) { |
373
|
searching = true;
|
375
|
searching = true;
|
374
|
loading.showLoadingMask();
|
376
|
loading.showLoadingMask();
|
375
|
|
377
|
|
376
|
- qwert = setting;
|
378
|
+ argument = setting;
|
377
|
|
379
|
|
378
|
$.ajax({
|
380
|
$.ajax({
|
379
|
type: 'GET',
|
381
|
type: 'GET',
|
|
@@ -384,7 +386,8 @@ function search(opt) { |
|
@@ -384,7 +386,8 @@ function search(opt) { |
384
|
num,
|
386
|
num,
|
385
|
$container,
|
387
|
$container,
|
386
|
goodIds = [],
|
388
|
goodIds = [],
|
387
|
- FILTER_VALUE;
|
389
|
+ FILTER_VALUE,
|
|
|
390
|
+ yasparm;
|
388
|
|
391
|
|
389
|
switch (navType) {
|
392
|
switch (navType) {
|
390
|
case 'newest':
|
393
|
case 'newest':
|
|
@@ -399,14 +402,40 @@ function search(opt) { |
|
@@ -399,14 +402,40 @@ function search(opt) { |
399
|
default:
|
402
|
default:
|
400
|
break;
|
403
|
break;
|
401
|
}
|
404
|
}
|
|
|
405
|
+ //console.log(data)
|
402
|
|
406
|
|
403
|
- if (data === '') {
|
407
|
+ if (data === '' || data.list) {
|
404
|
nav.end = true;
|
408
|
nav.end = true;
|
405
|
|
409
|
|
406
|
if (nav.reload) {
|
410
|
if (nav.reload) {
|
407
|
$container.html(noResult);
|
411
|
$container.html(noResult);
|
408
|
}
|
412
|
}
|
409
|
} else {
|
413
|
} else {
|
|
|
414
|
+
|
|
|
415
|
+ yasparm = {
|
|
|
416
|
+ C_ID: C_ID,
|
|
|
417
|
+ PAGE_NUM: setting.page,
|
|
|
418
|
+ FILTER_VALUE: FILTER_VALUE,
|
|
|
419
|
+ SORT_TYPE: setting.type
|
|
|
420
|
+ }
|
|
|
421
|
+
|
|
|
422
|
+ if(category) {
|
|
|
423
|
+ optype = 'YB_CATEGORY_GOODS_LIST_L',
|
|
|
424
|
+ yasparm = Object.assign(yasparm, {
|
|
|
425
|
+ CATEGORY_ID: window.queryString.title || '',
|
|
|
426
|
+ })
|
|
|
427
|
+ } else if ($brandHeader.length > 0) {
|
|
|
428
|
+ optype = 'YB_BRAND_GOODS_LIST_L',
|
|
|
429
|
+ yasparm = Object.assign(yasparm, {
|
|
|
430
|
+ BRAND_ID: $brandHeader.data('id')
|
|
|
431
|
+ })
|
|
|
432
|
+ } else {
|
|
|
433
|
+ optype = 'YB_KEYWORD_GOOS_LIST_L',
|
|
|
434
|
+ yasparm = Object.assign(yasparm, {
|
|
|
435
|
+ KEYWORD: setting.query || ''
|
|
|
436
|
+ })
|
|
|
437
|
+ }
|
|
|
438
|
+
|
410
|
if (nav.reload) {
|
439
|
if (nav.reload) {
|
411
|
$container.html(data);
|
440
|
$container.html(data);
|
412
|
lazyLoad($container.find('.lazy'));
|
441
|
lazyLoad($container.find('.lazy'));
|
|
@@ -422,28 +451,29 @@ function search(opt) { |
|
@@ -422,28 +451,29 @@ function search(opt) { |
422
|
}
|
451
|
}
|
423
|
});
|
452
|
});
|
424
|
|
453
|
|
425
|
- if (window._yas && window._yas.sendCustomInfo) {
|
|
|
426
|
- window._yas.sendCustomInfo({
|
|
|
427
|
- op: 'YB_KEYWORD_GOOS_LIST_L',
|
|
|
428
|
- param: JSON.stringify({
|
|
|
429
|
- C_ID: C_ID,
|
|
|
430
|
- KEYWORD: setting.query || '',
|
|
|
431
|
- RES_QTY: RES_QTY,
|
454
|
+ yasparm = Object.assign(yasparm, {
|
432
|
PRD_LIST: goodIds,
|
455
|
PRD_LIST: goodIds,
|
433
|
- PAGE_NUM: setting.page,
|
|
|
434
|
- FILTER_VALUE: FILTER_VALUE,
|
|
|
435
|
- SORT_TYPE: setting.type
|
456
|
+ RES_QTY: RES_QTY,
|
|
|
457
|
+ FILTER_VALUE: FILTER_VALUE
|
436
|
})
|
458
|
})
|
|
|
459
|
+
|
|
|
460
|
+ if (window._yas && window._yas.sendCustomInfo) {
|
|
|
461
|
+ window._yas.sendCustomInfo({
|
|
|
462
|
+ op: optype,
|
|
|
463
|
+ param: JSON.stringify(yasparm)
|
437
|
}, true);
|
464
|
}, true);
|
438
|
}
|
465
|
}
|
439
|
} else {
|
466
|
} else {
|
440
|
num = $container.find('.good-info').length;
|
467
|
num = $container.find('.good-info').length;
|
441
|
$container.append(data);
|
468
|
$container.append(data);
|
442
|
|
469
|
|
443
|
- if ($container.find('.total')) {
|
470
|
+ if ($container.find('.total')[1]) {
|
444
|
$container.find('.total')[1].remove();
|
471
|
$container.find('.total')[1].remove();
|
445
|
}
|
472
|
}
|
446
|
|
473
|
|
|
|
474
|
+ RES_QTY = $container.find('.total').data('id');
|
|
|
475
|
+ FILTER_VALUE = JSON.stringify(setting).replace(/\{|\}|\"/g, '');
|
|
|
476
|
+
|
447
|
$container.find('.good-info:gt(' + (num - 1) + ')').each(function() {
|
477
|
$container.find('.good-info:gt(' + (num - 1) + ')').each(function() {
|
448
|
var goodid = $(this).data('good-id');
|
478
|
var goodid = $(this).data('good-id');
|
449
|
|
479
|
|
|
@@ -452,18 +482,16 @@ function search(opt) { |
|
@@ -452,18 +482,16 @@ function search(opt) { |
452
|
}
|
482
|
}
|
453
|
});
|
483
|
});
|
454
|
|
484
|
|
455
|
- if (window._yas && window._yas.sendCustomInfo) {
|
|
|
456
|
- window._yas.sendCustomInfo({
|
|
|
457
|
- op: 'YB_KEYWORD_GOOS_LIST_L',
|
|
|
458
|
- param: JSON.stringify({
|
|
|
459
|
- C_ID: C_ID,
|
|
|
460
|
- KEYWORD: setting.query || '',
|
|
|
461
|
- RES_QTY: RES_QTY,
|
485
|
+ yasparm = Object.assign(yasparm, {
|
462
|
PRD_LIST: goodIds,
|
486
|
PRD_LIST: goodIds,
|
463
|
- PAGE_NUM: setting.page,
|
|
|
464
|
- FILTER_VALUE: FILTER_VALUE,
|
|
|
465
|
- SORT_TYPE: setting.type
|
487
|
+ RES_QTY: RES_QTY,
|
|
|
488
|
+ FILTER_VALUE: FILTER_VALUE
|
466
|
})
|
489
|
})
|
|
|
490
|
+
|
|
|
491
|
+ if (window._yas && window._yas.sendCustomInfo) {
|
|
|
492
|
+ window._yas.sendCustomInfo({
|
|
|
493
|
+ op: optype,
|
|
|
494
|
+ param: JSON.stringify(yasparm)
|
467
|
}, true);
|
495
|
}, true);
|
468
|
}
|
496
|
}
|
469
|
|
497
|
|
|
@@ -745,24 +773,44 @@ $listNav.on('touchstart', 'li', function() { |
|
@@ -745,24 +773,44 @@ $listNav.on('touchstart', 'li', function() { |
745
|
|
773
|
|
746
|
$('#goods-container').on('click', '.good-info', function(event) {
|
774
|
$('#goods-container').on('click', '.good-info', function(event) {
|
747
|
var PRD_ID = $(this).data('good-id'),
|
775
|
var PRD_ID = $(this).data('good-id'),
|
748
|
- PRD_NUM = $(this).index() + 1,
|
|
|
749
|
- FILTER_VALUE = JSON.stringify(qwert).replace(/\{|\}|\"/g, '');
|
776
|
+ PRD_NUM = $(this).index(),
|
|
|
777
|
+ FILTER_VALUE = JSON.stringify(argument).replace(/\{|\}|\"/g, ''),
|
|
|
778
|
+ yasparms;
|
750
|
|
779
|
|
751
|
- event.preventDefault();
|
|
|
752
|
- if (window._yas && window._yas.sendCustomInfo) {
|
|
|
753
|
- window._yas.sendCustomInfo({
|
|
|
754
|
- op: 'YB_KEYWORD_GOODS_LIST_C',
|
|
|
755
|
- param: JSON.stringify({
|
780
|
+ //event.preventDefault();
|
|
|
781
|
+
|
|
|
782
|
+ yasparms = {
|
756
|
C_ID: C_ID,
|
783
|
C_ID: C_ID,
|
757
|
- KEYWORD: qwert.query || '',
|
|
|
758
|
PRD_ID: PRD_ID,
|
784
|
PRD_ID: PRD_ID,
|
759
|
PRD_NUM: PRD_NUM,
|
785
|
PRD_NUM: PRD_NUM,
|
760
|
- PAGE_NUM: qwert.page,
|
786
|
+ PAGE_NUM: argument.page,
|
761
|
FILTER_VALUE: FILTER_VALUE,
|
787
|
FILTER_VALUE: FILTER_VALUE,
|
762
|
- SORT_TYPE: qwert.type
|
788
|
+ SORT_TYPE: argument.type
|
|
|
789
|
+ }
|
|
|
790
|
+
|
|
|
791
|
+ if(category) {
|
|
|
792
|
+ optype = 'YB_CATEGORY_GOODS_LIST_C',
|
|
|
793
|
+ yasparms = Object.assign(yasparms, {
|
|
|
794
|
+ CATEGORY_ID: window.queryString.title || '',
|
|
|
795
|
+ })
|
|
|
796
|
+ } else if ($brandHeader.length > 0) {
|
|
|
797
|
+ optype = 'YB_BRAND_GOODS_LIST_C',
|
|
|
798
|
+ yasparms = Object.assign(yasparms, {
|
|
|
799
|
+ BRAND_ID: $brandHeader.data('id')
|
763
|
})
|
800
|
})
|
|
|
801
|
+ } else {
|
|
|
802
|
+ optype = 'YB_KEYWORD_GOOS_LIST_C',
|
|
|
803
|
+ yasparms = Object.assign(yasparms, {
|
|
|
804
|
+ KEYWORD: argument.query || ''
|
|
|
805
|
+ })
|
|
|
806
|
+ }
|
|
|
807
|
+
|
|
|
808
|
+ if (window._yas && window._yas.sendCustomInfo) {
|
|
|
809
|
+ window._yas.sendCustomInfo({
|
|
|
810
|
+ op: optype,
|
|
|
811
|
+ param: JSON.stringify(yasparms)
|
764
|
}, true);
|
812
|
}, true);
|
765
|
}
|
813
|
}
|
766
|
|
814
|
|
767
|
- return false;
|
815
|
+ //return false;
|
768
|
}); |
816
|
}); |