...
|
...
|
@@ -18,6 +18,7 @@ var $ = require('jquery'), |
|
|
scH,
|
|
|
$nav1 = $('#pos-nav'),
|
|
|
$nav2 = $('#pos-list'),
|
|
|
$homePage = $('.discount-area'),
|
|
|
sTop;
|
|
|
|
|
|
var tip = require('../plugin/tip'),
|
...
|
...
|
@@ -31,7 +32,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>';
|
...
|
...
|
@@ -135,7 +137,8 @@ function newData(callback) { |
|
|
type: 'newest',
|
|
|
order: '1',
|
|
|
page: navInfo.new.page,
|
|
|
shop_id: shopId
|
|
|
shop_id: shopId,
|
|
|
brand: brand
|
|
|
};
|
|
|
req.callBack = function(data) {
|
|
|
$('#new-arrival').append(data);
|
...
|
...
|
@@ -157,7 +160,8 @@ function hotData(callback) { |
|
|
type: 'sales',
|
|
|
order: '1',
|
|
|
page: navInfo.hot.page,
|
|
|
shop_id: shopId
|
|
|
shop_id: shopId,
|
|
|
brand: brand
|
|
|
};
|
|
|
req.callBack = function(data) {
|
|
|
$('#popularity').append(data);
|
...
|
...
|
@@ -497,7 +501,8 @@ $.ajax({ |
|
|
type: 'GET',
|
|
|
url: '/product/newsale/filter',
|
|
|
data: {
|
|
|
shop_id: shopId
|
|
|
shop_id: shopId,
|
|
|
brand: brand
|
|
|
},
|
|
|
success: function(data) {
|
|
|
$goodsContainer.append(data);
|
...
|
...
|
@@ -626,6 +631,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: false
|
|
|
});
|
...
|
...
|
@@ -646,6 +652,7 @@ function scrollHandler() { |
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: true
|
|
|
});
|
...
|
...
|
@@ -654,14 +661,18 @@ function scrollHandler() { |
|
|
}
|
|
|
|
|
|
//srcoll to load more
|
|
|
$(window).scroll(function() {
|
|
|
if ($homePage.length > 0) {
|
|
|
$(window).scroll(function() {
|
|
|
window.requestAnimationFrame(scrollHandler);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
//初始请求最新第一页数据
|
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
url: '/index/search/search',
|
|
|
nextPage: false
|
|
|
});
|
...
|
...
|
|