Authored by 毕凯

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

@@ -142,7 +142,7 @@ function actionGoodsCart() { @@ -142,7 +142,7 @@ function actionGoodsCart() {
142 return false; 142 return false;
143 } 143 }
144 key = encodeURI(key); 144 key = encodeURI(key);
145 - $.get(searchDomain + '?callback=?&query=' + key, function(htmlData) { 145 + $.get(searchDomain + '?query=' + key, function(htmlData) {
146 $('.search-list').html(htmlData.data); 146 $('.search-list').html(htmlData.data);
147 queryNum = $('.search-list').children('li').length; 147 queryNum = $('.search-list').children('li').length;
148 listIndex = -1; 148 listIndex = -1;
@@ -156,7 +156,7 @@ function actionGoodsCart() { @@ -156,7 +156,7 @@ function actionGoodsCart() {
156 }, function() { 156 }, function() {
157 $(this).css('background-color', '#fff'); 157 $(this).css('background-color', '#fff');
158 }); 158 });
159 - }, 'jsonp'); 159 + }, 'json');
160 } 160 }
161 161
162 function getText(obj) { 162 function getText(obj) {
@@ -525,7 +525,7 @@ function createNewArray(obj) { @@ -525,7 +525,7 @@ function createNewArray(obj) {
525 var $that = $(this); 525 var $that = $(this);
526 var $alink = $that.find('a'); 526 var $alink = $that.find('a');
527 var _href = $alink.attr('href'); 527 var _href = $alink.attr('href');
528 - var hottag = $alink.attr('hot') === 'true' ? true : false; 528 + var hottag = $alink.attr('hot') === 'hot' ? true : false;
529 var objt = {}; 529 var objt = {};
530 530
531 if ($that.hasClass('category-title')) { 531 if ($that.hasClass('category-title')) {
@@ -721,7 +721,6 @@ function actionNav() { @@ -721,7 +721,6 @@ function actionNav() {
721 } 721 }
722 722
723 723
724 -  
725 /** 724 /**
726 * 查询跳转后保留关键字 725 * 查询跳转后保留关键字
727 * @return {[type]} [description] 726 * @return {[type]} [description]
@@ -1172,7 +1171,7 @@ function actionExeTemplate() { @@ -1172,7 +1171,7 @@ function actionExeTemplate() {
1172 * @return {[type]} [description] 1171 * @return {[type]} [description]
1173 */ 1172 */
1174 function actionSearch() { 1173 function actionSearch() {
1175 - var searchDomain = 'http://search.yohobuy.com/api/suggest'; 1174 + var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
1176 1175
1177 $('#query_key').search(searchDomain); 1176 $('#query_key').search(searchDomain);
1178 } 1177 }
@@ -14,9 +14,11 @@ var $cr = $('#country-code-hide'), @@ -14,9 +14,11 @@ var $cr = $('#country-code-hide'),
14 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/, 14 emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
15 acAccount = [ 15 acAccount = [
16 ['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com', 16 ['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
17 - 'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序 17 + 'sohu.com', 'hotmail.com', '139.com', '189.com'
  18 + ], //数字顺序
18 ['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com', 19 ['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
19 - 'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序 20 + 'sohu.com', 'hotmail.com', '139.com', '189.com'
  21 + ] //组合顺序
20 ], 22 ],
21 $ccList = $('#country-code-list'), 23 $ccList = $('#country-code-list'),
22 $cc = $('#country-code'), 24 $cc = $('#country-code'),
@@ -44,6 +46,7 @@ function imgcode() { @@ -44,6 +46,7 @@ function imgcode() {
44 var time = new Date(), 46 var time = new Date(),
45 $captchaImg = $('#captcha-img'), 47 $captchaImg = $('#captcha-img'),
46 captchaImgSrc = $captchaImg.attr('src').split('?')[0]; 48 captchaImgSrc = $captchaImg.attr('src').split('?')[0];
  49 +
47 $('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime()); 50 $('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime());
48 51
49 //getSource('yoho_family_web', '换一张', 'homepage_man'); 52 //getSource('yoho_family_web', '换一张', 'homepage_man');
@@ -85,6 +85,8 @@ class CommonController extends WebAction @@ -85,6 +85,8 @@ class CommonController extends WebAction
85 $content_code = $this->get('content_code', ''); 85 $content_code = $this->get('content_code', '');
86 $client_type = $this->get('client_type', 'web'); 86 $client_type = $this->get('client_type', 'web');
87 $callback = $this->get('callback', ''); 87 $callback = $this->get('callback', '');
  88 + $width = $this->get('width', '');
  89 + $height = $this->get('height', '');
88 $params = array( 90 $params = array(
89 'content_code' => $content_code, 91 'content_code' => $content_code,
90 'client_type' => $client_type 92 'client_type' => $client_type
@@ -100,9 +102,12 @@ class CommonController extends WebAction @@ -100,9 +102,12 @@ class CommonController extends WebAction
100 if(isset($data['data'][0]['data'])) 102 if(isset($data['data'][0]['data']))
101 { 103 {
102 $banner = current($data['data'][0]['data']); 104 $banner = current($data['data'][0]['data']);
103 -  
104 if(!empty($banner)) { 105 if(!empty($banner)) {
105 - $banner['src'] = Images::getImageUrl($banner['src'], 2600, 60 ,2); 106 + if(empty($width) || empty($height) ) {
  107 + $width = 2600;//通栏广告
  108 + $height = 60;
  109 + }
  110 + $banner['src'] = Images::getImageUrl($banner['src'], $width, $height ,2);
106 //str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']); 111 //str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
107 } 112 }
108 } 113 }
@@ -75,7 +75,8 @@ class HomeModel @@ -75,7 +75,8 @@ class HomeModel
75 'link' => $val['sort_url'], 75 'link' => $val['sort_url'],
76 'icon' => $val['sort_ico'], 76 'icon' => $val['sort_ico'],
77 'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '', 77 'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '',
78 - 'index_main' => $index_main++, 78 + 'index_main' => $index_main ++,
  79 + 'content_code' => $val['content_code'],
79 'is_hot' => $val['is_hot'] == 'Y' ? true : false, 80 'is_hot' => $val['is_hot'] == 'Y' ? true : false,
80 'is_new' => $val['is_new'] == 'Y' ? true : false, 81 'is_new' => $val['is_new'] == 'Y' ? true : false,
81 // 'subnav' => array() 82 // 'subnav' => array()
@@ -88,6 +89,7 @@ class HomeModel @@ -88,6 +89,7 @@ class HomeModel
88 'link' => $sub['sort_url'], 89 'link' => $sub['sort_url'],
89 'is_hot' => $sub['is_hot'] == 'Y' ? true : false, 90 'is_hot' => $sub['is_hot'] == 'Y' ? true : false,
90 'is_new' => $sub['is_new'] == 'Y' ? true : false, 91 'is_new' => $sub['is_new'] == 'Y' ? true : false,
  92 + 'content_code' => $sub['content_code'],
91 // 'thirdnav' => array(), 93 // 'thirdnav' => array(),
92 'index_sub' => $index_sub ++ 94 'index_sub' => $index_sub ++
93 ); 95 );
@@ -97,6 +99,7 @@ class HomeModel @@ -97,6 +99,7 @@ class HomeModel
97 'title' => $thirdsub['sort_name'], 99 'title' => $thirdsub['sort_name'],
98 'name_en' => $thirdsub['sort_name_en'], 100 'name_en' => $thirdsub['sort_name_en'],
99 'link' => $thirdsub['sort_url'], 101 'link' => $thirdsub['sort_url'],
  102 + 'content_code' => $thirdsub['content_code'],
100 // 'branditems' => array() 103 // 'branditems' => array()
101 ); 104 );
102 if (isset($thirdsub['sub'])) { 105 if (isset($thirdsub['sub'])) {