Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
11 changed files
with
188 additions
and
118 deletions
@@ -1242,11 +1242,45 @@ | @@ -1242,11 +1242,45 @@ | ||
1242 | 'cartUrl':'购物车url', | 1242 | 'cartUrl':'购物车url', |
1243 | 'addToCartUrl':'添加购物车url', | 1243 | 'addToCartUrl':'添加购物车url', |
1244 | 'soldOut':'已售罄', | 1244 | 'soldOut':'已售罄', |
1245 | - 'notForSale':'非卖品' | 1245 | + 'notForSale':'非卖品', |
1246 | + | ||
1247 | + | ||
1248 | + thumb: [ | ||
1249 | + { | ||
1250 | + id:1, | ||
1251 | + url : '' | ||
1252 | + }, | ||
1253 | + ... | ||
1254 | + ], | ||
1255 | + name: '', | ||
1256 | + price: '', | ||
1257 | + salePrice: '', | ||
1258 | + colors: [ | ||
1259 | + { | ||
1260 | + id: 1, | ||
1261 | + chosed: true, | ||
1262 | + name: '黄色', | ||
1263 | + colorNum:10, | ||
1264 | + shortUrl:'', | ||
1265 | + | ||
1266 | + }, | ||
1267 | + ... | ||
1268 | + ], | ||
1269 | + sizes: [ | ||
1270 | + { | ||
1271 | + id: 2, | ||
1272 | + chosed: true, | ||
1273 | + name: 'X', | ||
1274 | + sizeNum: 2 | ||
1275 | + }, | ||
1276 | + ... | ||
1277 | + ], | ||
1278 | + | ||
1279 | + totalNum: 20 | ||
1246 | }, | 1280 | }, |
1247 | 'introUrl' : '', | 1281 | 'introUrl' : '', |
1248 | 'id' : '', | 1282 | 'id' : '', |
1249 | - 'preferenceUrl' :'' | 1283 | + 'preferenceUrl' :'', |
1250 | } | 1284 | } |
1251 | ### 评价列表页面 | 1285 | ### 评价列表页面 |
1252 | { | 1286 | { |
@@ -42,12 +42,13 @@ class BindData | @@ -42,12 +42,13 @@ class BindData | ||
42 | * @param string $mobile 手机号 | 42 | * @param string $mobile 手机号 |
43 | * | 43 | * |
44 | */ | 44 | */ |
45 | - public static function sendBindMsg($mobile) | 45 | + public static function sendBindMsg($area,$mobile) |
46 | { | 46 | { |
47 | $param = Yohobuy::param(); | 47 | $param = Yohobuy::param(); |
48 | 48 | ||
49 | $param['method'] = 'app.passport.smsbind'; | 49 | $param['method'] = 'app.passport.smsbind'; |
50 | $param['mobile'] = $mobile; | 50 | $param['mobile'] = $mobile; |
51 | + $param['area'] = $area; | ||
51 | $param['client_secret'] = Sign::getSign($param); | 52 | $param['client_secret'] = Sign::getSign($param); |
52 | 53 | ||
53 | return Yohobuy::get(Yohobuy::API_URL, $param); | 54 | return Yohobuy::get(Yohobuy::API_URL, $param); |
@@ -57,13 +58,14 @@ class BindData | @@ -57,13 +58,14 @@ class BindData | ||
57 | * 验证验证码是否正确 | 58 | * 验证验证码是否正确 |
58 | * | 59 | * |
59 | */ | 60 | */ |
60 | - public static function checkBindCode($mobile, $code) | 61 | + public static function checkBindCode($area,$mobile, $code) |
61 | { | 62 | { |
62 | $param = Yohobuy::param(); | 63 | $param = Yohobuy::param(); |
63 | 64 | ||
64 | $param['method'] = 'app.register.validRegCode'; | 65 | $param['method'] = 'app.register.validRegCode'; |
65 | $param['mobile'] = $mobile; | 66 | $param['mobile'] = $mobile; |
66 | $param['code'] = $code; | 67 | $param['code'] = $code; |
68 | + $param['area'] = $area; | ||
67 | $param['client_secret'] = Sign::getSign($param); | 69 | $param['client_secret'] = Sign::getSign($param); |
68 | 70 | ||
69 | return Yohobuy::get(Yohobuy::API_URL, $param); | 71 | return Yohobuy::get(Yohobuy::API_URL, $param); |
@@ -7,7 +7,8 @@ | @@ -7,7 +7,8 @@ | ||
7 | 7 | ||
8 | var $ = require('jquery'), | 8 | var $ = require('jquery'), |
9 | Hammer = require('yoho.hammer'), | 9 | Hammer = require('yoho.hammer'), |
10 | - tip = require('../../plugin/tip'); | 10 | + tip = require('../../plugin/tip'), |
11 | + chosePanel = require('../../shopping-cart/chose-panel'); | ||
11 | 12 | ||
12 | var likeEle = document.getElementById('likeBtn'), | 13 | var likeEle = document.getElementById('likeBtn'), |
13 | likeHammer = likeEle && new Hammer(likeEle); | 14 | likeHammer = likeEle && new Hammer(likeEle); |
@@ -70,14 +71,17 @@ if (likeHammer) { | @@ -70,14 +71,17 @@ if (likeHammer) { | ||
70 | 71 | ||
71 | if (addToCartHammer) { | 72 | if (addToCartHammer) { |
72 | addToCartHammer.on('tap', function(e) { | 73 | addToCartHammer.on('tap', function(e) { |
74 | + chosePanel.show(); | ||
73 | 75 | ||
74 | // 统计代码:用于统计用户加入购物车的动作 | 76 | // 统计代码:用于统计用户加入购物车的动作 |
75 | - if (window._yas) { | ||
76 | - window._yas.sendCustomInfo({ | ||
77 | - pd: productId, | ||
78 | - by: 1 | ||
79 | - }, false); | ||
80 | - } | 77 | + // if (window._yas) { |
78 | + // window._yas.sendCustomInfo({ | ||
79 | + // pd: productId, | ||
80 | + // by: 1 | ||
81 | + // }, false); | ||
82 | + // } | ||
83 | + | ||
84 | + | ||
81 | }); | 85 | }); |
82 | } | 86 | } |
83 | 87 |
@@ -5,36 +5,45 @@ | @@ -5,36 +5,45 @@ | ||
5 | * @date: 2015/10/21 | 5 | * @date: 2015/10/21 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | -var $ = require('jquery'), | ||
9 | - Handlebars = require('yoho.handlebars'); | 8 | +var $ = require('jquery'); |
10 | 9 | ||
11 | -var $page = $('.yoho-page'); | 10 | +// Handlebars = require('yoho.handlebars'); |
11 | + | ||
12 | +// var $page = $('.yoho-page'); | ||
12 | 13 | ||
13 | var $num; | 14 | var $num; |
14 | 15 | ||
15 | -var tpl; | 16 | +// var tpl; |
16 | 17 | ||
17 | //读取partials | 18 | //读取partials |
18 | -$.ajax({ | ||
19 | - type: 'GET', | ||
20 | - url: '/shoppingCart/tpl', | ||
21 | - success: function(data) { | ||
22 | - tpl = Handlebars.compile(data); | ||
23 | - } | ||
24 | -}); | 19 | +// $.ajax({ |
20 | +// type: 'GET', | ||
21 | +// url: '/shoppingCart/tpl', | ||
22 | +// success: function(data) { | ||
23 | +// tpl = Handlebars.compile(data); | ||
24 | +// } | ||
25 | +// }); | ||
25 | 26 | ||
26 | -//显示 | ||
27 | -function show(data) { | ||
28 | - var html = tpl(data); | ||
29 | - | ||
30 | - $page.append(html); | ||
31 | 27 | ||
28 | +//显示 | ||
29 | +// function show(data) { | ||
30 | +// // var html = tpl(data); | ||
31 | +// $('.chose-panel').show(); | ||
32 | +// // $page.append(html); | ||
33 | +// $('.chose-panel') | ||
34 | +// $num = $('#good-num'); | ||
35 | +// } | ||
36 | + | ||
37 | +function show() { | ||
38 | + $('.chose-panel').show(); | ||
39 | + $('body').css('overflow', 'hidden'); | ||
32 | $num = $('#good-num'); | 40 | $num = $('#good-num'); |
33 | } | 41 | } |
34 | 42 | ||
35 | //移除当前Panel | 43 | //移除当前Panel |
36 | function remove() { | 44 | function remove() { |
37 | - $('.chose-panel').remove(); | 45 | + $('.chose-panel').hide(); |
46 | + $('body').css('overflow', 'auto'); | ||
38 | } | 47 | } |
39 | 48 | ||
40 | $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | 49 | $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
@@ -75,4 +84,5 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -75,4 +84,5 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
75 | $num.val(num + 1); | 84 | $num.val(num + 1); |
76 | }); | 85 | }); |
77 | 86 | ||
87 | + | ||
78 | exports.show = show; | 88 | exports.show = show; |
1 | .chose-panel { | 1 | .chose-panel { |
2 | - position: absolute; | 2 | + position: fixed; |
3 | + display: none; | ||
4 | + height: 100%; | ||
3 | top: 0; | 5 | top: 0; |
4 | bottom: 0; | 6 | bottom: 0; |
5 | left: 0; | 7 | left: 0; |
6 | right: 0; | 8 | right: 0; |
7 | background: rgba(0,0,0,.3); | 9 | background: rgba(0,0,0,.3); |
10 | + z-index:3; | ||
8 | 11 | ||
9 | .main { | 12 | .main { |
10 | position: absolute; | 13 | position: absolute; |
11 | - height: 610rem / $pxConvertRem; | 14 | + height: pxToRem(610px); |
12 | bottom: 0; | 15 | bottom: 0; |
13 | left: 0; | 16 | left: 0; |
14 | right: 0; | 17 | right: 0; |
@@ -18,7 +21,7 @@ | @@ -18,7 +21,7 @@ | ||
18 | .infos { | 21 | .infos { |
19 | height: 460rem / $pxConvertRem; | 22 | height: 460rem / $pxConvertRem; |
20 | padding: 0 22rem / $pxConvertRem; | 23 | padding: 0 22rem / $pxConvertRem; |
21 | - padding-top: 30rem / $pxConvertRem; | 24 | + // padding-top: 30rem / $pxConvertRem; |
22 | } | 25 | } |
23 | 26 | ||
24 | .chose-items { | 27 | .chose-items { |
@@ -27,7 +30,10 @@ | @@ -27,7 +30,10 @@ | ||
27 | } | 30 | } |
28 | 31 | ||
29 | .basic-info { | 32 | .basic-info { |
30 | - margin-bottom: 30rem / $pxConvertRem; | 33 | + overflow: hidden; |
34 | + position: relative; | ||
35 | + margin-bottom: pxToRem(30px); | ||
36 | + margin-top: pxToRem(30px); | ||
31 | } | 37 | } |
32 | 38 | ||
33 | .thumb { | 39 | .thumb { |
@@ -37,12 +43,18 @@ | @@ -37,12 +43,18 @@ | ||
37 | } | 43 | } |
38 | 44 | ||
39 | .text-info { | 45 | .text-info { |
40 | - margin-left: 102rem / $pxConvertRem; | ||
41 | - | 46 | + position: absolute; |
47 | + height: auto; | ||
48 | + left: pxToRem(95px); | ||
49 | + top:50%; | ||
50 | + transform: translateY(-50%); | ||
42 | .name { | 51 | .name { |
43 | font-size: 28rem / $pxConvertRem; | 52 | font-size: 28rem / $pxConvertRem; |
44 | } | 53 | } |
45 | 54 | ||
55 | + .price{ | ||
56 | + font-size: pxToRem(24px); | ||
57 | + } | ||
46 | .sale-price { | 58 | .sale-price { |
47 | color: #e10; | 59 | color: #e10; |
48 | 60 |
@@ -114,6 +114,7 @@ | @@ -114,6 +114,7 @@ | ||
114 | 114 | ||
115 | <div id="productDesc"> </div> | 115 | <div id="productDesc"> </div> |
116 | {{> product/recommend-for-you}} | 116 | {{> product/recommend-for-you}} |
117 | + {{> shopping-cart/chose-panel}} | ||
117 | 118 | ||
118 | {{#cartInfo}} | 119 | {{#cartInfo}} |
119 | <div class="cart-bar"> | 120 | <div class="cart-bar"> |
@@ -121,7 +122,8 @@ | @@ -121,7 +122,8 @@ | ||
121 | <a href="{{cartUrl}}" class="num-incart iconfont"></a> | 122 | <a href="{{cartUrl}}" class="num-incart iconfont"></a> |
122 | 123 | ||
123 | {{#if addToCartUrl}} | 124 | {{#if addToCartUrl}} |
124 | - <a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a> | 125 | + <!-- <a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a> --> |
126 | + <a id="addtoCart" href="javascript:;" class="addto-cart">加入购物车</a> | ||
125 | {{/if}} | 127 | {{/if}} |
126 | 128 | ||
127 | {{#if soldOut}} | 129 | {{#if soldOut}} |
1 | +{{#cartInfo}} | ||
1 | <div class="chose-panel"> | 2 | <div class="chose-panel"> |
2 | <div class="main"> | 3 | <div class="main"> |
3 | <div class="infos"> | 4 | <div class="infos"> |
@@ -25,8 +26,8 @@ | @@ -25,8 +26,8 @@ | ||
25 | </ul> | 26 | </ul> |
26 | </div> | 27 | </div> |
27 | <div class="size-list"> | 28 | <div class="size-list"> |
28 | - <span>尺码</span> | ||
29 | - <ul class="clearfix" data-type="size"> | 29 | + <span>尺码</span> |
30 | + <ul class="clearfix {{#if @first}}{{^}}hide{{/if}}" data-type="size" > | ||
30 | {{# sizes}} | 31 | {{# sizes}} |
31 | <li class="block {{#if chosed}}chosed{{/if}}" data-id={{id}}> | 32 | <li class="block {{#if chosed}}chosed{{/if}}" data-id={{id}}> |
32 | {{name}} | 33 | {{name}} |
@@ -49,7 +50,8 @@ | @@ -49,7 +50,8 @@ | ||
49 | </div> | 50 | </div> |
50 | </div> | 51 | </div> |
51 | <div class="btn-wrap"> | 52 | <div class="btn-wrap"> |
52 | - <button id="chose-btn-sure" class="btn btn-sure">确定</button> | 53 | + <button id="chose-btn-sure" class="btn btn-sure">加入购物车</button> |
53 | </div> | 54 | </div> |
54 | </div> | 55 | </div> |
55 | -</div> | ||
56 | +</div> | ||
57 | +{{/cartInfo}} |
@@ -48,7 +48,7 @@ class HomeController extends AbstractAction | @@ -48,7 +48,7 @@ class HomeController extends AbstractAction | ||
48 | 'showDownloadApp' => true, | 48 | 'showDownloadApp' => true, |
49 | 'pageFooter' => true, | 49 | 'pageFooter' => true, |
50 | 'cartUrl' => Helpers::url('/cart/index/index', null), | 50 | 'cartUrl' => Helpers::url('/cart/index/index', null), |
51 | - 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ), | 51 | + 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))), |
52 | ); | 52 | ); |
53 | $uid = $this->getUid(false); | 53 | $uid = $this->getUid(false); |
54 | if ($uid) { | 54 | if ($uid) { |
@@ -832,71 +832,49 @@ class HomeController extends AbstractAction | @@ -832,71 +832,49 @@ class HomeController extends AbstractAction | ||
832 | */ | 832 | */ |
833 | public function orderDetailAction() | 833 | public function orderDetailAction() |
834 | { | 834 | { |
835 | - $data = array( | ||
836 | - 'name' => '毛毛莉Lydia', | ||
837 | - 'phoneNum' => '18600001133', | ||
838 | - 'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼', | ||
839 | - 'orderStatus' => '订单取消', | ||
840 | - 'orderNum' => '418358063', | ||
841 | - 'orderTime' => '2014-03-10 17:25:10', | ||
842 | - 'orderCancel' => true, | ||
843 | - 'goods' => array( | ||
844 | - array( | ||
845 | - 'id' => 1, | ||
846 | - 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
847 | - 'name' => 'Adidas Originals ZX FLUXM22508', | ||
848 | - 'color' => '黄', | ||
849 | - 'size' => '43', | ||
850 | - 'price' => '699.00', | ||
851 | - 'count' => '2' | ||
852 | - ), | ||
853 | - array( | ||
854 | - 'id' => 1, | ||
855 | - 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
856 | - 'name' => 'B.Duck浴室玩伴mini浮水鸭', | ||
857 | - 'gift' => true, | ||
858 | - 'color' => '黄', | ||
859 | - 'size' => '43', | ||
860 | - 'price' => '0.00', | ||
861 | - 'count' => '1' | ||
862 | - ) | ||
863 | - ), | ||
864 | - 'sumPrice' => 799, | ||
865 | - 'salePrice' => 80, | ||
866 | - 'freight' => 5, | ||
867 | - 'coupon' => 0, | ||
868 | - 'yohoCoin' => 5, | ||
869 | - 'price' => 719 | ||
870 | - ); | ||
871 | - $this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true)); | 835 | + // 审判跳转登录页 |
836 | + $this->auditJumpLogin(); | ||
837 | + | ||
838 | + $orderCode = $this->get('order_code'); | ||
839 | + if (empty($orderCode)) { | ||
840 | + $this->error(); | ||
841 | + } | ||
842 | + | ||
843 | + $this->setTitle('订单详情'); | ||
844 | + $this->setNavHeader('订单详情'); | ||
845 | + | ||
846 | + $this->_view->display('order-detail', array( | ||
847 | + 'orderDetailPage' => true, | ||
848 | + 'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_session), | ||
849 | + )); | ||
872 | } | 850 | } |
873 | 851 | ||
874 | - /** | ||
875 | - * 帮助列表页 | ||
876 | - */ | 852 | + /** |
853 | + * 帮助列表页 | ||
854 | + */ | ||
877 | public function helpAction() | 855 | public function helpAction() |
878 | - { | ||
879 | - $service = Home\HelpModel::serviceInfo(); | 856 | + { |
880 | $this->setTitle('帮助中心'); | 857 | $this->setTitle('帮助中心'); |
881 | $this->setNavHeader('帮助中心'); | 858 | $this->setNavHeader('帮助中心'); |
882 | $data = array( | 859 | $data = array( |
883 | - 'iHelp' =>$service, | 860 | + 'iHelp' => Home\HelpModel::serviceInfo(), |
884 | ); | 861 | ); |
885 | $this->_view->display('i-help', $data); | 862 | $this->_view->display('i-help', $data); |
886 | } | 863 | } |
887 | 864 | ||
888 | /** | 865 | /** |
889 | - * 帮助列表页 | ||
890 | - */ | ||
891 | - public function helpDetailAction() | ||
892 | - { | ||
893 | - $this->setTitle('帮助中心'); | ||
894 | - $this->setNavHeader('帮助中心'); | ||
895 | - $data = array( | ||
896 | - 'iHelp' => array( | ||
897 | - array('name' => '新用户注册'), | ||
898 | - ) | ||
899 | - ); | ||
900 | - $this->_view->display('helpDetail', $data); | ||
901 | - } | 866 | + * 帮助列表页 |
867 | + */ | ||
868 | + public function helpDetailAction() | ||
869 | + { | ||
870 | + $this->setTitle('帮助中心'); | ||
871 | + $this->setNavHeader('帮助中心'); | ||
872 | + $data = array( | ||
873 | + 'iHelp' => array( | ||
874 | + array('name' => '新用户注册'), | ||
875 | + ) | ||
876 | + ); | ||
877 | + $this->_view->display('helpDetail', $data); | ||
878 | + } | ||
879 | + | ||
902 | } | 880 | } |
@@ -80,7 +80,7 @@ class OrderModel | @@ -80,7 +80,7 @@ class OrderModel | ||
80 | $result[$key]['sumCost'] = $vo['amount']; | 80 | $result[$key]['sumCost'] = $vo['amount']; |
81 | //类内调用格式化订单商品数据方法 | 81 | //类内调用格式化订单商品数据方法 |
82 | $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count); | 82 | $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count); |
83 | - $result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time())); | 83 | + $result[$key]['detailUrl'] = Helpers::url('/home/orderDetail', array('order_code' => $vo['order_code'])); |
84 | $result[$key]['count'] = $count; | 84 | $result[$key]['count'] = $count; |
85 | } | 85 | } |
86 | } | 86 | } |
@@ -237,7 +237,6 @@ class DetailModel | @@ -237,7 +237,6 @@ class DetailModel | ||
237 | // 显示加入购物车链接 | 237 | // 显示加入购物车链接 |
238 | if (!$soldOut && !$notForSale) { | 238 | if (!$soldOut && !$notForSale) { |
239 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); | 239 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); |
240 | - | ||
241 | $result['cartInfo']['productId'] = $productId; | 240 | $result['cartInfo']['productId'] = $productId; |
242 | $result['cartInfo']['thumb'] = $coverImage; | 241 | $result['cartInfo']['thumb'] = $coverImage; |
243 | $result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : ''; | 242 | $result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : ''; |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
4 | use LibModels\Wap\Passport\BindData; | 4 | use LibModels\Wap\Passport\BindData; |
5 | +use LibModels\Wap\Passport\RegData; | ||
5 | use Plugin\Helpers; | 6 | use Plugin\Helpers; |
6 | 7 | ||
7 | /** | 8 | /** |
@@ -15,14 +16,28 @@ class BindController extends AbstractAction | @@ -15,14 +16,28 @@ class BindController extends AbstractAction | ||
15 | */ | 16 | */ |
16 | public function indexAction() | 17 | public function indexAction() |
17 | { | 18 | { |
19 | + $refer = $this->get('refer'); | ||
20 | + if (!empty($refer)) | ||
21 | + { | ||
22 | + $this->setCookie('refer', $refer); | ||
23 | + } | ||
24 | + | ||
18 | $this->setTitle('绑定手机号'); | 25 | $this->setTitle('绑定手机号'); |
26 | + | ||
19 | $openId = $this->get('openId'); | 27 | $openId = $this->get('openId'); |
20 | $sourceType = $this->get('sourceType'); | 28 | $sourceType = $this->get('sourceType'); |
21 | - $nickName = $this->get('nickName'); | 29 | + $nickname = $this->get('nickname'); |
22 | $data = array( | 30 | $data = array( |
31 | + 'bindIndex'=>true,//js标识 | ||
32 | + 'backUrl' => '/', // 返回的URL链接 | ||
33 | + 'showHeaderImg' => true, // 控制显示头部图片 | ||
34 | + 'isPassportPage' => true, // 模板中模块标识 | ||
23 | 'sourceType' => $sourceType, // 第三方登录来源 | 35 | 'sourceType' => $sourceType, // 第三方登录来源 |
36 | + 'platform'=>$sourceType, | ||
24 | 'openId' => $openId, // openId | 37 | 'openId' => $openId, // openId |
25 | - 'nickname' => $nickName, //昵称 | 38 | + 'areaCode'=>'+86',//默认区号 |
39 | + 'countrys'=>RegData::getAreasData(),//国别码 | ||
40 | + 'nickname' => $nickname, //昵称 | ||
26 | ); | 41 | ); |
27 | 42 | ||
28 | // 渲染模板 | 43 | // 渲染模板 |
@@ -38,16 +53,22 @@ class BindController extends AbstractAction | @@ -38,16 +53,22 @@ class BindController extends AbstractAction | ||
38 | $this->setTitle('验证手机'); | 53 | $this->setTitle('验证手机'); |
39 | $openId = $this->get('openId'); | 54 | $openId = $this->get('openId'); |
40 | $sourceType = $this->get('sourceType'); | 55 | $sourceType = $this->get('sourceType'); |
41 | - $nickName = $this->get('nickName'); | ||
42 | - $area = $this->get('areaCode', '86'); | 56 | + $nickname = $this->get('nickname'); |
57 | + $areaCode = $this->get('areaCode', '86'); | ||
43 | $isReg = $this->get('isReg'); | 58 | $isReg = $this->get('isReg'); |
59 | + $mobile=$this->get('mobile'); | ||
44 | 60 | ||
45 | $data = array( | 61 | $data = array( |
62 | + 'bindIndex'=>true,//js标识 | ||
63 | + 'backUrl' => '/', // 返回的URL链接 | ||
64 | + 'showHeaderImg' => true, // 控制显示头部图片 | ||
65 | + 'isPassportPage' => true, // 模板中模块标识 | ||
46 | 'sourceType' => $sourceType, // 第三方登录来源 | 66 | 'sourceType' => $sourceType, // 第三方登录来源 |
47 | 'openId' => $openId, // openId | 67 | 'openId' => $openId, // openId |
48 | - 'nickname' => $nickName, //昵称 | 68 | + 'nickname' => $nickname, //昵称 |
49 | 'isReg' => $isReg, //是否是已注册过的手机号 | 69 | 'isReg' => $isReg, //是否是已注册过的手机号 |
50 | - 'area' => $area //国别码 | 70 | + 'areaCode' => $areaCode, //国别码 |
71 | + 'phoneNum'=>$mobile,//手机号码 | ||
51 | ); | 72 | ); |
52 | 73 | ||
53 | // 渲染模板 | 74 | // 渲染模板 |
@@ -63,13 +84,17 @@ class BindController extends AbstractAction | @@ -63,13 +84,17 @@ class BindController extends AbstractAction | ||
63 | $this->setTitle('重新设置登录密码'); | 84 | $this->setTitle('重新设置登录密码'); |
64 | $openId = $this->get('openId'); | 85 | $openId = $this->get('openId'); |
65 | $sourceType = $this->get('sourceType'); | 86 | $sourceType = $this->get('sourceType'); |
66 | - $nickName = $this->get('nickName'); | ||
67 | - $area = $this->get('areaCode', '86'); | 87 | + $nickname = $this->get('nickname'); |
88 | + $areaCode = $this->get('areaCode', '86'); | ||
68 | $data = array( | 89 | $data = array( |
90 | + 'bindIndex'=>true,//js标识 | ||
91 | + 'backUrl' => '/', // 返回的URL链接 | ||
92 | + 'showHeaderImg' => true, // 控制显示头部图片 | ||
93 | + 'isPassportPage' => true, // 模板中模块标识 | ||
69 | 'sourceType' => $sourceType, // 第三方登录来源 | 94 | 'sourceType' => $sourceType, // 第三方登录来源 |
70 | 'openId' => $openId, // openId | 95 | 'openId' => $openId, // openId |
71 | - 'nickname' => $nickName, //昵称 | ||
72 | - 'area' => $area //国别码 | 96 | + 'nickname' => $nickname, //昵称 |
97 | + 'areaCode' => $areaCode //国别码 | ||
73 | ); | 98 | ); |
74 | 99 | ||
75 | // 渲染模板 | 100 | // 渲染模板 |
@@ -91,12 +116,12 @@ class BindController extends AbstractAction | @@ -91,12 +116,12 @@ class BindController extends AbstractAction | ||
91 | 116 | ||
92 | $mobile = $this->post('mobile'); | 117 | $mobile = $this->post('mobile'); |
93 | $openId = $this->post('openId'); | 118 | $openId = $this->post('openId'); |
94 | - $area = $this->post('areaCode', '86'); | 119 | + $areaCode = $this->post('areaCode', '86'); |
95 | $sourceType = $this->post('sourceType'); | 120 | $sourceType = $this->post('sourceType'); |
96 | - $nickName = $this->post('nickName'); | 121 | + $nickname = $this->post('nickname'); |
97 | 122 | ||
98 | 123 | ||
99 | - if (!is_numeric($mobile) || !$openId || !$area || !$sourceType) | 124 | + if (!is_numeric($mobile) || !$openId || !$areaCode || !$sourceType) |
100 | { | 125 | { |
101 | break; | 126 | break; |
102 | } | 127 | } |
@@ -108,7 +133,7 @@ class BindController extends AbstractAction | @@ -108,7 +133,7 @@ class BindController extends AbstractAction | ||
108 | } | 133 | } |
109 | if ($res['code'] == 200) | 134 | if ($res['code'] == 200) |
110 | { | 135 | { |
111 | - $next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickName' => $nickName, 'areaCode' => $area, 'mobile' => $mobile)); | 136 | + $next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname, 'areaCode' => $areaCode, 'mobile' => $mobile)); |
112 | $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('is_register' => $res['data']['is_register'], 'next' => $next)); | 137 | $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('is_register' => $res['data']['is_register'], 'next' => $next)); |
113 | } | 138 | } |
114 | else | 139 | else |
@@ -135,13 +160,14 @@ class BindController extends AbstractAction | @@ -135,13 +160,14 @@ class BindController extends AbstractAction | ||
135 | } | 160 | } |
136 | 161 | ||
137 | $mobile = $this->post('mobile'); | 162 | $mobile = $this->post('mobile'); |
163 | + $areaCode = $this->post('areaCode'); | ||
138 | 164 | ||
139 | if (!is_numeric($mobile)) | 165 | if (!is_numeric($mobile)) |
140 | { | 166 | { |
141 | break; | 167 | break; |
142 | } | 168 | } |
143 | 169 | ||
144 | - $data = BindData::sendBindMsg($mobile); | 170 | + $data = BindData::sendBindMsg($areaCode,$mobile); |
145 | if (!isset($data['code'])) | 171 | if (!isset($data['code'])) |
146 | { | 172 | { |
147 | break; | 173 | break; |
@@ -167,13 +193,14 @@ class BindController extends AbstractAction | @@ -167,13 +193,14 @@ class BindController extends AbstractAction | ||
167 | 193 | ||
168 | $mobile = $this->post('mobile'); | 194 | $mobile = $this->post('mobile'); |
169 | $msgCode = $this->post('msgCode'); | 195 | $msgCode = $this->post('msgCode'); |
196 | + $areaCode = $this->post('areaCode'); | ||
170 | 197 | ||
171 | if (!is_numeric($mobile) || !$msgCode) | 198 | if (!is_numeric($mobile) || !$msgCode) |
172 | { | 199 | { |
173 | break; | 200 | break; |
174 | } | 201 | } |
175 | 202 | ||
176 | - $data = BindData::checkBindCode($mobile, $msgCode); | 203 | + $data = BindData::checkBindCode($areaCode,$mobile, $msgCode); |
177 | if (!isset($data['code'])) | 204 | if (!isset($data['code'])) |
178 | { | 205 | { |
179 | break; | 206 | break; |
@@ -199,17 +226,17 @@ class BindController extends AbstractAction | @@ -199,17 +226,17 @@ class BindController extends AbstractAction | ||
199 | 226 | ||
200 | $mobile = $this->post('mobile'); | 227 | $mobile = $this->post('mobile'); |
201 | $openId = $this->post('openId'); | 228 | $openId = $this->post('openId'); |
202 | - $area = $this->post('areaCode', '86'); | 229 | + $areaCode = $this->post('areaCode', '86'); |
203 | $sourceType = $this->post('sourceType'); | 230 | $sourceType = $this->post('sourceType'); |
204 | - $nickName = $this->post('nickName'); | 231 | + $nickname = $this->post('nickname'); |
205 | $password = $this->post('password'); | 232 | $password = $this->post('password'); |
206 | 233 | ||
207 | - if (!is_numeric($mobile) || !$openId || !$sourceType || !$area) | 234 | + if (!is_numeric($mobile) || !$openId || !$sourceType || !$areaCode) |
208 | { | 235 | { |
209 | break; | 236 | break; |
210 | } | 237 | } |
211 | 238 | ||
212 | - $res = BindData::bindMobile($openId, $nickName, $sourceType, $mobile, $area, $password); | 239 | + $res = BindData::bindMobile($openId, $nickname, $sourceType, $mobile, $areaCode, $password); |
213 | if (!isset($res['code'])) | 240 | if (!isset($res['code'])) |
214 | { | 241 | { |
215 | break; | 242 | break; |
-
Please register or login to post a comment