Authored by 梁志锋

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

... ... @@ -941,6 +941,7 @@ class HelperSearch
if ($data) {
$result['conditions'] = $data;
}
$result['clearUrl'] = self::current();
return $result;
}
... ... @@ -1369,8 +1370,6 @@ class HelperSearch
public static function filter()
{
$result = array();
//清除选中
$result['checkedConditions']['clearUrl'] = self::current();
//频道
$result['channel'] = array();
//性别
... ...
... ... @@ -73,3 +73,9 @@ $action.on('touchend', '.del', function() {
$confim.fadeIn();
return false;
});
$action.on('touchstart', 'a,span', function() {
$(this).css('background', '#eee');
}).on('touchend touchcancel', 'a,span', function() {
$(this).css('background', 'transparent');
});
... ...
... ... @@ -16,12 +16,16 @@ function ajaxCurrencyDetail(page) {
});
}
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
function scrollHandler() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
ajaxCurrencyDetail(page);
return;
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
ajaxCurrencyDetail(page);
\ No newline at end of file
ajaxCurrencyDetail(page);
... ...
... ... @@ -56,7 +56,7 @@
}
.edit {
padding-right: pxToRem(20px);
margin-right: pxToRem(20px);
}
}
}
... ...
... ... @@ -217,7 +217,7 @@ class SearchModel
$result = SearchData::getSuggest($query);
if (isset($result['code']) && $result['code'] == 200 && isset($result['suggest']['items']) && !empty($result['suggest']['items'])) {
foreach ($result['suggest']['items'] as $v) {
$data .= '<li><a style="display: block;" href="http://search.yohobuy.com/?query='.$v['item'].'" class="clearfix clear search-item" title="'.$v['item'].'" act="http://search.yohobuy.com/?query='.$v['item'].'"><span class="searchvalue" >'.$v['item'].'</span><span class="valuenum">约'.$v['frequency'].'个商品</span></a></li>';
$data []= '<li><a style="display: block;" href="http://search.yohobuy.com/?query='.$v['item'].'" class="clearfix clear search-item" title="'.$v['item'].'" act="http://search.yohobuy.com/?query='.$v['item'].'"><span class="searchvalue" >'.$v['item'].'</span><span class="valuenum">约'.$v['frequency'].'个商品</span></a></li>';
}
}
return $data;
... ...
... ... @@ -21,13 +21,21 @@ class SearchController extends WebAction
*/
public function suggestAction()
{
$suggest = '';
$callback = $this->get('callback');
$query = rawurldecode($this->get('query'));
$size = rawurldecode($this->get('size',10));
if (empty($query)) {
$this->helpJsonCallbackResult($callback, 412, '搜索词为空');
}
if ($size > 50) {
$size = 10;
}
if ($query) {
$param['query'] = $query;
$param['size'] = $size;
$suggest = SearchModel::getSuggest($param);
}
echo $suggest;
$this->helpJsonCallbackResult($callback, 200, 'suggest', $suggest);
}
/**
... ...