Authored by 郭成尧

'activity-jump-modified'

... ... @@ -303,15 +303,6 @@ function search(opt) {
url: location.protocol + '//m.yohobuy.com/index/search/search',
data: setting,
success: function(data) {
/* jump to activity page */
if (data.jumpActUrl && data.jumpActUrl.length > 0) {
if ($('#jump-acturl').length <= 0) {
$('body').append('<a href=\'' + data.jumpActUrl + '\'><span id="jump-acturl"><span></a>');
}
$('#jump-acturl').click();
}
var noResult = '<p class="no-result">未找到相关搜索结果</p>',
num,
$container;
... ...
... ... @@ -42,6 +42,14 @@ class SearchController extends AbstractAction
*/
public function listAction()
{
if ($this->get('query')) {
$activity = SearchData::searchKeyActivity($this->get('query'));
if ($activity['code'] === 200 && isset($activity['data']) && isset($activity['data']['urlobj']) && isset($activity['data']['urlobj']['appUrl'])) {
$this->go($activity['data']['urlobj']['appUrl']);
exit;
}
}
$uid = $this->getUid() ? $this->getUid() : $this->get('uid');
$isApp = $this->isApp();
... ... @@ -237,14 +245,6 @@ class SearchController extends AbstractAction
{
header('Access-Control-Allow-Origin:*');
if ($this->get('query')) {
$activity = SearchData::searchKeyActivity($this->get('query'));
if ($activity['code'] === 200 && isset($activity['data']) && isset($activity['data']['urlobj']) && isset($activity['data']['urlobj']['appUrl'])) {
$this->echoJson(array('jumpActUrl' => $activity['data']['urlobj']['appUrl']));
exit;
}
}
$data = \Product\SearchModel::search();
if (empty($data['new'])) {
... ...