Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
10 changed files
with
184 additions
and
53 deletions
@@ -15,6 +15,7 @@ namespace Action; | @@ -15,6 +15,7 @@ namespace Action; | ||
15 | use Yaf\Controller_Abstract; | 15 | use Yaf\Controller_Abstract; |
16 | use Yaf\Dispatcher; | 16 | use Yaf\Dispatcher; |
17 | use Hood\Cache; | 17 | use Hood\Cache; |
18 | +use LibModels\Wap\Home\SideData; | ||
18 | 19 | ||
19 | class AbstractAction extends Controller_Abstract | 20 | class AbstractAction extends Controller_Abstract |
20 | { | 21 | { |
@@ -262,4 +263,77 @@ class AbstractAction extends Controller_Abstract | @@ -262,4 +263,77 @@ class AbstractAction extends Controller_Abstract | ||
262 | $this->_view->assign('footer', $footer); | 263 | $this->_view->assign('footer', $footer); |
263 | } | 264 | } |
264 | 265 | ||
266 | + /** | ||
267 | + * 设置侧边栏信息 | ||
268 | + * | ||
269 | + * @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生 | ||
270 | + * @return void | ||
271 | + */ | ||
272 | + protected function setNavSide($guangChoosed = 'all') | ||
273 | + { | ||
274 | + $this->_view->assign('subNav', array( | ||
275 | + 0 => array( | ||
276 | + 'textCn' => '男生', | ||
277 | + 'textEn' => 'BOYS', | ||
278 | + 'styleClass' => 'boys', | ||
279 | + 'url' => '/boys.html', | ||
280 | + ), | ||
281 | + 1 => array( | ||
282 | + 'textCn' => '女生', | ||
283 | + 'textEn' => 'GIRLS', | ||
284 | + 'styleClass' => 'girls', | ||
285 | + 'url' => '/girls.html', | ||
286 | + ), | ||
287 | + 2 => array( | ||
288 | + 'textCn' => '潮童', | ||
289 | + 'textEn' => 'KIDS', | ||
290 | + 'styleClass' => 'kids', | ||
291 | + 'url' => '/kids.html', | ||
292 | + ), | ||
293 | + 3 => array( | ||
294 | + 'textCn' => '创意生活', | ||
295 | + 'textEn' => 'LIFE STYLE', | ||
296 | + 'styleClass' => 'life', | ||
297 | + 'url' => '/life.html', | ||
298 | + ), | ||
299 | + 4 => array( | ||
300 | + 'textCn' => '逛', | ||
301 | + 'textEn' => 'TRENDFINDER', | ||
302 | + 'styleClass' => 'guang', | ||
303 | + 'url' => '/guang.html', | ||
304 | + 'subNav' => array( | ||
305 | + 'list' => array( | ||
306 | + 0 => array( | ||
307 | + 'textCn' => '逛', | ||
308 | + 'textEn' => 'TrendFinder', | ||
309 | + 'back' => true, | ||
310 | + 'isSelect' => false, | ||
311 | + ), | ||
312 | + 1 => array( | ||
313 | + 'textCn' => '查看全部', | ||
314 | + 'textEn' => '', | ||
315 | + 'back' => false, | ||
316 | + 'isSelect' => ($guangChoosed === 'all') ? true : false, | ||
317 | + 'url' => '/guang/list/index?gender=1,2,3' | ||
318 | + ), | ||
319 | + 2 => array( | ||
320 | + 'textCn' => '只看男生', | ||
321 | + 'textEn' => 'Boys', | ||
322 | + 'back' => false, | ||
323 | + 'isSelect' => ($guangChoosed === 'boys') ? true : false, | ||
324 | + 'url' => '/guang/list/index?gender=1,3' | ||
325 | + ), | ||
326 | + 3 => array( | ||
327 | + 'textCn' => '只看女生', | ||
328 | + 'textEn' => 'Girls', | ||
329 | + 'back' => false, | ||
330 | + 'isSelect' => ($guangChoosed === 'girls') ? true : false, | ||
331 | + 'url' => '/guang/list/index?gender=2,3', | ||
332 | + ), | ||
333 | + ) | ||
334 | + ) | ||
335 | + ), | ||
336 | + )); | ||
337 | + } | ||
338 | + | ||
265 | } | 339 | } |
library/LibModels/Wap/Home/SideData.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace LibModels\Wap\Home; | ||
4 | + | ||
5 | +use Api\Sign; | ||
6 | +use Api\Yohobuy; | ||
7 | + | ||
8 | +/** | ||
9 | + * 侧边栏的数据模型 | ||
10 | + * | ||
11 | + * @name SideData | ||
12 | + * @package LibModels/Wap/Home | ||
13 | + * @copyright yoho.inc | ||
14 | + * @version 1.0 (2015-10-13 17:42:27) | ||
15 | + * @author fei.hong <fei.hong@yoho.cn> | ||
16 | + */ | ||
17 | +class SideData | ||
18 | +{ | ||
19 | + const URI_LEFTNAV_ENTRANCE = 'operations/api/v5/entrance/getEntrance'; | ||
20 | + const URI_LEFTNAV_CATEGORY = 'operations/api/v5/category/getCategory'; | ||
21 | + | ||
22 | + /** | ||
23 | + * 左侧边栏的分类和图标数据 | ||
24 | + * | ||
25 | + * 备注:暂不使用,因很少变,获取后还需要再封装 | ||
26 | + * | ||
27 | + * @return array | ||
28 | + */ | ||
29 | + public static function leftNav() | ||
30 | + { | ||
31 | + $param = Yohobuy::param(); | ||
32 | + $param['client_type'] = 'iphone'; // 因安卓不返回icon的地址 | ||
33 | + $param['client_secret'] = Sign::getSign($param); | ||
34 | + $query = Yohobuy::httpBuildQuery('', $param); | ||
35 | + | ||
36 | + $urlList = array(); | ||
37 | + $urlList['getEntrance'] = Yohobuy::SERVICE_URL . self::URI_LEFTNAV_ENTRANCE . $query; | ||
38 | + $urlList['getCategory'] = Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY . $query; | ||
39 | + | ||
40 | + return Yohobuy::getMulti($urlList); | ||
41 | + | ||
42 | +// $param = Yohobuy::param(); | ||
43 | +// $param['client_secret'] = Sign::getSign($param); | ||
44 | +// | ||
45 | +// return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY, $param); | ||
46 | + } | ||
47 | + | ||
48 | +} |
@@ -10,6 +10,9 @@ class BoysController extends AbstractAction | @@ -10,6 +10,9 @@ class BoysController extends AbstractAction | ||
10 | 10 | ||
11 | public function indexAction() | 11 | public function indexAction() |
12 | { | 12 | { |
13 | + // 显示侧边栏 | ||
14 | + $this->setNavSide(); | ||
15 | + | ||
13 | // 频道数据 | 16 | // 频道数据 |
14 | $channelData = Index::getUserChannelData(0, '1,3', '201504091403001'); | 17 | $channelData = Index::getUserChannelData(0, '1,3', '201504091403001'); |
15 | 18 |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
4 | use LibModels\Wap\Home\IndexData as Index; | 4 | use LibModels\Wap\Home\IndexData as Index; |
5 | + | ||
5 | /** | 6 | /** |
6 | * 女生首页 | 7 | * 女生首页 |
7 | */ | 8 | */ |
@@ -10,6 +11,9 @@ class GirlsController extends AbstractAction | @@ -10,6 +11,9 @@ class GirlsController extends AbstractAction | ||
10 | 11 | ||
11 | public function indexAction() | 12 | public function indexAction() |
12 | { | 13 | { |
14 | + // 显示侧边栏 | ||
15 | + $this->setNavSide(); | ||
16 | + | ||
13 | $data = array( | 17 | $data = array( |
14 | 'headerDownload' => array( | 18 | 'headerDownload' => array( |
15 | 'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480', | 19 | 'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480', |
@@ -72,11 +76,9 @@ class GirlsController extends AbstractAction | @@ -72,11 +76,9 @@ class GirlsController extends AbstractAction | ||
72 | 'url' => '', | 76 | 'url' => '', |
73 | 'isSelect' => true | 77 | 'isSelect' => true |
74 | ) | 78 | ) |
75 | - | ||
76 | ) | 79 | ) |
77 | ) | 80 | ) |
78 | ) | 81 | ) |
79 | - | ||
80 | ), | 82 | ), |
81 | 'content' => array( | 83 | 'content' => array( |
82 | 'bannerTop' => array( | 84 | 'bannerTop' => array( |
@@ -373,12 +375,7 @@ class GirlsController extends AbstractAction | @@ -373,12 +375,7 @@ class GirlsController extends AbstractAction | ||
373 | ) | 375 | ) |
374 | ) | 376 | ) |
375 | ) | 377 | ) |
376 | - | ||
377 | - | ||
378 | - | ||
379 | - | ||
380 | - | ||
381 | - ), | 378 | + )); |
382 | 379 | ||
383 | // 频道数据 | 380 | // 频道数据 |
384 | $channelData = Index::getUserChannelData(0, '2,3', '201504091403002'); | 381 | $channelData = Index::getUserChannelData(0, '2,3', '201504091403002'); |
@@ -391,11 +388,10 @@ class GirlsController extends AbstractAction | @@ -391,11 +388,10 @@ class GirlsController extends AbstractAction | ||
391 | 388 | ||
392 | // // 频道数据 | 389 | // // 频道数据 |
393 | // $channelData = Index::getUserChannelData(0, '2,3', '201504091403002'); | 390 | // $channelData = Index::getUserChannelData(0, '2,3', '201504091403002'); |
394 | - | ||
395 | // echo '<pre>'; | 391 | // echo '<pre>'; |
396 | // print_r($channelData); | 392 | // print_r($channelData); |
397 | - | ||
398 | // $this->_view->assign('title', 'YOHO!有货'); | 393 | // $this->_view->assign('title', 'YOHO!有货'); |
399 | // $this->_view->display('girls', compact('channelData')); | 394 | // $this->_view->display('girls', compact('channelData')); |
400 | } | 395 | } |
396 | + | ||
401 | } | 397 | } |
1 | <?php | 1 | <?php |
2 | + | ||
2 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
3 | use LibModels\Wap\Home\IndexData; | 4 | use LibModels\Wap\Home\IndexData; |
4 | 5 | ||
@@ -16,23 +17,21 @@ class IndexController extends AbstractAction | @@ -16,23 +17,21 @@ class IndexController extends AbstractAction | ||
16 | // 启动滚动图 | 17 | // 启动滚动图 |
17 | $startBannerData = IndexData::getBannerStart(); | 18 | $startBannerData = IndexData::getBannerStart(); |
18 | $startBanner = array(); | 19 | $startBanner = array(); |
19 | - if($startBannerData['code'] == 200) | ||
20 | - { | ||
21 | - foreach ($startBannerData['data'] as $single) | ||
22 | - { | 20 | + if ($startBannerData['code'] == 200) { |
21 | + foreach ($startBannerData['data'] as $single) { | ||
23 | $startBanner = $single['data']; | 22 | $startBanner = $single['data']; |
24 | } | 23 | } |
25 | - | ||
26 | } | 24 | } |
27 | // 启动频道数据 | 25 | // 启动频道数据 |
28 | $homeChannels = IndexData::getHomeChannels(); | 26 | $homeChannels = IndexData::getHomeChannels(); |
29 | // 用户个人信息 | 27 | // 用户个人信息 |
30 | $userProfile = IndexData::getUserProfile(0); | 28 | $userProfile = IndexData::getUserProfile(0); |
31 | 29 | ||
32 | - /*echo '<pre>'; | ||
33 | - var_dump($homeChannels);exit;*/ | 30 | + /* echo '<pre>'; |
31 | + var_dump($homeChannels);exit; */ | ||
34 | 32 | ||
35 | $this->_view->assign('title', 'YOHO!有货'); | 33 | $this->_view->assign('title', 'YOHO!有货'); |
36 | $this->_view->display('index', compact('startBanner', 'homeChannels', 'userProfile')); | 34 | $this->_view->display('index', compact('startBanner', 'homeChannels', 'userProfile')); |
37 | } | 35 | } |
36 | + | ||
38 | } | 37 | } |
@@ -18,5 +18,8 @@ class KidsController extends AbstractAction | @@ -18,5 +18,8 @@ class KidsController extends AbstractAction | ||
18 | 18 | ||
19 | $this->_view->assign('title', 'YOHO!有货'); | 19 | $this->_view->assign('title', 'YOHO!有货'); |
20 | $this->_view->display('kids', compact('channelData')); | 20 | $this->_view->display('kids', compact('channelData')); |
21 | + | ||
22 | + // 显示侧边栏 | ||
23 | + $this->setNavSide(); | ||
21 | } | 24 | } |
22 | } | 25 | } |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
4 | use LibModels\Wap\Home\IndexData as Index; | 4 | use LibModels\Wap\Home\IndexData as Index; |
5 | + | ||
5 | /** | 6 | /** |
6 | * 创意生活首页 | 7 | * 创意生活首页 |
7 | */ | 8 | */ |
@@ -10,7 +11,6 @@ class LifestyleController extends AbstractAction | @@ -10,7 +11,6 @@ class LifestyleController extends AbstractAction | ||
10 | 11 | ||
11 | public function indexAction() | 12 | public function indexAction() |
12 | { | 13 | { |
13 | - | ||
14 | // 频道数据 | 14 | // 频道数据 |
15 | $channelData = Index::getUserChannelData(0, '1,3', '9aa25f5133f011ec96c2045eb15ae425'); | 15 | $channelData = Index::getUserChannelData(0, '1,3', '9aa25f5133f011ec96c2045eb15ae425'); |
16 | 16 | ||
@@ -19,5 +19,9 @@ class LifestyleController extends AbstractAction | @@ -19,5 +19,9 @@ class LifestyleController extends AbstractAction | ||
19 | 19 | ||
20 | $this->_view->assign('title', 'YOHO!有货'); | 20 | $this->_view->assign('title', 'YOHO!有货'); |
21 | $this->_view->display('lifestyle', compact('channelData')); | 21 | $this->_view->display('lifestyle', compact('channelData')); |
22 | + | ||
23 | + // 显示侧边栏 | ||
24 | + $this->setNavSide(); | ||
22 | } | 25 | } |
26 | + | ||
23 | } | 27 | } |
@@ -51,7 +51,7 @@ class PlusstarController extends AbstractAction | @@ -51,7 +51,7 @@ class PlusstarController extends AbstractAction | ||
51 | // 情况2: 单张图 | 51 | // 情况2: 单张图 |
52 | elseif (isset($star['data'][0])) { | 52 | elseif (isset($star['data'][0])) { |
53 | $build['url'] = $star['data'][0]['url']; | 53 | $build['url'] = $star['data'][0]['url']; |
54 | - $build['img'] = $star['data'][0]['src']; | 54 | + $build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310); |
55 | $data['ps']['star'][] = $build; | 55 | $data['ps']['star'][] = $build; |
56 | } | 56 | } |
57 | } | 57 | } |
@@ -76,8 +76,8 @@ class LoginController extends AbstractAction | @@ -76,8 +76,8 @@ class LoginController extends AbstractAction | ||
76 | /** | 76 | /** |
77 | * 登录操作 | 77 | * 登录操作 |
78 | * | 78 | * |
79 | - * @param string area 地区编号, 不需要+号 | ||
80 | - * @param string profile 账号(邮箱或手机号) | 79 | + * @param string areaCode 地区编号, 不需要+号 |
80 | + * @param string account 账号(邮箱或手机号) | ||
81 | * @param string password 密码 | 81 | * @param string password 密码 |
82 | * @return json | 82 | * @return json |
83 | */ | 83 | */ |
@@ -92,8 +92,8 @@ class LoginController extends AbstractAction | @@ -92,8 +92,8 @@ class LoginController extends AbstractAction | ||
92 | } | 92 | } |
93 | 93 | ||
94 | /* 判断参数是否传递 */ | 94 | /* 判断参数是否传递 */ |
95 | - $area = $this->post('area', '86'); | ||
96 | - $profile = $this->post('profile'); | 95 | + $area = $this->post('areaCode', '86'); |
96 | + $profile = $this->post('account'); | ||
97 | $password = $this->post('password'); | 97 | $password = $this->post('password'); |
98 | if (!is_numeric($area) || empty($profile) || empty($password)) { | 98 | if (!is_numeric($area) || empty($profile) || empty($password)) { |
99 | break; | 99 | break; |
@@ -109,6 +109,9 @@ class LoginController extends AbstractAction | @@ -109,6 +109,9 @@ class LoginController extends AbstractAction | ||
109 | 109 | ||
110 | /* 调用登录接口进行登录 */ | 110 | /* 调用登录接口进行登录 */ |
111 | $data = LoginData::signin($area, $profile, $password); | 111 | $data = LoginData::signin($area, $profile, $password); |
112 | + if ($data['code'] == 200) { | ||
113 | + $data['data'] = '/'; // @todo | ||
114 | + } | ||
112 | 115 | ||
113 | } while (false); | 116 | } while (false); |
114 | 117 |
@@ -22,6 +22,7 @@ class RegController extends AbstractAction | @@ -22,6 +22,7 @@ class RegController extends AbstractAction | ||
22 | $data['headerText'] = '注册'; | 22 | $data['headerText'] = '注册'; |
23 | $data['isPassportPage'] = true; | 23 | $data['isPassportPage'] = true; |
24 | $data['countrys'] = array(); | 24 | $data['countrys'] = array(); |
25 | + $data['areaCode'] = '+86'; | ||
25 | 26 | ||
26 | // 获取地区数据列表 | 27 | // 获取地区数据列表 |
27 | $area = RegData::getAreasData(); | 28 | $area = RegData::getAreasData(); |
@@ -52,15 +53,15 @@ class RegController extends AbstractAction | @@ -52,15 +53,15 @@ class RegController extends AbstractAction | ||
52 | /** | 53 | /** |
53 | * 验证码 | 54 | * 验证码 |
54 | * | 55 | * |
55 | - * @param string area 地区编号 | ||
56 | - * @param string mobile 手机号 | 56 | + * @param string areaCode 地区编号 |
57 | + * @param string phoneNum 手机号 | ||
57 | * @param string token 访问TOKEN凭证 | 58 | * @param string token 访问TOKEN凭证 |
58 | */ | 59 | */ |
59 | public function codeAction() | 60 | public function codeAction() |
60 | { | 61 | { |
61 | $token = $this->get('token'); | 62 | $token = $this->get('token'); |
62 | - $mobile = $this->get('mobile'); | ||
63 | - $area = $this->get('area', '86'); | 63 | + $mobile = $this->get('phoneNum'); |
64 | + $area = $this->get('areaCode', '86'); | ||
64 | 65 | ||
65 | // 判断是否允许访问, 不允许则跳转到错误页面 | 66 | // 判断是否允许访问, 不允许则跳转到错误页面 |
66 | if (!is_string($token) || !is_numeric($mobile) || !Helpers::verifyToken($mobile, $token)) { | 67 | if (!is_string($token) || !is_numeric($mobile) || !Helpers::verifyToken($mobile, $token)) { |
@@ -74,7 +75,7 @@ class RegController extends AbstractAction | @@ -74,7 +75,7 @@ class RegController extends AbstractAction | ||
74 | $data['backUrl'] = '/'; | 75 | $data['backUrl'] = '/'; |
75 | $data['headerText'] = '注册'; | 76 | $data['headerText'] = '注册'; |
76 | $data['isPassportPage'] = true; | 77 | $data['isPassportPage'] = true; |
77 | - $data['areaCode'] = $area; | 78 | + $data['areaCode'] = '+' . $area; |
78 | $data['phoneNum'] = $mobile; | 79 | $data['phoneNum'] = $mobile; |
79 | $data['token'] = $token; | 80 | $data['token'] = $token; |
80 | 81 | ||
@@ -84,15 +85,15 @@ class RegController extends AbstractAction | @@ -84,15 +85,15 @@ class RegController extends AbstractAction | ||
84 | /** | 85 | /** |
85 | * 填写密码页面 | 86 | * 填写密码页面 |
86 | * | 87 | * |
87 | - * @param string area 地区编号 | ||
88 | - * @param string mobile 手机号 | 88 | + * @param string areaCode 地区编号 |
89 | + * @param string phoneNum 手机号 | ||
89 | * @param string token 访问TOKEN凭证 | 90 | * @param string token 访问TOKEN凭证 |
90 | */ | 91 | */ |
91 | public function passwordAction() | 92 | public function passwordAction() |
92 | { | 93 | { |
93 | $token = $this->get('token'); | 94 | $token = $this->get('token'); |
94 | - $mobile = $this->get('mobile'); | ||
95 | - $area = $this->get('area', '86'); | 95 | + $mobile = $this->get('phoneNum'); |
96 | + $area = $this->get('areaCode', '86'); | ||
96 | 97 | ||
97 | // 判断是否允许访问, 不允许则跳转到错误页面 | 98 | // 判断是否允许访问, 不允许则跳转到错误页面 |
98 | if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) | 99 | if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) |
@@ -117,13 +118,13 @@ class RegController extends AbstractAction | @@ -117,13 +118,13 @@ class RegController extends AbstractAction | ||
117 | /** | 118 | /** |
118 | * 验证注册的手机号 | 119 | * 验证注册的手机号 |
119 | * | 120 | * |
120 | - * @param string area 地区编号,注意不需要+号 | ||
121 | - * @param string mobile 手机号 | 121 | + * @param string areaCode 地区编号,注意不需要+号 |
122 | + * @param string phoneNum 手机号 | ||
122 | * @return json | 123 | * @return json |
123 | */ | 124 | */ |
124 | public function verifymobileAction() | 125 | public function verifymobileAction() |
125 | { | 126 | { |
126 | - $data = array('code' => 400, 'message' => '参数不正确!', 'data' => ''); | 127 | + $data = array('code' => 400, 'message' => '手机号已存在', 'data' => ''); |
127 | 128 | ||
128 | do { | 129 | do { |
129 | /* 判断是不是AJAX请求 */ | 130 | /* 判断是不是AJAX请求 */ |
@@ -131,8 +132,8 @@ class RegController extends AbstractAction | @@ -131,8 +132,8 @@ class RegController extends AbstractAction | ||
131 | break; | 132 | break; |
132 | } | 133 | } |
133 | 134 | ||
134 | - $mobile = $this->post('mobile'); | ||
135 | - $area = $this->post('area', '86'); | 135 | + $mobile = $this->post('phoneNum'); |
136 | + $area = $this->post('areaCode', '86'); | ||
136 | /* 判断参数是否合法 */ | 137 | /* 判断参数是否合法 */ |
137 | if (!is_numeric($mobile) || !is_numeric($area)) { | 138 | if (!is_numeric($mobile) || !is_numeric($area)) { |
138 | break; | 139 | break; |
@@ -147,7 +148,7 @@ class RegController extends AbstractAction | @@ -147,7 +148,7 @@ class RegController extends AbstractAction | ||
147 | /* 返回跳转到验证页面的链接*/ | 148 | /* 返回跳转到验证页面的链接*/ |
148 | if ($data['code'] == 200) { | 149 | if ($data['code'] == 200) { |
149 | $token = Helpers::makeToken($mobile); | 150 | $token = Helpers::makeToken($mobile); |
150 | - $data['data'] = '/passport/reg/code?token='.$token.'&mobile='.$mobile.'&area='.$area; | 151 | + $data['data'] = '/passport/reg/code?token='.$token.'&phoneNum='.$mobile.'&areaCode='.$area; |
151 | } | 152 | } |
152 | 153 | ||
153 | } while (false); | 154 | } while (false); |
@@ -158,15 +159,15 @@ class RegController extends AbstractAction | @@ -158,15 +159,15 @@ class RegController extends AbstractAction | ||
158 | /** | 159 | /** |
159 | * 验证注册的识别码 | 160 | * 验证注册的识别码 |
160 | * | 161 | * |
161 | - * @param string area 地区编号,注意不需要+号 | ||
162 | - * @param string mobile 手机号 | 162 | + * @param string areaCode 地区编号,注意不需要+号 |
163 | + * @param string phoneNum 手机号 | ||
163 | * @param string token 访问TOKEN凭证 | 164 | * @param string token 访问TOKEN凭证 |
164 | * @param int code 验证码, 手机上收到的 | 165 | * @param int code 验证码, 手机上收到的 |
165 | * @return json | 166 | * @return json |
166 | */ | 167 | */ |
167 | public function verifycodeAction() | 168 | public function verifycodeAction() |
168 | { | 169 | { |
169 | - $data = array('code' => 400, 'message' => '参数不正确!', 'data' => ''); | 170 | + $data = array('code' => 400, 'message' => '验证码不正确', 'data' => ''); |
170 | 171 | ||
171 | do { | 172 | do { |
172 | /* 判断是不是AJAX请求 */ | 173 | /* 判断是不是AJAX请求 */ |
@@ -174,8 +175,8 @@ class RegController extends AbstractAction | @@ -174,8 +175,8 @@ class RegController extends AbstractAction | ||
174 | break; | 175 | break; |
175 | } | 176 | } |
176 | 177 | ||
177 | - $mobile = $this->post('mobile'); | ||
178 | - $area = $this->post('area'); | 178 | + $mobile = $this->post('phoneNum'); |
179 | + $area = $this->post('areaCode'); | ||
179 | $code = $this->post('code'); | 180 | $code = $this->post('code'); |
180 | /* 判断参数是否合法 */ | 181 | /* 判断参数是否合法 */ |
181 | if (!is_numeric($mobile) || !is_numeric($area) || !isset($code)) { | 182 | if (!is_numeric($mobile) || !is_numeric($area) || !isset($code)) { |
@@ -191,7 +192,7 @@ class RegController extends AbstractAction | @@ -191,7 +192,7 @@ class RegController extends AbstractAction | ||
191 | /* 返回跳转到设置密码的链接*/ | 192 | /* 返回跳转到设置密码的链接*/ |
192 | if ($data['code'] == 200) { | 193 | if ($data['code'] == 200) { |
193 | $token = Helpers::makeToken($mobile); | 194 | $token = Helpers::makeToken($mobile); |
194 | - $data['data'] = '/passport/reg/password?token='.$token.'&mobile='.$mobile.'&area='.$area; | 195 | + $data['data'] = '/passport/reg/password?token='.$token.'&phoneNum='.$mobile.'&areaCode='.$area; |
195 | } | 196 | } |
196 | 197 | ||
197 | } while (false); | 198 | } while (false); |
@@ -202,8 +203,8 @@ class RegController extends AbstractAction | @@ -202,8 +203,8 @@ class RegController extends AbstractAction | ||
202 | /** | 203 | /** |
203 | * 发送验证码 | 204 | * 发送验证码 |
204 | * | 205 | * |
205 | - * @param string area 地区编号,注意不需要+号 | ||
206 | - * @param string mobile 手机号 | 206 | + * @param string areaCode 地区编号,注意不需要+号 |
207 | + * @param string phoneNum 手机号 | ||
207 | * @return json | 208 | * @return json |
208 | */ | 209 | */ |
209 | public function sendcodeAction() | 210 | public function sendcodeAction() |
@@ -216,8 +217,8 @@ class RegController extends AbstractAction | @@ -216,8 +217,8 @@ class RegController extends AbstractAction | ||
216 | break; | 217 | break; |
217 | } | 218 | } |
218 | 219 | ||
219 | - $mobile = $this->post('mobile'); | ||
220 | - $area = $this->post('area', '86'); | 220 | + $mobile = $this->post('phoneNum'); |
221 | + $area = $this->post('areaCode', '86'); | ||
221 | /* 判断参数是否合法 */ | 222 | /* 判断参数是否合法 */ |
222 | if (!is_numeric($mobile) || !is_numeric($area)) { | 223 | if (!is_numeric($mobile) || !is_numeric($area)) { |
223 | break; | 224 | break; |
@@ -237,8 +238,8 @@ class RegController extends AbstractAction | @@ -237,8 +238,8 @@ class RegController extends AbstractAction | ||
237 | /** | 238 | /** |
238 | * 设置密码 | 239 | * 设置密码 |
239 | * | 240 | * |
240 | - * @param string area 地区编号,注意不需要+号 | ||
241 | - * @param string mobile 手机号 | 241 | + * @param string areaCode 地区编号,注意不需要+号 |
242 | + * @param string phoneNum 手机号 | ||
242 | * @param string token 访问TOKEN凭证 | 243 | * @param string token 访问TOKEN凭证 |
243 | * @param string password 用户设置的密码 | 244 | * @param string password 用户设置的密码 |
244 | * @return json | 245 | * @return json |
@@ -254,8 +255,8 @@ class RegController extends AbstractAction | @@ -254,8 +255,8 @@ class RegController extends AbstractAction | ||
254 | } | 255 | } |
255 | 256 | ||
256 | $token = $this->post('token'); | 257 | $token = $this->post('token'); |
257 | - $mobile = $this->post('mobile'); | ||
258 | - $area = $this->post('area'); | 258 | + $mobile = $this->post('phoneNum'); |
259 | + $area = $this->post('areaCode'); | ||
259 | $password = $this->post('password'); | 260 | $password = $this->post('password'); |
260 | /* 判断参数是否合法 */ | 261 | /* 判断参数是否合法 */ |
261 | if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) || !isset($password)) { | 262 | if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) || !isset($password)) { |
@@ -275,7 +276,7 @@ class RegController extends AbstractAction | @@ -275,7 +276,7 @@ class RegController extends AbstractAction | ||
275 | 276 | ||
276 | /* 返回跳转到来源页面 */ | 277 | /* 返回跳转到来源页面 */ |
277 | if ($data['code'] == 200) { | 278 | if ($data['code'] == 200) { |
278 | - $data['data'] = '/passport/reg/password?token='.$token.'&mobile='.$mobile.'&area='.$area; | 279 | + $data['data'] = '/'; |
279 | } | 280 | } |
280 | 281 | ||
281 | } while (false); | 282 | } while (false); |
-
Please register or login to post a comment