Authored by 周少峰

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

... ... @@ -602,4 +602,14 @@ class AbstractAction extends Controller_Abstract
}
}
/**
* 判断是不是APP
*
* @return bool
*/
public function isApp(){
$appVersion = $this->get('app_version');
return !empty($appVersion);
}
}
... ...
... ... @@ -29,7 +29,10 @@ var $subNav = $('.home-sub-nav'),
$goodsChildren = $goodsContainer.children(),
$ngc = $($goodsChildren.get(0)),
$pgc = $($goodsChildren.get(1)),
$dgc = $($goodsChildren.get(2));
$dgc = $($goodsChildren.get(2)),
$shopId = $('input[name="shop_id"]').val(),
$appVersion = $('input[name="appVersion"]').val();
console.log($shopId)
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -136,11 +139,8 @@ $.jqtab = function(nav, posNav, main) {
}else if(activeTab == 'popularity'){
hotData();
} else if (activeTab == 'home-page') {
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
myScroll.refresh();
scH = $('#scroller').outerHeight();
}
myScroll.scrollTo(0,0);
... ... @@ -172,11 +172,10 @@ function getPageGoods(info) {
data: info.data,
success: function(data) {
info.callBack(data);
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
myScroll.refresh();
scH = $('#scroller').outerHeight();
$nav1.addClass('hide');
myScroll.scrollTo(0,0);
... ... @@ -198,7 +197,7 @@ function newData() {
type: 'newest',
order: '1',
page: '1',
shop_id: '102'
shop_id: $shopId
};
req.callBack = function(data) {
... ... @@ -216,7 +215,7 @@ function hotData() {
type: 'sales',
order: '1',
page: '1',
shop_id: '102'
shop_id: $shopId
};
req.callBack = function(data) {
$('#popularity').append(data);
... ... @@ -290,6 +289,8 @@ myScroll.on('scroll', function() {
if (sTop < scH) {
if (!$nav2.hasClass('fixed-top')) {
myScroll.refresh();
scH = $('#scroller').outerHeight();
$nav2.addClass('fixed-top')
.removeClass('absolute')
.css({
... ... @@ -324,7 +325,7 @@ $(window).load(function() {
main2oH = $('#goods-container').outerHeight();
setTimeout(function(){
scH = $('#scroller').outerHeight();
},2000);
},1000);
});
... ... @@ -476,11 +477,7 @@ function search(opt) {
scH = $('#scroller').outerHeight();
}, 1000);
myScroll.refresh();
if (sTop > imgH + nav1H + main1oH) {
myScroll.scrollTo(0,-(imgH + nav1H + main1oH + 10));
}
},
error: function() {
tip.show('网络断开连接了~');
... ... @@ -622,7 +619,7 @@ $subNav.on('touchend touchcancel', function(e) {
if (nav.reload) {
search({
type: 'shop_id',
id: '111',
id: $shopId,
url: '/index/search/search'
});
}
... ... @@ -636,13 +633,11 @@ function scrollHandler() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
myScroll && myScroll.refresh();
if (sTop + winH > $('#scroller').height() - 0.25 *
$goodsContainer.height() - 50){
if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50){
if ($pre !== undefined) {
search({
type: 'shop_id',
id: '1111',
id: $shopId,
url: '/index/search/search'
});
}
... ... @@ -657,7 +652,7 @@ $(window).scroll(function() {
//初始请求最新第一页数据
search({
type: 'shop_id',
id: '1111',
id: $shopId,
url: '/index/search/search'
}
);
... ... @@ -666,12 +661,22 @@ $listNav.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$listNav.find('li').removeClass('bytouch');
myScroll.refresh();
if (sTop > imgH + nav1H + main1oH) {
myScroll.scrollTo(0,-(imgH + nav1H + main1oH + 10));
}
});
$posList.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$posList.find('li').removeClass('bytouch');
myScroll.refresh();
if (sTop > imgH + nav1H + main1oH) {
myScroll.scrollTo(0,-(imgH + nav1H + main1oH + 10));
}
});
... ... @@ -763,7 +768,8 @@ function collectShop() {
qew.url = '/product/index/shopFav';
qew.data = {
shop_id: '102'
shop_id: $shopId,
appVersion: $appVersion
};
postCollect(qew);
}
... ... @@ -773,7 +779,8 @@ function cancelShop() {
qew.url = '/product/index/cancelShopFav';
qew.data = {
shop_id: '102'
shop_id: $shopId,
appVersion: $appVersion
};
postCollect(qew);
}
... ...
... ... @@ -9,6 +9,7 @@
<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>
... ...
... ... @@ -531,7 +531,8 @@ class IndexController extends AbstractAction
{
$data = array(
'shopId' => '',
'shopId' => '104',
'appVersion' => '111',
'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
'logoImg' => '',
'storeName' => 'Vans专营店',
... ...