Authored by 郭成尧

'activity-jump-modified'

@@ -303,15 +303,6 @@ function search(opt) { @@ -303,15 +303,6 @@ function search(opt) {
303 url: location.protocol + '//m.yohobuy.com/index/search/search', 303 url: location.protocol + '//m.yohobuy.com/index/search/search',
304 data: setting, 304 data: setting,
305 success: function(data) { 305 success: function(data) {
306 -  
307 - /* jump to activity page */  
308 - if (data.jumpActUrl && data.jumpActUrl.length > 0) {  
309 - if ($('#jump-acturl').length <= 0) {  
310 - $('body').append('<a href=\'' + data.jumpActUrl + '\'><span id="jump-acturl"><span></a>');  
311 - }  
312 - $('#jump-acturl').click();  
313 - }  
314 -  
315 var noResult = '<p class="no-result">未找到相关搜索结果</p>', 306 var noResult = '<p class="no-result">未找到相关搜索结果</p>',
316 num, 307 num,
317 $container; 308 $container;
@@ -42,6 +42,14 @@ class SearchController extends AbstractAction @@ -42,6 +42,14 @@ class SearchController extends AbstractAction
42 */ 42 */
43 public function listAction() 43 public function listAction()
44 { 44 {
  45 + if ($this->get('query')) {
  46 + $activity = SearchData::searchKeyActivity($this->get('query'));
  47 + if ($activity['code'] === 200 && isset($activity['data']) && isset($activity['data']['urlobj']) && isset($activity['data']['urlobj']['appUrl'])) {
  48 + $this->go($activity['data']['urlobj']['appUrl']);
  49 + exit;
  50 + }
  51 + }
  52 +
45 $uid = $this->getUid() ? $this->getUid() : $this->get('uid'); 53 $uid = $this->getUid() ? $this->getUid() : $this->get('uid');
46 $isApp = $this->isApp(); 54 $isApp = $this->isApp();
47 55
@@ -237,14 +245,6 @@ class SearchController extends AbstractAction @@ -237,14 +245,6 @@ class SearchController extends AbstractAction
237 { 245 {
238 header('Access-Control-Allow-Origin:*'); 246 header('Access-Control-Allow-Origin:*');
239 247
240 - if ($this->get('query')) {  
241 - $activity = SearchData::searchKeyActivity($this->get('query'));  
242 - if ($activity['code'] === 200 && isset($activity['data']) && isset($activity['data']['urlobj']) && isset($activity['data']['urlobj']['appUrl'])) {  
243 - $this->echoJson(array('jumpActUrl' => $activity['data']['urlobj']['appUrl']));  
244 - exit;  
245 - }  
246 - }  
247 -  
248 $data = \Product\SearchModel::search(); 248 $data = \Product\SearchModel::search();
249 249
250 if (empty($data['new'])) { 250 if (empty($data['new'])) {