Authored by yyq

Merge branch 'feature/newPro-icon' into release/newProduct

... ... @@ -220,7 +220,11 @@ class HelperSearch
return array();
}
$gender = isset(self::$params['gender']) ? self::$params['gender'] : Helpers::getGenderByCookie();
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;
... ...
... ... @@ -6,6 +6,16 @@
{{> product/shop-header}}
<div class="list-left pull-left">
<div class="shop-search">
<form action="//search.yohobuy.com" 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}}
... ...
... ... @@ -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}}
... ...
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

13.8 KB | W: | H:

14.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -10,6 +10,8 @@ var $ = require('yoho.jquery'),
var $shopIntro = $('.shop-intro'),
$shopCollect = $('.shop-collect'),
$shopSearch = $('#shop-search-form'),
$queryKey = $('#shop-query-key'),
$sliderLeft = $('.slider-left'),
$allGoods = $('.all-goods'),
$fixedArea = $allGoods.find('.fixed-area'),
... ... @@ -94,6 +96,12 @@ if (window.cookie('needColloect') * 1 === 1 && window.getUid()) {
});
}
$('.shop-query-submit').click(function() {
if ($queryKey.val()) {
$shopSearch.submit();
}
});
// 全部商品使用 pjax 翻页
$allGoods.pjax('a.pjax', '.goods-wrap', {
timeout: 5000,
... ...
... ... @@ -110,6 +110,14 @@
background: #fff;
}
.new-festival-tag {
width: 72px;
text-align: center;
background-image: url(/product/newPro-icon.png);
color: #000;
padding: 0;
}
.thumbs {
width: 75px;
height: 510px;
... ...
... ... @@ -112,6 +112,14 @@
color: #4e4e4e;
border: 1px solid #4e4e4e;
}
.new-festival-tag {
width: 72px;
text-align: center;
background-image: url(/product/newPro-icon.png);
color: #000;
padding: 0;
}
}
}
... ...
... ... @@ -115,6 +115,34 @@
line-height: 28px;
}
.shop-search {
width: 100%;
border: 1px solid #3a3a3a;
margin-bottom: 10px;
overflow: hidden;
position: relative;
.shop-query-key {
width: 120px;
height: 34px;
border: none;
font-size: 13px;
padding: 0 34px 0 6px;
}
.shop-query-submit {
width: 34px;
height: 34px;
line-height: 38px;
font-size: 22px;
text-align: center;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
}
}
.coupon {
margin-top: 20px;
width: 100%;
... ...
... ... @@ -49,6 +49,7 @@ class SearchModel
'query' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'brand' => FILTER_SANITIZE_STRING,
'shop' => FILTER_DEFAULT,
'sort' => FILTER_VALIDATE_INT,
'category' => FILTER_VALIDATE_INT,
'channel' => FILTER_VALIDATE_INT,
... ...
... ... @@ -61,6 +61,46 @@ class ShopModel
exit();
}
$sknList = array();
if (isset($data['newArrivel']['list'])) {
foreach ($data['newArrivel']['list'] as $prod) {
$sknList[] = $prod['productSkn'];
}
}
if (isset($data['hotSingle']['list'])) {
foreach ($data['hotSingle']['list'] as $prod) {
$sknList[] = $prod['productSkn'];
}
}
$sknProList = SearchData::searchAll(array('query' => join(',', array_unique($sknList))));
if (isset($sknProList['data']['product_list'])) {
$coverList = array();
$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 &$v) {
if (isset($coverList[$v['product_skn']])) {
$v['img'] = $coverList[$v['product_skn']];
}
}
foreach ($data['hotSingle']['list'] as &$v) {
if (isset($coverList[$v['product_skn']])) {
$v['img'] = $coverList[$v['product_skn']];
}
}
}
//店铺介绍
$data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
... ... @@ -87,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(
... ... @@ -169,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'];
... ... @@ -699,6 +746,7 @@ class ShopModel
public static function getResourceData($data, $shopId)
{
$result = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
foreach ($result as $key => &$val) {
$val['url'] = self::modifyUrl($val, $shopId);
... ... @@ -714,6 +762,7 @@ class ShopModel
if (!isset($val['data']) && is_array($val)) {
foreach ($val as $k1 => &$v1) {
if (is_array($v1)) {
$url = self::modifyUrl($v1, $shopId);
if (!empty($url)) {
$v1['url'] = $url;
... ... @@ -721,6 +770,7 @@ class ShopModel
}
}
}
}
$data['resource_data'] = $result;
return $data;
... ...
... ... @@ -489,6 +489,7 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopId' => $shopId,
'shopIndexPage' => true,
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
... ... @@ -540,6 +541,7 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopIndexPage' => true,
'shopId' => $shopId,
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
),
... ...