Authored by 周少峰

Merge branch 'release/4.4' of http://git.dev.yoho.cn/web/yohobuywap into release/4.4

... ... @@ -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() {
window.requestAnimationFrame(scrollHandler);
});
if ($homePage.length > 0) {
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
}
//初始请求最新第一页数据
search({
type: 'shop_id',
id: shopId,
brand: brand,
url: '/index/search/search',
nextPage: false
});
... ...
... ... @@ -7,6 +7,7 @@
{{#if appVersion}}
<input type="hidden" name="app_version" value="{{appVersion}}">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="brand" value="{{brand}}">
{{else}}
<div class="search-area">
<div id="search-input" class="search-input">
... ... @@ -15,6 +16,7 @@
<input type="text" placeholder="搜索店铺内潮品" name="query" class="buriedpoint">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="app_version" value="{{appVersion}}">
<input type="hidden" name="brand" value="{{brand}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search buriedpoint" type="submit">搜索</button>
</form>
... ...