...
|
...
|
@@ -38,6 +38,8 @@ var $input = $('#search-input input'), |
|
|
$buriedpoint = $('.buriedpoint'),
|
|
|
$search = $('#search');
|
|
|
|
|
|
var C_ID, filext = {}, total, argument;
|
|
|
|
|
|
var shopId, sort, brand, outlets, app_type, age_level, msort, misort, coin, app_version, first_load = true;
|
|
|
|
|
|
// 默认筛选条件
|
...
|
...
|
@@ -82,6 +84,8 @@ require('../../common'); |
|
|
|
|
|
ellipsis.init();
|
|
|
|
|
|
C_ID = window._ChannelVary[window.cookie('_Channel')];
|
|
|
|
|
|
// pageCache 获取是否收藏
|
|
|
(function() {
|
|
|
if ($('.domain').val()) {
|
...
|
...
|
@@ -298,6 +302,7 @@ function search(opt) { |
|
|
break;
|
|
|
}
|
|
|
|
|
|
$.extend(filext, ext);
|
|
|
$.extend(defaultOpt, ext); // 扩展筛选项
|
|
|
}
|
|
|
|
...
|
...
|
@@ -374,6 +379,7 @@ function search(opt) { |
|
|
loading.showLoadingMask();
|
|
|
}
|
|
|
|
|
|
argument = setting;
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
...
|
...
|
@@ -382,7 +388,9 @@ function search(opt) { |
|
|
success: function(data) {
|
|
|
var noResult = '<p class="no-result">未找到相关搜索结果</p>',
|
|
|
num,
|
|
|
$container;
|
|
|
$container,
|
|
|
goodIds = [],
|
|
|
yasparm;
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'newest':
|
...
|
...
|
@@ -401,21 +409,65 @@ function search(opt) { |
|
|
break;
|
|
|
}
|
|
|
|
|
|
yasparm = {
|
|
|
C_ID: C_ID,
|
|
|
BRAND_ID: setting.shop_id,
|
|
|
PAGE_NUM: setting.page,
|
|
|
FILTER_VALUE: opt ? JSON.stringify(filext).replace(/\{|\}|\"/g, '') : '',
|
|
|
SORT_TYPE: setting.type
|
|
|
};
|
|
|
|
|
|
|
|
|
if (data === '' || (data.list && data.list.length <= 0)) {
|
|
|
nav.end = true;
|
|
|
|
|
|
if (nav.reload) {
|
|
|
$container.html(noResult);
|
|
|
|
|
|
yasparm = Object.assign(yasparm, {
|
|
|
PRD_LIST: '',
|
|
|
RES_QTY: 0
|
|
|
});
|
|
|
|
|
|
setTimeout(function() {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_BRAND_GOODS_LIST_C',
|
|
|
param: JSON.stringify(yasparm)
|
|
|
}, true);
|
|
|
}
|
|
|
}, 200);
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
|
|
|
if (nav.reload) {
|
|
|
|
|
|
var goodList = [];
|
|
|
$(data).each(function(i, goodInfo) {
|
|
|
if ($(goodInfo).hasClass('good-info')) {
|
|
|
goodList.push(goodInfo);
|
|
|
goodIds.push($(goodInfo).data('good-id'));
|
|
|
} else if ($(goodInfo).hasClass('total')) {
|
|
|
total = $(goodInfo).data('id');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
yasparm = Object.assign(yasparm, {
|
|
|
PRD_LIST: JSON.stringify(goodIds).replace(/\[|\]/g, ''),
|
|
|
RES_QTY: total
|
|
|
});
|
|
|
|
|
|
setTimeout(function() {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_BRAND_GOODS_LIST_C',
|
|
|
param: JSON.stringify(yasparm)
|
|
|
}, true);
|
|
|
}
|
|
|
}, 200);
|
|
|
|
|
|
if (first_load) {
|
|
|
first_load = false;
|
|
|
|
...
|
...
|
@@ -430,6 +482,32 @@ function search(opt) { |
|
|
num = $container.find('.good-info').length;
|
|
|
$container.append(data);
|
|
|
|
|
|
if ($container.find('.total')) {
|
|
|
$container.find('.total').remove();
|
|
|
}
|
|
|
|
|
|
$container.find('.good-info:gt(' + (num - 1) + ')').each(function() {
|
|
|
var goodid = $(this).data('good-id');
|
|
|
|
|
|
if (goodid) {
|
|
|
goodIds.push(goodid);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
yasparm = Object.assign(yasparm, {
|
|
|
PRD_LIST: total,
|
|
|
RES_QTY: JSON.stringify(goodIds).replace(/\[|\]/g, '')
|
|
|
});
|
|
|
|
|
|
setTimeout(function() {
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_BRAND_GOODS_LIST_C',
|
|
|
param: JSON.stringify(yasparm)
|
|
|
}, true);
|
|
|
}
|
|
|
}, 200);
|
|
|
|
|
|
// lazy good-infos who append in
|
|
|
lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy'));
|
|
|
}
|
...
|
...
|
@@ -812,3 +890,26 @@ $listNav.on('touchstart', 'li', function() { |
|
|
|
|
|
require('../../common/footer');
|
|
|
require('./coupon');
|
|
|
|
|
|
//点击事件埋点
|
|
|
$('#goods-container').on('click', '.good-info', function() {
|
|
|
var PRD_ID = $(this).data('good-id'),
|
|
|
PRD_NUM = $(this).index() + 1,
|
|
|
FILTER_VALUE = filext ? JSON.stringify(filext).replace(/\{|\}|\"/g, '') : '';
|
|
|
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
|
|
op: 'YB_BRAND_GOODS_LIST_C',
|
|
|
param: JSON.stringify({
|
|
|
C_ID: C_ID,
|
|
|
PRD_ID: PRD_ID,
|
|
|
PRD_NUM: PRD_NUM,
|
|
|
PAGE_NUM: Math.ceil(PRD_NUM / 60),
|
|
|
FILTER_VALUE: FILTER_VALUE,
|
|
|
SORT_TYPE: argument ? argument.type : ''
|
|
|
})
|
|
|
}, true);
|
|
|
}
|
|
|
|
|
|
// return false;
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|