...
|
...
|
@@ -31,7 +31,8 @@ var $subNav = $('.home-sub-nav'), |
|
|
$pgc = $($goodsChildren.get(1)),
|
|
|
$dgc = $($goodsChildren.get(2)),
|
|
|
shopId = $('input[name="shop_id"]').val(),
|
|
|
appVersion = $('input[name="app_version"]').val();
|
|
|
appVersion = $('input[name="app_version"]').val(),
|
|
|
brand = $('input[name="brand"]').val();
|
|
|
|
|
|
var winH = $(window).height(),
|
|
|
noResult = '<p class="no-result">未找到相关搜索结果</p>';
|
...
|
...
|
@@ -143,6 +144,16 @@ function getPageGoods(info) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
function getParam(req) {
|
|
|
if (shopId) {
|
|
|
req.data.shop_id = shopId;
|
|
|
}
|
|
|
|
|
|
if (brand) {
|
|
|
req.data.brand = brand;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function newData(callback) {
|
|
|
var req = {};
|
|
|
|
...
|
...
|
@@ -150,9 +161,11 @@ function newData(callback) { |
|
|
req.data = {
|
|
|
type: 'newest',
|
|
|
order: '1',
|
|
|
page: navInfo.new.page,
|
|
|
shop_id: shopId
|
|
|
page: navInfo.new.page
|
|
|
};
|
|
|
|
|
|
getParam(req);
|
|
|
|
|
|
req.callBack = function(data) {
|
|
|
$('#new-arrival').append(data);
|
|
|
navInfo.new.page++;
|
...
|
...
|
@@ -172,9 +185,11 @@ function hotData(callback) { |
|
|
req.data = {
|
|
|
type: 'hot',
|
|
|
order: '1',
|
|
|
page: navInfo.hot.page,
|
|
|
shop_id: shopId
|
|
|
page: navInfo.hot.page
|
|
|
};
|
|
|
|
|
|
getParam(req);
|
|
|
|
|
|
req.callBack = function(data) {
|
|
|
$('#popularity').append(data);
|
|
|
navInfo.hot.page++;
|
...
|
...
|
@@ -445,6 +460,7 @@ function search(opt) { |
|
|
page: page
|
|
|
});
|
|
|
|
|
|
|
|
|
searching = true;
|
|
|
loading.showLoadingMask();
|
|
|
|
...
|
...
|
@@ -512,7 +528,8 @@ $.ajax({ |
|
|
type: 'GET',
|
|
|
url: '/search/filter',
|
|
|
data: {
|
|
|
shop_id: shopId
|
|
|
shop_id: shopId,
|
|
|
brand: brand
|
|
|
},
|
|
|
success: function(data) {
|
|
|
$goodsContainer.append(data);
|
...
|
...
|
@@ -658,6 +675,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: false
|
|
|
});
|
...
|
...
|
@@ -678,6 +696,7 @@ function scrollHandler() { |
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: true
|
|
|
});
|
...
|
...
|
@@ -695,6 +714,7 @@ $(window).scroll(function() { |
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: false
|
|
|
});
|
...
|
...
|
|