Authored by 周少峰

Merge branch 'feature/mBrandShop' of http://git.dev.yoho.cn/web/yohobuywap into feature/mBrandShop

... ... @@ -31,8 +31,7 @@ var $subNav = $('.home-sub-nav'),
$pgc = $($goodsChildren.get(1)),
$dgc = $($goodsChildren.get(2)),
$shopId = $('input[name="shop_id"]').val(),
$appVersion = $('input[name="appVersion"]').val();
console.log($shopId)
$appVersion = $('input[name="app_version"]').val();
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -139,8 +138,16 @@ $.jqtab = function(nav, posNav, main) {
}else if(activeTab == 'popularity'){
hotData();
} else if (activeTab == 'home-page') {
myScroll.refresh();
myScroll && myScroll.refresh();
// setTimeout(function() {
// scH = $('#scroller').outerHeight();
// },1000);
scH = $('#scroller').outerHeight();
$nav1.removeClass('fixed-top');
$nav1.removeClass('absolute');
$nav2.removeClass('fixed-top');
$nav2.removeClass('absolute');
}
myScroll.scrollTo(0,0);
... ... @@ -173,12 +180,12 @@ function getPageGoods(info) {
success: function(data) {
info.callBack(data);
myScroll.refresh();
scH = $('#scroller').outerHeight();
$nav1.addClass('hide');
myScroll.scrollTo(0,0);
myScroll.refresh();
scH = $('#scroller').outerHeight();
lazyLoad($('img.lazy'));
searching = false;
},
... ... @@ -288,9 +295,10 @@ myScroll.on('scroll', function() {
}
if (sTop < scH) {
if (!$nav2.hasClass('fixed-top')) {
myScroll.refresh();
scH = $('#scroller').outerHeight();
// console.log(sTop);
// console.log(scH);
if (!$nav2.hasClass('fixed-top')) {
$nav2.addClass('fixed-top')
.removeClass('absolute')
.css({
... ... @@ -408,6 +416,7 @@ function search(opt) {
nav = navInfo[navType];
page = nav.page + 1;
console.log(page)
if (nav.reload) {
page = 1;
} else if (nav.end) {
... ... @@ -422,6 +431,8 @@ function search(opt) {
page: page
});
console.log(page)
searching = true;
loading.showLoadingMask();
... ... @@ -743,7 +754,7 @@ function postCollect(info) {
}
if (data.code === 401) {
url = data.url + '?refer=' + location.href;
url = data.url;
$('body').append('<a href="' + url + '"><span class="jump-login"><span></a>');
$('.jump-login').click();
... ... @@ -769,7 +780,7 @@ function collectShop() {
qew.url = '/product/index/shopFav';
qew.data = {
shop_id: $shopId,
appVersion: $appVersion
app_version: $appVersion
};
postCollect(qew);
}
... ... @@ -780,7 +791,7 @@ function cancelShop() {
qew.url = '/product/index/cancelShopFav';
qew.data = {
shop_id: $shopId,
appVersion: $appVersion
app_version: $appVersion
};
postCollect(qew);
}
... ...
... ... @@ -3,18 +3,20 @@
<div id="scroller">
<div id="nav-top">
{{> layout/header}}
<div class="search-area">
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索店铺内潮品" name="query">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="appVersion" value="{{appVersion}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
{{#if appVersion}}
<div class="search-area">
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索店铺内潮品" name="query">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="app_version" value="{{appVersion}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
</div>
</div>
{{/if}}
<div class="branner-top">
<img src="{{branerImg}}">
<img class="logo" src="{{logoImg}}">
... ... @@ -108,7 +110,9 @@
<div id="new-arrival" class="new-arrival main"></div>
<div id="popularity" class="popularity main"></div>
</div>
{{> product/shop-footer}}
{{#if appVersion}}
{{> product/shop-footer}}
{{/if}}
<ul id="pos-nav" class="nav hide">
<li class="active color" tab="home-page">首页</li>
<li tab="new-arrival">上新</li>
... ...
... ... @@ -540,7 +540,7 @@ class IndexController extends AbstractAction
$data = array(
'shopId' => '104',
'appVersion' => '111',
'appVersion' => '123',
'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
'logoImg' => '',
'storeName' => 'Vans专营店',
... ...