Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -19,12 +19,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData
case 'release':
if($type == 'sort'){
return 'http://100.98.132.63/yohosearch/sortgroup.json';
}elseif($type == 'discount'){
return 'http://100.98.132.63/yohosearch/discount.json';
}elseif($type == 'recent'){
return 'http://100.98.132.63/yohosearch/recent.json';
}elseif($type == 'review'){
}
elseif($type == 'suggest'){
return 'http://100.98.132.63/yohosearch/suggest.json';
}
return 'http://100.98.132.63/yohosearch/search.json';
case 'test':
... ... @@ -34,14 +31,10 @@ class SearchData extends \LibModels\Wap\Product\SearchData
if($type == 'sort'){
return 'http://101.200.31.165/yohosearch/sortgroup.json';
}
elseif($type == 'discount'){
return 'http://101.200.31.165/yohosearch/discount.json';
}
elseif($type == 'recent'){
return 'http://101.200.31.165/yohosearch/recent.json';
}elseif($type == 'review'){
return 'http://itemapi.yohobuy.com/item/item/recentreview';
elseif($type == 'suggest'){
return 'http://101.200.31.165/yohosearch/suggest.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
}
}
... ... @@ -116,36 +109,19 @@ class SearchData extends \LibModels\Wap\Product\SearchData
}
/**
* 获取折扣区间
*/
public static function getDiscount(){
return Yohobuy::get(self::getUrl('discount'));
}
/**
* 获取最新上架
*/
public static function recentShelve(){
return Yohobuy::get(self::getUrl('recent'));
}
/**
* 搜索品牌店铺信息
* @param array $params 参数
* 获取搜索提示
* @param $param
* @param $cache
* @return array
*/
public static function getShop(array $params)
{
return Yohobuy::get(self::$shopsUrl,$params);
}
/**
* 获取最近浏览记录
* @param int $limit
* @return json
*/
public static function getRecentReview($limit = 0)
public static function getSuggest($param, $cache = false)
{
if (empty($param['query'])) {
return array();
}
if (empty($param['size'])) {
$param['size'] = 10;
}
return Yohobuy::get(self::getUrl('suggest'),$param, $cache);
}
}
\ No newline at end of file
... ...
... ... @@ -121,7 +121,7 @@ class HelperSearch
//品牌店铺信息
$result['shopEntry'] = isset($data['shop']) && !empty($data['shop']) ? self::shop($data['shop'], $data['sort']['sort']) : array();
//分页
$result['pager'] = self::pager($result['totalCount'],$options['viewNum']);
$result['pager'] = self::pager($result['totalCount'],$options['viewNum']-1);
//选中条件
if (self::getSelected()) {
$result['filters']['checkedConditions']['conditions'] = self::getSelected();
... ...
... ... @@ -18,7 +18,7 @@ moreUnicode = {
//品牌相关变量
var $brandDefault = $('.brand .default'),
$brandPanel = $('.brand .brand-panel'),
$brandAttrs = $('.brand .attr'),
$brandAttrs = $brandPanel.find('.attr'),
$brandMore = $('#brand-more'),
$brandMulti = $('#brand-multi');
... ...
... ... @@ -55,6 +55,10 @@
-moz-user-select: none;
}
.color .attr {
margin-right: 0;
}
.checked-conditions {
line-height: 30px;
... ... @@ -85,6 +89,10 @@
color: #999;
float: right;
}
.close {
font-size: 14px;
}
}
.sort-pre .active .attr {
... ... @@ -163,7 +171,7 @@
margin-right: 5px;
span {
margin: 0 2px;
margin: 0 3px;
cursor: pointer;
-moz-user-select: none;
... ... @@ -190,9 +198,12 @@
}
.btn {
position: relative;
display: inline-block;
top: -1px;
width: 55px;
height: 18px;
height: 20px;
line-height: 20px;
background: #3a3a3a;
color: #fff;
text-align: center;
... ... @@ -230,8 +241,8 @@
border: none;
background: #000;
color: #fff;
font-size: 15px;
margin-right: 15px;
font-size: 14px;
margin-right: 20px;
cursor: pointer;
&.dis {
... ... @@ -335,9 +346,19 @@
.checkbox {
display: none;
float: left;
}
.multi .checkbox {
display: inline;
display: block;
color: #ccc;
font-size: 12px;
margin-right: 3px;
}
}
@media (max-width: 1180px) {
.filter-box .brand .attr {
width: 25%;
}
}
\ No newline at end of file
... ...
... ... @@ -45,10 +45,6 @@
}
}
.panel-body .attr {
width: 25%;
}
.filter-box .brand .attr-content {
max-width: 730px;
}
... ...
... ... @@ -6,7 +6,7 @@
.sort-type,
.checks {
color: #ccc;
color: #999;
font-size: 12px;
padding: 0 10px;
... ...
... ... @@ -197,4 +197,14 @@ class SearchModel
}
echo json_encode($data);
}
/**
* 查询搜索提示
* @param $query
*/
public static function getSuggest($query)
{
$result = SearchData::getSuggest();
return $result;
}
}
\ No newline at end of file
... ...
... ... @@ -27,6 +27,7 @@ class ListController extends WebAction
'productListPage' => true,
'list' => $list
);
$this->setWebNavHeader();
$this->_view->display('list', $data);
}
... ...
... ... @@ -15,4 +15,13 @@ class SearchController extends WebAction
$this->setWebNavHeader();
$this->_view->display('search', $data);
}
public function suggest()
{
$query = rawurldecode($this->get('query'));
if ($query) {
$param['query'] = $query;
$result = SearchModel::getSuggest($param);
}
}
}
\ No newline at end of file
... ...