Authored by yyq

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

@@ -220,7 +220,11 @@ class HelperSearch @@ -220,7 +220,11 @@ class HelperSearch
220 return array(); 220 return array();
221 } 221 }
222 $gender = isset(self::$params['gender']) ? self::$params['gender'] : Helpers::getGenderByCookie(); 222 $gender = isset(self::$params['gender']) ? self::$params['gender'] : Helpers::getGenderByCookie();
223 - $gender = substr($gender,0,1); 223 + if ($options['defaultCover'] && $gender === '1,2,3') {
  224 + $gender = 0;
  225 + } else {
  226 + $gender = substr($gender,0,1);
  227 + }
224 foreach($product as $key => $val){ 228 foreach($product as $key => $val){
225 if (!isset($val['goods_list']) || empty($val['goods_list'])) { 229 if (!isset($val['goods_list']) || empty($val['goods_list'])) {
226 continue; 230 continue;
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 <div class="shop-search"> 9 <div class="shop-search">
10 <form action="//search.yohobuy.com" method="get" id="shop-search-form"> 10 <form action="//search.yohobuy.com" method="get" id="shop-search-form">
11 <span> 11 <span>
12 - <input type="hidden" name="shop" value="{{shopId}}"> 12 + <input type="hidden" name="shopId" value="{{shopId}}">
13 <input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索"> 13 <input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
14 </span> 14 </span>
15 <span class="iconfont shop-query-submit">&#xe611;</span> 15 <span class="iconfont shop-query-submit">&#xe611;</span>
@@ -6,6 +6,15 @@ @@ -6,6 +6,15 @@
6 {{> product/shop-header}} 6 {{> product/shop-header}}
7 7
8 <div class="list-left pull-left"> 8 <div class="list-left pull-left">
  9 + <div class="shop-search">
  10 + <form action="/shoplist" method="get" id="shop-search-form">
  11 + <span>
  12 + <input type="hidden" name="shopId" value="{{shopId}}">
  13 + <input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
  14 + </span>
  15 + <span class="iconfont shop-query-submit">&#xe611;</span>
  16 + </form>
  17 + </div>
9 {{> product/left-content}} 18 {{> product/left-content}}
10 19
11 {{> product/shop-sidebar}} 20 {{> product/shop-sidebar}}
@@ -80,18 +80,23 @@ class ShopModel @@ -80,18 +80,23 @@ class ShopModel
80 if (isset($sknProList['data']['product_list'])) { 80 if (isset($sknProList['data']['product_list'])) {
81 $coverList = array(); 81 $coverList = array();
82 82
83 - foreach ($sknProList['data']['product_list'] as $prod) {  
84 - $coverList[$prod['product_skn']] = HelperSearch::getProductPic(array(0 => $prod)); 83 + $proList = HelperSearch::getProductList($sknProList['data']['product_list'], array(
  84 + 'imgSize' => array(250, 250),
  85 + 'defaultCover' => true
  86 + ));
  87 +
  88 + foreach ($proList as $prod) {
  89 + $coverList[$prod['skn']] = $prod['thumb'];
85 } 90 }
86 91
87 - foreach ($data['newArrivel']['list'] as $k => $v) { 92 + foreach ($data['newArrivel']['list'] as &$v) {
88 if (isset($coverList[$v['product_skn']])) { 93 if (isset($coverList[$v['product_skn']])) {
89 - $data['newArrivel']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg']; 94 + $v['img'] = $coverList[$v['product_skn']];
90 } 95 }
91 } 96 }
92 - foreach ($data['hotSingle']['list'] as $k => $v) { 97 + foreach ($data['hotSingle']['list'] as &$v) {
93 if (isset($coverList[$v['product_skn']])) { 98 if (isset($coverList[$v['product_skn']])) {
94 - $data['hotSingle']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg']; 99 + $v['img'] = $coverList[$v['product_skn']];
95 } 100 }
96 } 101 }
97 } 102 }
@@ -122,7 +127,11 @@ class ShopModel @@ -122,7 +127,11 @@ class ShopModel
122 } 127 }
123 128
124 // 组织模板数据 129 // 组织模板数据
125 - $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']); 130 + $result = HelperSearch::getList($res, array_merge(
  131 + array('defaultCover' => true),
  132 + $searchCondition['options']
  133 + ), $searchCondition['userInput']);
  134 +
126 $data['pathNav'] = array_merge( 135 $data['pathNav'] = array_merge(
127 HelperSearch::$listNav, 136 HelperSearch::$listNav,
128 array( 137 array(
@@ -204,7 +213,10 @@ class ShopModel @@ -204,7 +213,10 @@ class ShopModel
204 } 213 }
205 214
206 // 组织模板数据 215 // 组织模板数据
207 - $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']); 216 + $result = HelperSearch::getList($res, array_merge(
  217 + array('defaultCover' => true),
  218 + $searchCondition['options']
  219 + ), $searchCondition['userInput']);
208 220
209 $data['goods'] = $result['goods']; 221 $data['goods'] = $result['goods'];
210 $data['opts'] = $result['opts']; 222 $data['opts'] = $result['opts'];
@@ -541,6 +541,7 @@ class IndexController extends WebAction @@ -541,6 +541,7 @@ class IndexController extends WebAction
541 $data = array_merge( 541 $data = array_merge(
542 array( 542 array(
543 'shopIndexPage' => true, 543 'shopIndexPage' => true,
  544 + 'shopId' => $shopId,
544 'pathNav' => false, // pathNav数据结构同其他页面 545 'pathNav' => false, // pathNav数据结构同其他页面
545 'coupon' => false, // 先不做 546 'coupon' => false, // 先不做
546 ), 547 ),