Showing
9 changed files
with
41 additions
and
11 deletions
@@ -115,6 +115,7 @@ let verifyMobile = (req, res, next) => { | @@ -115,6 +115,7 @@ let verifyMobile = (req, res, next) => { | ||
115 | 115 | ||
116 | let mobile = +req.body.phoneNum; | 116 | let mobile = +req.body.phoneNum; |
117 | let area = +(req.body.areaCode || 86); | 117 | let area = +(req.body.areaCode || 86); |
118 | + let inviteCode = +req.body.inviteCode || ''; | ||
118 | 119 | ||
119 | // 判断参数是否合法 | 120 | // 判断参数是否合法 |
120 | if (!_.isNumber(mobile) || !_.isNumber(area)) { | 121 | if (!_.isNumber(mobile) || !_.isNumber(area)) { |
@@ -153,7 +154,8 @@ let verifyMobile = (req, res, next) => { | @@ -153,7 +154,8 @@ let verifyMobile = (req, res, next) => { | ||
153 | result.data = helpers.urlFormat('/passport/reg/code', { | 154 | result.data = helpers.urlFormat('/passport/reg/code', { |
154 | token: token, | 155 | token: token, |
155 | phoneNum: mobile, | 156 | phoneNum: mobile, |
156 | - areaCode: area | 157 | + areaCode: area, |
158 | + inviteCode: inviteCode | ||
157 | }); | 159 | }); |
158 | } | 160 | } |
159 | 161 | ||
@@ -169,6 +171,7 @@ let codeAction = (req, res, next) => { | @@ -169,6 +171,7 @@ let codeAction = (req, res, next) => { | ||
169 | let token = req.query.token; | 171 | let token = req.query.token; |
170 | let mobile = +req.query.phoneNum; | 172 | let mobile = +req.query.phoneNum; |
171 | let area = +(req.query.areaCode || 86); | 173 | let area = +(req.query.areaCode || 86); |
174 | + let inviteCode = +req.query.inviteCode || ''; | ||
172 | 175 | ||
173 | // 判断是否允许访问, 不允许则跳转到错误页面 | 176 | // 判断是否允许访问, 不允许则跳转到错误页面 |
174 | if (!_.isString(token) || !_.isNumber(mobile) || !sign.verifyToken(mobile, token)) { | 177 | if (!_.isString(token) || !_.isNumber(mobile) || !sign.verifyToken(mobile, token)) { |
@@ -190,6 +193,7 @@ let codeAction = (req, res, next) => { | @@ -190,6 +193,7 @@ let codeAction = (req, res, next) => { | ||
190 | areaCode: area, // 默认的区号 | 193 | areaCode: area, // 默认的区号 |
191 | phoneNum: mobile, // 手机号 | 194 | phoneNum: mobile, // 手机号 |
192 | token: token, // 访问令牌 | 195 | token: token, // 访问令牌 |
196 | + inviteCode: inviteCode, | ||
193 | serviceUrl: serviceUrl // 在线客服 | 197 | serviceUrl: serviceUrl // 在线客服 |
194 | }); | 198 | }); |
195 | }; | 199 | }; |
@@ -275,6 +279,7 @@ let verifyCode = (req, res, next) => { | @@ -275,6 +279,7 @@ let verifyCode = (req, res, next) => { | ||
275 | let mobile = +req.body.phoneNum; | 279 | let mobile = +req.body.phoneNum; |
276 | let area = +(req.body.areaCode || 86); | 280 | let area = +(req.body.areaCode || 86); |
277 | let code = +req.body.code; | 281 | let code = +req.body.code; |
282 | + let inviteCode = +req.body.inviteCode || ''; | ||
278 | 283 | ||
279 | /* 判断参数是否合法 */ | 284 | /* 判断参数是否合法 */ |
280 | if (!_.isNumber(mobile) || !_.isNumber(area) || !_.isNumber(code)) { | 285 | if (!_.isNumber(mobile) || !_.isNumber(area) || !_.isNumber(code)) { |
@@ -306,7 +311,8 @@ let verifyCode = (req, res, next) => { | @@ -306,7 +311,8 @@ let verifyCode = (req, res, next) => { | ||
306 | token: token, | 311 | token: token, |
307 | phoneNum: mobile, | 312 | phoneNum: mobile, |
308 | areaCode: area, | 313 | areaCode: area, |
309 | - smsCode: code | 314 | + smsCode: code, |
315 | + inviteCode: inviteCode | ||
310 | }); | 316 | }); |
311 | break; | 317 | break; |
312 | case 404: | 318 | case 404: |
@@ -326,6 +332,7 @@ let passwordAction = (req, res, next) => { | @@ -326,6 +332,7 @@ let passwordAction = (req, res, next) => { | ||
326 | let mobile = +req.query.phoneNum; | 332 | let mobile = +req.query.phoneNum; |
327 | let area = +(req.query.areaCode || 86); | 333 | let area = +(req.query.areaCode || 86); |
328 | let smsCode = +req.query.smsCode; | 334 | let smsCode = +req.query.smsCode; |
335 | + let inviteCode = +req.query.inviteCode || ''; | ||
329 | 336 | ||
330 | // 判断是否允许访问, 不允许则跳转到错误页面 | 337 | // 判断是否允许访问, 不允许则跳转到错误页面 |
331 | if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || | 338 | if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || |
@@ -345,7 +352,8 @@ let passwordAction = (req, res, next) => { | @@ -345,7 +352,8 @@ let passwordAction = (req, res, next) => { | ||
345 | areaCode: area, // 默认的区号 | 352 | areaCode: area, // 默认的区号 |
346 | phoneNum: mobile, // 手机号 | 353 | phoneNum: mobile, // 手机号 |
347 | token: token, // 访问令牌 | 354 | token: token, // 访问令牌 |
348 | - smsCode: smsCode // 手机验证码 | 355 | + smsCode: smsCode, // 手机验证码 |
356 | + inviteCode: inviteCode | ||
349 | }); | 357 | }); |
350 | }; | 358 | }; |
351 | 359 | ||
@@ -362,6 +370,7 @@ let setPassword = (req, res, next) => { | @@ -362,6 +370,7 @@ let setPassword = (req, res, next) => { | ||
362 | let token = req.body.token; | 370 | let token = req.body.token; |
363 | let smsCode = +req.body.smsCode; | 371 | let smsCode = +req.body.smsCode; |
364 | let isFromMy = _.get(req.session, 'phoneReg.isFromMy', '0'); | 372 | let isFromMy = _.get(req.session, 'phoneReg.isFromMy', '0'); |
373 | + let inviteCode = req.body.inviteCode || ''; | ||
365 | 374 | ||
366 | // 判断参数是否合法 | 375 | // 判断参数是否合法 |
367 | if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || !_.isNumber(area) || !password) { | 376 | if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || !_.isNumber(area) || !password) { |
@@ -386,7 +395,7 @@ let setPassword = (req, res, next) => { | @@ -386,7 +395,7 @@ let setPassword = (req, res, next) => { | ||
386 | // 验证注册的标识码是否有效 | 395 | // 验证注册的标识码是否有效 |
387 | let resultCopy = null; | 396 | let resultCopy = null; |
388 | 397 | ||
389 | - RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy).then((result) => { | 398 | + RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, inviteCode, isFromMy).then((result) => { |
390 | if (!result.code || result.code !== 200) { | 399 | if (!result.code || result.code !== 200) { |
391 | return res.send(result); | 400 | return res.send(result); |
392 | } | 401 | } |
@@ -96,7 +96,7 @@ const RegService = { | @@ -96,7 +96,7 @@ const RegService = { | ||
96 | 96 | ||
97 | return api.post('', params); | 97 | return api.post('', params); |
98 | }, | 98 | }, |
99 | - regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy) { | 99 | + regMobileAes(area, mobile, password, shoppingKey, smsCode, inviteCode, isFromMy) { |
100 | isFromMy = isFromMy || '0'; | 100 | isFromMy = isFromMy || '0'; |
101 | 101 | ||
102 | let params = { | 102 | let params = { |
@@ -105,6 +105,7 @@ const RegService = { | @@ -105,6 +105,7 @@ const RegService = { | ||
105 | profile: mobile, | 105 | profile: mobile, |
106 | password: aes.aesPwd(password), | 106 | password: aes.aesPwd(password), |
107 | verifyCode: smsCode, | 107 | verifyCode: smsCode, |
108 | + inviteCode: inviteCode, | ||
108 | isFromMy | 109 | isFromMy |
109 | }; | 110 | }; |
110 | 111 |
@@ -6,6 +6,10 @@ | @@ -6,6 +6,10 @@ | ||
6 | <span id="area-code" class="area-code">{{areaCode}}</span> | 6 | <span id="area-code" class="area-code">{{areaCode}}</span> |
7 | <input id="phone-num" class="input phone-num" type="text" placeholder="手机号"> | 7 | <input id="phone-num" class="input phone-num" type="text" placeholder="手机号"> |
8 | </div> | 8 | </div> |
9 | + <div class="input-container row code-container"> | ||
10 | + <span id="code" class="invite-code">邀请码</span> | ||
11 | + <input id="invite-code" class="input code" type="text"> | ||
12 | + </div> | ||
9 | 13 | ||
10 | {{!--图片验证--}} | 14 | {{!--图片验证--}} |
11 | <div data-geetest="{{useGeetest}}" id="js-img-check"></div> | 15 | <div data-geetest="{{useGeetest}}" id="js-img-check"></div> |
@@ -13,4 +17,4 @@ | @@ -13,4 +17,4 @@ | ||
13 | <span id="btn-next" class="btn btn-next disable row">下一步</span> | 17 | <span id="btn-next" class="btn btn-next disable row">下一步</span> |
14 | <p class="register-tip">Yoho!Family账号可登录Yoho!Buy有货、Yoho!Now、mars及SHOW</p> | 18 | <p class="register-tip">Yoho!Family账号可登录Yoho!Buy有货、Yoho!Now、mars及SHOW</p> |
15 | </div> | 19 | </div> |
16 | -</div> | ||
20 | +</div> |
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | <input id="area-code" type="hidden" value="{{areaCode}}"> | 17 | <input id="area-code" type="hidden" value="{{areaCode}}"> |
18 | <input id="token" type="hidden" value="{{token}}"> | 18 | <input id="token" type="hidden" value="{{token}}"> |
19 | <input id="sms-code" type="hidden" value="{{smsCode}}"> | 19 | <input id="sms-code" type="hidden" value="{{smsCode}}"> |
20 | + <input id="invite-code" type="hidden" value="{{inviteCode}}"> | ||
20 | </div> | 21 | </div> |
21 | 22 | ||
22 | <div class="prompt"> | 23 | <div class="prompt"> |
@@ -24,6 +25,6 @@ | @@ -24,6 +25,6 @@ | ||
24 | <div class="choose"> | 25 | <div class="choose"> |
25 | <span class="ensure">是</span> | 26 | <span class="ensure">是</span> |
26 | <span class="deny">否</span> | 27 | <span class="deny">否</span> |
27 | - | 28 | + |
28 | </div> | 29 | </div> |
29 | </div> | 30 | </div> |
@@ -19,4 +19,5 @@ | @@ -19,4 +19,5 @@ | ||
19 | <input id="phone-num" type="hidden" value={{phoneNum}}> | 19 | <input id="phone-num" type="hidden" value={{phoneNum}}> |
20 | <input id="area-code" type="hidden" value={{areaCode}}> | 20 | <input id="area-code" type="hidden" value={{areaCode}}> |
21 | <input id="token" type="hidden" value={{token}}> | 21 | <input id="token" type="hidden" value={{token}}> |
22 | + <input id="invite-code" type="hidden" value={{inviteCode}}> | ||
22 | </div> | 23 | </div> |
@@ -15,7 +15,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | @@ -15,7 +15,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | ||
15 | sourceType = $('#sourceType').val(), | 15 | sourceType = $('#sourceType').val(), |
16 | openId = $('#openId').val(), | 16 | openId = $('#openId').val(), |
17 | phoneNum = $('#phone-num').val(), | 17 | phoneNum = $('#phone-num').val(), |
18 | - areaCode = $('#area-code').val().replace('+', ''); | 18 | + areaCode = $('#area-code').val().replace('+', ''), |
19 | + inviteCode = $('#invite-code').val(); | ||
19 | 20 | ||
20 | let api = require('./api'); | 21 | let api = require('./api'); |
21 | let tip = require('plugin/tip'); | 22 | let tip = require('plugin/tip'); |
@@ -64,7 +65,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | @@ -64,7 +65,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | ||
64 | phoneNum: phoneNum, | 65 | phoneNum: phoneNum, |
65 | areaCode: areaCode, | 66 | areaCode: areaCode, |
66 | code: trim($captcha.val()), | 67 | code: trim($captcha.val()), |
67 | - token: $('#token').val() | 68 | + token: $('#token').val(), |
69 | + inviteCode: inviteCode | ||
68 | }, | 70 | }, |
69 | success: function(data) { | 71 | success: function(data) { |
70 | if (data.code === 200) { | 72 | if (data.code === 200) { |
@@ -74,7 +74,8 @@ function setPassword() { | @@ -74,7 +74,8 @@ function setPassword() { | ||
74 | phoneNum: $('#phone-num').val(), | 74 | phoneNum: $('#phone-num').val(), |
75 | areaCode: $('#area-code').val(), | 75 | areaCode: $('#area-code').val(), |
76 | smsCode: $('#sms-code').val(), | 76 | smsCode: $('#sms-code').val(), |
77 | - token: $('#token').val() | 77 | + token: $('#token').val(), |
78 | + inviteCode: $('#invite-code').val() | ||
78 | }, | 79 | }, |
79 | success: function(data) { | 80 | success: function(data) { |
80 | let res = data.data; | 81 | let res = data.data; |
@@ -81,7 +81,8 @@ $btnNext.on('touchstart', function() { | @@ -81,7 +81,8 @@ $btnNext.on('touchstart', function() { | ||
81 | requested = true; | 81 | requested = true; |
82 | let params = { | 82 | let params = { |
83 | areaCode: areaCode.replace('+', ''), | 83 | areaCode: areaCode.replace('+', ''), |
84 | - phoneNum: pn | 84 | + phoneNum: pn, |
85 | + inviteCode: $('#invite-code').val() | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | $.extend(params, result); | 88 | $.extend(params, result); |
@@ -150,10 +150,20 @@ body.passport-body { | @@ -150,10 +150,20 @@ body.passport-body { | ||
150 | line-height: 2.5; | 150 | line-height: 2.5; |
151 | } | 151 | } |
152 | 152 | ||
153 | + .invite-code { | ||
154 | + position: absolute; | ||
155 | + left: 15PX; | ||
156 | + line-height: 2.5; | ||
157 | + } | ||
158 | + | ||
153 | .phone-container { | 159 | .phone-container { |
154 | padding-left: 55PX; | 160 | padding-left: 55PX; |
155 | } | 161 | } |
156 | 162 | ||
163 | + .code-container { | ||
164 | + padding-left: 70PX; | ||
165 | + } | ||
166 | + | ||
157 | .input { | 167 | .input { |
158 | width: 100%; | 168 | width: 100%; |
159 | line-height: 26PX; | 169 | line-height: 26PX; |
-
Please register or login to post a comment