Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
5 changed files
with
37 additions
and
15 deletions
@@ -21,6 +21,7 @@ var $addressForm = $('.edit-address'), | @@ -21,6 +21,7 @@ var $addressForm = $('.edit-address'), | ||
21 | isSubmiting, | 21 | isSubmiting, |
22 | currentPage = 'edit', | 22 | currentPage = 'edit', |
23 | newArea = [], | 23 | newArea = [], |
24 | + chinaAddressList, | ||
24 | queryString = $.queryString(); | 25 | queryString = $.queryString(); |
25 | 26 | ||
26 | $($editAddressPage, $addressListPage).css('min-height', function() { | 27 | $($editAddressPage, $addressListPage).css('min-height', function() { |
@@ -118,12 +119,7 @@ $submit.on('touchend', function() { | @@ -118,12 +119,7 @@ $submit.on('touchend', function() { | ||
118 | $(this).removeClass('highlight'); | 119 | $(this).removeClass('highlight'); |
119 | }); | 120 | }); |
120 | 121 | ||
121 | -// 省市区列表异步加载 | ||
122 | -$.ajax({ | ||
123 | - method: 'GET', | ||
124 | - url: '/home/locationList', | ||
125 | - timeout: 60000 | ||
126 | -}).then(function(html) { | 122 | +function bindAddressListEvent(html) { |
127 | $addressListPage.html(html); | 123 | $addressListPage.html(html); |
128 | 124 | ||
129 | // 省市区 | 125 | // 省市区 |
@@ -185,6 +181,27 @@ $.ajax({ | @@ -185,6 +181,27 @@ $.ajax({ | ||
185 | }).on('touchend touchcancel', 'li', function() { | 181 | }).on('touchend touchcancel', 'li', function() { |
186 | $(this).removeClass('highlight'); | 182 | $(this).removeClass('highlight'); |
187 | }); | 183 | }); |
188 | -}).fail(function() { | ||
189 | - tip.show('获取省市区列表失败'); | ||
190 | -}); | 184 | +} |
185 | + | ||
186 | +// 读取省市区列表缓存 | ||
187 | +if (window.localStorage && window.localStorage.getItem) { | ||
188 | + chinaAddressList = window.localStorage.getItem('chinaAddressList'); | ||
189 | +} | ||
190 | +if (chinaAddressList) { | ||
191 | + bindAddressListEvent(chinaAddressList); | ||
192 | +} else { | ||
193 | + | ||
194 | + // 省市区列表异步加载 | ||
195 | + $.ajax({ | ||
196 | + method: 'GET', | ||
197 | + url: '/home/locationList', | ||
198 | + timeout: 60000 | ||
199 | + }).then(function(html) { | ||
200 | + bindAddressListEvent(html); | ||
201 | + if (window.localStorage && window.localStorage.setItem) { | ||
202 | + window.localStorage.setItem('chinaAddressList', html); | ||
203 | + } | ||
204 | + }).fail(function() { | ||
205 | + tip.show('获取省市区列表失败'); | ||
206 | + }); | ||
207 | +} |
@@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
15 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script> | 15 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script> |
16 | <link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> | 16 | <link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> |
17 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script> | 17 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script> |
18 | + <link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" /> | ||
18 | <![endif]--> | 19 | <![endif]--> |
19 | {{/if}} | 20 | {{/if}} |
20 | {{#if preEnv}} | 21 | {{#if preEnv}} |
@@ -23,6 +24,7 @@ | @@ -23,6 +24,7 @@ | ||
23 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script> | 24 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script> |
24 | <link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> | 25 | <link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> |
25 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script> | 26 | <script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script> |
27 | + <link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" /> | ||
26 | <![endif]--> | 28 | <![endif]--> |
27 | {{/if}} | 29 | {{/if}} |
28 | {{#if testEnv}} | 30 | {{#if testEnv}} |
@@ -31,6 +33,7 @@ | @@ -31,6 +33,7 @@ | ||
31 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.min.js"></script> | 33 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.min.js"></script> |
32 | <link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> | 34 | <link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> |
33 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.js"></script> | 35 | <script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.js"></script> |
36 | + <link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" /> | ||
34 | <![endif]--> | 37 | <![endif]--> |
35 | {{/if}} | 38 | {{/if}} |
36 | {{#if devEnv}} | 39 | {{#if devEnv}} |
@@ -39,11 +42,9 @@ | @@ -39,11 +42,9 @@ | ||
39 | <script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.min.js"></script> | 42 | <script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.min.js"></script> |
40 | <link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> | 43 | <link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" /> |
41 | <script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.js"></script> | 44 | <script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.js"></script> |
45 | + <link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" /> | ||
42 | <![endif]--> | 46 | <![endif]--> |
43 | {{/if}} | 47 | {{/if}} |
44 | - <!--[if lt IE 9]> | ||
45 | - <link href="proxy/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" /> | ||
46 | - <![endif]--> | ||
47 | </head> | 48 | </head> |
48 | <body> | 49 | <body> |
49 | {{> layout/page-header}} | 50 | {{> layout/page-header}} |
@@ -80,9 +80,9 @@ class CommonController extends WebAction | @@ -80,9 +80,9 @@ class CommonController extends WebAction | ||
80 | public function getbannerAction() | 80 | public function getbannerAction() |
81 | { | 81 | { |
82 | $url = 'http://service.api.yohobuy.com/operations/api/v4/resource/get?'; | 82 | $url = 'http://service.api.yohobuy.com/operations/api/v4/resource/get?'; |
83 | - $content_code = $this->_get('content_code', ''); | ||
84 | - $client_type = $this->_get('client_type', 'web'); | ||
85 | - $callback = $this->_get('callback', ''); | 83 | + $content_code = $this->get('content_code', ''); |
84 | + $client_type = $this->get('client_type', 'web'); | ||
85 | + $callback = $this->get('callback', ''); | ||
86 | $params = array( | 86 | $params = array( |
87 | 'content_code' => $content_code, | 87 | 'content_code' => $content_code, |
88 | 'client_type' => $client_type | 88 | 'client_type' => $client_type |
@@ -3,6 +3,7 @@ use Action\WebAction; | @@ -3,6 +3,7 @@ use Action\WebAction; | ||
3 | use LibModels\Web\Passport\RegData; | 3 | use LibModels\Web\Passport\RegData; |
4 | use Passport\PassportModel; | 4 | use Passport\PassportModel; |
5 | use Plugin\Helpers; | 5 | use Plugin\Helpers; |
6 | +use LibModels\Wap\Passport\BackData; | ||
6 | 7 | ||
7 | class BackController extends WebAction | 8 | class BackController extends WebAction |
8 | { | 9 | { |
@@ -37,12 +38,15 @@ class BackController extends WebAction | @@ -37,12 +38,15 @@ class BackController extends WebAction | ||
37 | public function emailAction() | 38 | public function emailAction() |
38 | { | 39 | { |
39 | $phoneNum = $this->post('phoneNum',''); | 40 | $phoneNum = $this->post('phoneNum',''); |
41 | + $area = $this->post('area','86'); | ||
40 | $captcha = $this->post('captcha',''); | 42 | $captcha = $this->post('captcha',''); |
41 | if(Helpers::verifyEmail($phoneNum)){ //验证邮箱 | 43 | if(Helpers::verifyEmail($phoneNum)){ //验证邮箱 |
42 | $email = $phoneNum; | 44 | $email = $phoneNum; |
45 | + BackData::sendCodeToEmail($email); | ||
43 | $this->redirect('sendemail'); | 46 | $this->redirect('sendemail'); |
44 | } else if(Helpers::verifyMobile($phoneNum)) {//验证手机号 | 47 | } else if(Helpers::verifyMobile($phoneNum)) {//验证手机号 |
45 | $mobile = $phoneNum; | 48 | $mobile = $phoneNum; |
49 | + BackData::sendCodeToMobile($mobile); | ||
46 | $this->redirect('verification'); | 50 | $this->redirect('verification'); |
47 | } | 51 | } |
48 | } | 52 | } |
-
Please register or login to post a comment