Merge branch 'feature/shopImg' into release/newProduct
Showing
7 changed files
with
90 additions
and
4 deletions
1 | +{{#allGoods}} | ||
2 | + <div class="all-goods clearfix"> | ||
3 | + {{> index/floor-header}} | ||
4 | + | ||
5 | + <div class="goods-wrap"> | ||
6 | + {{> product/goods-list}} | ||
7 | + </div> | ||
8 | + {{#if href}} | ||
9 | + <div class="loading"> | ||
10 | + <a href="{{href}}" target= "_blank">查看更多</a> | ||
11 | + </div> | ||
12 | + {{/if}} | ||
13 | + </div> | ||
14 | +{{/allGoods}} |
1 | +<div class="shop-search"> | ||
2 | + <form action="/shoplist" method="get" id="shop-search-form"> | ||
3 | + <span> | ||
4 | + <input type="hidden" name="shopId" value="{{shopId}}"> | ||
5 | + <input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索" {{# shopQueryKey}}value="{{.}}"{{/ shopQueryKey}}> | ||
6 | + </span> | ||
7 | + <span class="iconfont shop-query-submit"></span> | ||
8 | + </form> | ||
9 | +</div> |
web-static/img/product/search-bg.png
0 → 100644

1.89 KB
@@ -213,6 +213,16 @@ | @@ -213,6 +213,16 @@ | ||
213 | 213 | ||
214 | .floor-header { | 214 | .floor-header { |
215 | margin-top: 50px; | 215 | margin-top: 50px; |
216 | + | ||
217 | + .floor-title { | ||
218 | + margin: 0 auto; | ||
219 | + width: 298px; | ||
220 | + height: 31px; | ||
221 | + line-height: 31px; | ||
222 | + border: 1px solid #000; | ||
223 | + font-size: 16px; | ||
224 | + text-align: center; | ||
225 | + } | ||
216 | } | 226 | } |
217 | 227 | ||
218 | .new-arrivel, | 228 | .new-arrivel, |
@@ -392,7 +402,8 @@ | @@ -392,7 +402,8 @@ | ||
392 | font-size: 14px; | 402 | font-size: 14px; |
393 | 403 | ||
394 | li { | 404 | li { |
395 | - display: inline-block; | 405 | + float: left; |
406 | + margin: 6px 0 0 6px; | ||
396 | padding: 0 15px; | 407 | padding: 0 15px; |
397 | } | 408 | } |
398 | 409 | ||
@@ -436,6 +447,28 @@ | @@ -436,6 +447,28 @@ | ||
436 | } | 447 | } |
437 | } | 448 | } |
438 | 449 | ||
450 | + .search-empty { | ||
451 | + text-align: center; | ||
452 | + padding-top: 40px; | ||
453 | + | ||
454 | + .empty-icon { | ||
455 | + height: 172px; | ||
456 | + background: resolve('/product/search-bg.png') no-repeat center center; | ||
457 | + } | ||
458 | + | ||
459 | + > p { | ||
460 | + color: #afafaf; | ||
461 | + font-size: 14px; | ||
462 | + } | ||
463 | + | ||
464 | + .res-tip { | ||
465 | + font-size: 18px; | ||
466 | + color: #444; | ||
467 | + margin: 20px 0; | ||
468 | + font-weight: 500; | ||
469 | + } | ||
470 | + } | ||
471 | + | ||
439 | .trend-info { | 472 | .trend-info { |
440 | width: 100%; | 473 | width: 100%; |
441 | 474 |
@@ -229,9 +229,33 @@ class ShopModel | @@ -229,9 +229,33 @@ class ShopModel | ||
229 | array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName']) | 229 | array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName']) |
230 | ) | 230 | ) |
231 | ); | 231 | ); |
232 | -// $data['name'] = '全部商品 ALL'; | ||
233 | -// $sort = self::getSort($res['sort']); | ||
234 | -// $data['goodsMenu']['menuList'] = $sort; | 232 | + |
233 | + // 搜索无商品时显示全部商品 | ||
234 | + if (isset($searchCondition['condition']['query']) && | ||
235 | + !empty($searchCondition['condition']['query']) && | ||
236 | + empty($data['goods'])) { | ||
237 | + $data['searchEmpty'] = true; | ||
238 | + | ||
239 | + unset($searchCondition['condition']['query']); | ||
240 | + $allProUrl = array('product' => SearchData::getProductUrl($searchCondition['condition'])); | ||
241 | + | ||
242 | + //批量调接口获取数据 | ||
243 | + $allRes = Yohobuy::getMulti($allProUrl); | ||
244 | + | ||
245 | + $allResult = HelperSearch::getList($allRes, array_merge( | ||
246 | + array('defaultCover' => true), | ||
247 | + $searchCondition['options'] | ||
248 | + ), $searchCondition['userInput']); | ||
249 | + | ||
250 | + $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId); | ||
251 | + $param = array_merge($searchCondition['userInput'], array('navBar' => 1, 'shopId' => $shopId)); | ||
252 | + | ||
253 | + $data['allGoods']['name'] = '全部商品 ALL'; | ||
254 | + $data['allGoods']['list'] = $allResult['goods']; | ||
255 | + $data['allGoods']['opts'] = $allResult['opts']; | ||
256 | + $data['allGoods']['goodsMenu']['menuList'] = $sort; | ||
257 | + $data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?' . http_build_query($param); | ||
258 | + } | ||
235 | 259 | ||
236 | return $data; | 260 | return $data; |
237 | 261 |
@@ -532,6 +532,7 @@ class IndexController extends WebAction | @@ -532,6 +532,7 @@ class IndexController extends WebAction | ||
532 | 'options' => array( | 532 | 'options' => array( |
533 | 'controller' => 'Index', | 533 | 'controller' => 'Index', |
534 | 'action' => 'index', | 534 | 'action' => 'index', |
535 | + 'misort' => $this->get('misort') | ||
535 | ), | 536 | ), |
536 | 'uid' => $uid, | 537 | 'uid' => $uid, |
537 | 'navBar' => $this->get('navBar', 1), | 538 | 'navBar' => $this->get('navBar', 1), |
-
Please register or login to post a comment