Authored by yyq

Merge branch 'feature/shopImg' into feature/newPro-icon

... ... @@ -220,7 +220,11 @@ class HelperSearch
return array();
}
$gender = isset(self::$params['gender']) ? self::$params['gender'] : Helpers::getGenderByCookie();
$gender = substr($gender,0,1);
if ($options['defaultCover'] && $gender === '1,2,3') {
$gender = 0;
} else {
$gender = substr($gender,0,1);
}
foreach($product as $key => $val){
if (!isset($val['goods_list']) || empty($val['goods_list'])) {
continue;
... ...
... ... @@ -9,7 +9,7 @@
<div class="shop-search">
<form action="//search.yohobuy.com" method="get" id="shop-search-form">
<span>
<input type="hidden" name="shop" value="{{shopId}}">
<input type="hidden" name="shopId" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
</span>
<span class="iconfont shop-query-submit">&#xe611;</span>
... ...
... ... @@ -6,6 +6,15 @@
{{> product/shop-header}}
<div class="list-left pull-left">
<div class="shop-search">
<form action="/shoplist" method="get" id="shop-search-form">
<span>
<input type="hidden" name="shopId" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
</span>
<span class="iconfont shop-query-submit">&#xe611;</span>
</form>
</div>
{{> product/left-content}}
{{> product/shop-sidebar}}
... ...
... ... @@ -80,18 +80,23 @@ class ShopModel
if (isset($sknProList['data']['product_list'])) {
$coverList = array();
foreach ($sknProList['data']['product_list'] as $prod) {
$coverList[$prod['product_skn']] = HelperSearch::getProductPic(array(0 => $prod));
$proList = HelperSearch::getProductList($sknProList['data']['product_list'], array(
'imgSize' => array(250, 250),
'defaultCover' => true
));
foreach ($proList as $prod) {
$coverList[$prod['skn']] = $prod['thumb'];
}
foreach ($data['newArrivel']['list'] as $k => $v) {
foreach ($data['newArrivel']['list'] as &$v) {
if (isset($coverList[$v['product_skn']])) {
$data['newArrivel']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg'];
$v['img'] = $coverList[$v['product_skn']];
}
}
foreach ($data['hotSingle']['list'] as $k => $v) {
foreach ($data['hotSingle']['list'] as &$v) {
if (isset($coverList[$v['product_skn']])) {
$data['hotSingle']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg'];
$v['img'] = $coverList[$v['product_skn']];
}
}
}
... ... @@ -122,7 +127,11 @@ class ShopModel
}
// 组织模板数据
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
$result = HelperSearch::getList($res, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$data['pathNav'] = array_merge(
HelperSearch::$listNav,
array(
... ... @@ -204,7 +213,10 @@ class ShopModel
}
// 组织模板数据
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
$result = HelperSearch::getList($res, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$data['goods'] = $result['goods'];
$data['opts'] = $result['opts'];
... ...
... ... @@ -541,6 +541,7 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopIndexPage' => true,
'shopId' => $shopId,
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
),
... ...