Authored by yyq

Merge branch 'feature/shopImg' into release/newProduct

{{#allGoods}}
<div class="all-goods clearfix">
{{> index/floor-header}}
<div class="goods-wrap">
{{> product/goods-list}}
</div>
{{#if href}}
<div class="loading">
<a href="{{href}}" target= "_blank">查看更多</a>
</div>
{{/if}}
</div>
{{/allGoods}}
... ...
<div class="search-empty">
<div class="empty-icon"></div>
<p class="res-tip">抱歉!未找到符合条件的商品</p>
<p>换个条件或关键词试试吧。</p>
</div>
\ No newline at end of file
... ...
<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="关键词搜索" {{# shopQueryKey}}value="{{.}}"{{/ shopQueryKey}}>
</span>
<span class="iconfont shop-query-submit">&#xe611;</span>
</form>
</div>
... ...
... ... @@ -213,6 +213,16 @@
.floor-header {
margin-top: 50px;
.floor-title {
margin: 0 auto;
width: 298px;
height: 31px;
line-height: 31px;
border: 1px solid #000;
font-size: 16px;
text-align: center;
}
}
.new-arrivel,
... ... @@ -392,7 +402,8 @@
font-size: 14px;
li {
display: inline-block;
float: left;
margin: 6px 0 0 6px;
padding: 0 15px;
}
... ... @@ -436,6 +447,28 @@
}
}
.search-empty {
text-align: center;
padding-top: 40px;
.empty-icon {
height: 172px;
background: resolve('/product/search-bg.png') no-repeat center center;
}
> p {
color: #afafaf;
font-size: 14px;
}
.res-tip {
font-size: 18px;
color: #444;
margin: 20px 0;
font-weight: 500;
}
}
.trend-info {
width: 100%;
... ...
... ... @@ -229,9 +229,33 @@ class ShopModel
array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
)
);
// $data['name'] = '全部商品 ALL';
// $sort = self::getSort($res['sort']);
// $data['goodsMenu']['menuList'] = $sort;
// 搜索无商品时显示全部商品
if (isset($searchCondition['condition']['query']) &&
!empty($searchCondition['condition']['query']) &&
empty($data['goods'])) {
$data['searchEmpty'] = true;
unset($searchCondition['condition']['query']);
$allProUrl = array('product' => SearchData::getProductUrl($searchCondition['condition']));
//批量调接口获取数据
$allRes = Yohobuy::getMulti($allProUrl);
$allResult = HelperSearch::getList($allRes, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId);
$param = array_merge($searchCondition['userInput'], array('navBar' => 1, 'shopId' => $shopId));
$data['allGoods']['name'] = '全部商品 ALL';
$data['allGoods']['list'] = $allResult['goods'];
$data['allGoods']['opts'] = $allResult['opts'];
$data['allGoods']['goodsMenu']['menuList'] = $sort;
$data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?' . http_build_query($param);
}
return $data;
... ...
... ... @@ -532,6 +532,7 @@ class IndexController extends WebAction
'options' => array(
'controller' => 'Index',
'action' => 'index',
'misort' => $this->get('misort')
),
'uid' => $uid,
'navBar' => $this->get('navBar', 1),
... ...