Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/web-list
Showing
9 changed files
with
31 additions
and
29 deletions
@@ -473,7 +473,8 @@ class WebAction extends Controller_Abstract | @@ -473,7 +473,8 @@ class WebAction extends Controller_Abstract | ||
473 | $header = array( | 473 | $header = array( |
474 | 'navbars'=> \Index\HomeModel::getNavBars($channel), | 474 | 'navbars'=> \Index\HomeModel::getNavBars($channel), |
475 | 'gobytype'=> 'gobuy'.$channel, | 475 | 'gobytype'=> 'gobuy'.$channel, |
476 | - 'searchcate'=>'searchcate'.$channel | 476 | + 'searchcate'=>'searchcate'.$channel, |
477 | + 'header'=> true, | ||
477 | ); | 478 | ); |
478 | $this->_view->assign('headerdata', $header); | 479 | $this->_view->assign('headerdata', $header); |
479 | } | 480 | } |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -10,11 +10,6 @@ $('#brand-favor').on('click', function() { | @@ -10,11 +10,6 @@ $('#brand-favor').on('click', function() { | ||
10 | var $this = $(this), | 10 | var $this = $(this), |
11 | uid = window.getUid(); | 11 | uid = window.getUid(); |
12 | 12 | ||
13 | - if (!uid) { | ||
14 | - location.href = '/signin.html?refer=' + encodeURIComponent(location.href); | ||
15 | - return; | ||
16 | - } | ||
17 | - | ||
18 | $.ajax({ | 13 | $.ajax({ |
19 | type: 'post', | 14 | type: 'post', |
20 | url: '/product/index/favoriteBrand', | 15 | url: '/product/index/favoriteBrand', |
@@ -29,6 +24,8 @@ $('#brand-favor').on('click', function() { | @@ -29,6 +24,8 @@ $('#brand-favor').on('click', function() { | ||
29 | } else { | 24 | } else { |
30 | $this.find('i').removeClass('coled'); | 25 | $this.find('i').removeClass('coled'); |
31 | } | 26 | } |
27 | + } else if (res.code === 403) { | ||
28 | + location.href = '/signin.html?refer=' + encodeURIComponent(location.href); | ||
32 | } | 29 | } |
33 | }); | 30 | }); |
34 | }); | 31 | }); |
@@ -95,11 +95,6 @@ exports.init = function(num) { | @@ -95,11 +95,6 @@ exports.init = function(num) { | ||
95 | wrapperPt, //鼠标移入时弹层的上内边距 | 95 | wrapperPt, //鼠标移入时弹层的上内边距 |
96 | containerPt; //商品列表容器的上内边距 | 96 | containerPt; //商品列表容器的上内边距 |
97 | 97 | ||
98 | - // 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误 | ||
99 | - // if (getProductAjax && getProductAjax.readyState!= 4) { | ||
100 | - // getProductAjax.abort(); | ||
101 | - // } | ||
102 | - | ||
103 | $.ajax({ | 98 | $.ajax({ |
104 | type: 'POST', | 99 | type: 'POST', |
105 | url: '/product/list/getProductPic', | 100 | url: '/product/list/getProductPic', |
@@ -174,11 +169,6 @@ $(document).on('hover', '.good-select-color li', function() { | @@ -174,11 +169,6 @@ $(document).on('hover', '.good-select-color li', function() { | ||
174 | $goodInfoMain.on('click', '.col-btn', function() { | 169 | $goodInfoMain.on('click', '.col-btn', function() { |
175 | var $this = $(this); | 170 | var $this = $(this); |
176 | 171 | ||
177 | - if (!window.getUid()) { | ||
178 | - location.href = '/signin.html?refer=' + encodeURIComponent(location.href); | ||
179 | - return; | ||
180 | - } | ||
181 | - | ||
182 | $.ajax({ | 172 | $.ajax({ |
183 | type: 'POST', | 173 | type: 'POST', |
184 | url: '/product/list/changeFavorite', | 174 | url: '/product/list/changeFavorite', |
@@ -189,6 +179,8 @@ $goodInfoMain.on('click', '.col-btn', function() { | @@ -189,6 +179,8 @@ $goodInfoMain.on('click', '.col-btn', function() { | ||
189 | }).then(function(res) { | 179 | }).then(function(res) { |
190 | if (res.code === 200) { | 180 | if (res.code === 200) { |
191 | $this.toggleClass('coled'); | 181 | $this.toggleClass('coled'); |
182 | + } else if (res.code === 403) { | ||
183 | + location.href = '/signin.html?refer=' + encodeURIComponent(location.href); | ||
192 | } | 184 | } |
193 | }); | 185 | }); |
194 | }); | 186 | }); |
@@ -36,7 +36,7 @@ class PassportModel | @@ -36,7 +36,7 @@ class PassportModel | ||
36 | 'orderHref' => Helpers::url('/home/orders?t=' . time()), //订单中心连接 | 36 | 'orderHref' => Helpers::url('/home/orders?t=' . time()), //订单中心连接 |
37 | 'helpHref' => Helpers::url('/help'), | 37 | 'helpHref' => Helpers::url('/help'), |
38 | ); | 38 | ); |
39 | - $tool+=array( | 39 | + $tool += array( |
40 | 'loginHref' => Helpers::url('/signin.html'), //登录链接,已登录不传 | 40 | 'loginHref' => Helpers::url('/signin.html'), //登录链接,已登录不传 |
41 | 'registerHref' => Helpers::url('/reg.html'), //注册链接,已登录不传 | 41 | 'registerHref' => Helpers::url('/reg.html'), //注册链接,已登录不传 |
42 | ); | 42 | ); |
@@ -45,7 +45,8 @@ class PassportModel | @@ -45,7 +45,8 @@ class PassportModel | ||
45 | 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png', | 45 | 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png', |
46 | 'url' => SITE_MAIN | 46 | 'url' => SITE_MAIN |
47 | ), | 47 | ), |
48 | - 'tool' => $tool | 48 | + 'tool' => $tool, |
49 | + 'simpleHeader' => true, | ||
49 | ); | 50 | ); |
50 | return $simpleHeader; | 51 | return $simpleHeader; |
51 | } | 52 | } |
@@ -110,7 +111,7 @@ class PassportModel | @@ -110,7 +111,7 @@ class PassportModel | ||
110 | $ret = current($data['data']); | 111 | $ret = current($data['data']); |
111 | } | 112 | } |
112 | } | 113 | } |
113 | - return $ret; | 114 | + return array(); |
114 | } | 115 | } |
115 | 116 | ||
116 | /** | 117 | /** |
@@ -20,7 +20,7 @@ class BackController extends WebAction { | @@ -20,7 +20,7 @@ class BackController extends WebAction { | ||
20 | 'coverImg' => $banner ['img'], | 20 | 'coverImg' => $banner ['img'], |
21 | 'countryCode' => '86', | 21 | 'countryCode' => '86', |
22 | 'countryName' => '中国', | 22 | 'countryName' => '中国', |
23 | - 'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445', | 23 | + 'captchaUrl' => Helpers::url('/passport/images?t='.time()), |
24 | 'countryList' => RegData::getAreasData() | 24 | 'countryList' => RegData::getAreasData() |
25 | ) | 25 | ) |
26 | ); | 26 | ); |
@@ -282,7 +282,7 @@ class BackController extends WebAction { | @@ -282,7 +282,7 @@ class BackController extends WebAction { | ||
282 | $area = $this->post ( 'area' ); | 282 | $area = $this->post ( 'area' ); |
283 | $verifyCode = $this->post ( 'verifyCode' );//图形验证码 | 283 | $verifyCode = $this->post ( 'verifyCode' );//图形验证码 |
284 | $code = $this->post ( 'code' ); //手机验证码 | 284 | $code = $this->post ( 'code' ); //手机验证码 |
285 | - $data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index'); | 285 | + $data = array('code'=> 400, 'message' => '验证码错误!','data' => Helpers::url('/passport/back/index')); |
286 | if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code) | 286 | if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code) |
287 | && PassportModel::verifyCode($verifyCode)) { | 287 | && PassportModel::verifyCode($verifyCode)) { |
288 | $result = BackData::validateMobileCode ( $mobile, $code, $area ); | 288 | $result = BackData::validateMobileCode ( $mobile, $code, $area ); |
@@ -297,7 +297,7 @@ class BackController extends WebAction { | @@ -297,7 +297,7 @@ class BackController extends WebAction { | ||
297 | $url = '/passport/back/backcode?code=' . base64_encode ( $code ); | 297 | $url = '/passport/back/backcode?code=' . base64_encode ( $code ); |
298 | $data ['code'] = 200; | 298 | $data ['code'] = 200; |
299 | $data['message'] = '验证成功'; | 299 | $data['message'] = '验证成功'; |
300 | - $data['data'] = SITE_MAIN . $url; | 300 | + $data['data'] = Helpers::url($url); |
301 | } | 301 | } |
302 | } | 302 | } |
303 | $this->echoJson($data); | 303 | $this->echoJson($data); |
@@ -19,13 +19,13 @@ class RegisterController extends WebAction | @@ -19,13 +19,13 @@ class RegisterController extends WebAction | ||
19 | 'registerPage' => true, | 19 | 'registerPage' => true, |
20 | 'simpleHeader' => PassportModel::getSimpleHeader(), | 20 | 'simpleHeader' => PassportModel::getSimpleHeader(), |
21 | 'passport' => array( | 21 | 'passport' => array( |
22 | - 'actionUrl' => SITE_MAIN.'/passport/register/mobileregister', | 22 | + 'actionUrl' => Helpers::url('/passport/register/mobileregister'), |
23 | 'region' => RegData::getAreasData(), | 23 | 'region' => RegData::getAreasData(), |
24 | 'location' => '+86', | 24 | 'location' => '+86', |
25 | - 'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445', | ||
26 | - 'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9', | 25 | + 'captchaUrl' => Helpers::url('/passport/images?t='.time()), |
26 | + 'itemUrl' => Helpers::url('/help/?category_id=9'), | ||
27 | 'referUrl' => $refer, | 27 | 'referUrl' => $refer, |
28 | - 'loginUrl' => SITE_MAIN.'/signin.html?refer='.$refer, | 28 | + 'loginUrl' => Helpers::url('/signin.html?refer='.$refer), |
29 | 'coverHref' => $cover['url'], | 29 | 'coverHref' => $cover['url'], |
30 | 'coverImg' => $cover['img'], | 30 | 'coverImg' => $cover['img'], |
31 | 'regBtnText' => '立即注册' | 31 | 'regBtnText' => '立即注册' |
@@ -131,9 +131,12 @@ class RegisterController extends WebAction | @@ -131,9 +131,12 @@ class RegisterController extends WebAction | ||
131 | break; | 131 | break; |
132 | } | 132 | } |
133 | //发送代码 | 133 | //发送代码 |
134 | - $send_code_key = md5('send_code_' .$area.'_'.$mobile); | ||
135 | - $send_code_times = Cache::increment($send_code_key, 1, 0, 3600); | ||
136 | - if($send_code_times > 50) { | 134 | + $sendCodeKey = md5('send_code_' . $area . '_' . $mobile); |
135 | + if (!Cache::get($sendCodeKey)) { | ||
136 | + Cache::set($sendCodeKey, 0); | ||
137 | + } | ||
138 | + $sendCodeTimes = Cache::increment($sendCodeKey, 1, 0, 3600); | ||
139 | + if ($sendCodeTimes > 50) { | ||
137 | $data['message'] = '发送验证码太多'; | 140 | $data['message'] = '发送验证码太多'; |
138 | break; | 141 | break; |
139 | } | 142 | } |
@@ -25,3 +25,11 @@ routes.searchsuggest.match = "/api/suggest" | @@ -25,3 +25,11 @@ routes.searchsuggest.match = "/api/suggest" | ||
25 | routes.searchsuggest.route.module = Product | 25 | routes.searchsuggest.route.module = Product |
26 | routes.searchsuggest.route.controller = Search | 26 | routes.searchsuggest.route.controller = Search |
27 | routes.searchsuggest.route.action = suggest | 27 | routes.searchsuggest.route.action = suggest |
28 | + | ||
29 | + | ||
30 | +;about(品牌介绍) | ||
31 | +routes.brandabout.type = "rewrite" | ||
32 | +routes.brandabout.match = "/about" | ||
33 | +routes.brandabout.route.module = Product | ||
34 | +routes.brandabout.route.controller = Index | ||
35 | +routes.brandabout.route.action = brandIntro |
-
Please register or login to post a comment