Authored by 毕凯

增加关联手机功能

@@ -105,6 +105,16 @@ $btnNext.on('touchstart', function() { @@ -105,6 +105,16 @@ $btnNext.on('touchstart', function() {
105 if (res.code === 200) { 105 if (res.code === 200) {
106 if (res.data.isReg === 1) { 106 if (res.data.isReg === 1) {
107 dialog.showDialog({ 107 dialog.showDialog({
  108 + dialogText: '该手机号已注册过有货\n' + pn + ',确定绑定吗?',
  109 + hasFooter: {
  110 + leftBtnText: '更换号码',
  111 + rightBtnText: '继续绑定'
  112 + }
  113 + }, function() {
  114 + nextStep(res.data.next, pn, areaCode);
  115 + });
  116 + } else if (res.data.isReg === 3) {
  117 + dialog.showDialog({
108 dialogText: '该手机号已注册过有货\n' + pn + ',是否进行关联?', 118 dialogText: '该手机号已注册过有货\n' + pn + ',是否进行关联?',
109 hasFooter: { 119 hasFooter: {
110 leftBtnText: '更换号码', 120 leftBtnText: '更换号码',
  1 +/**
  2 + * 关联手机号-验证码
  3 + */
  4 +
  5 +require('../code')(true, false);
@@ -26,7 +26,7 @@ module.exports = function(useInRegister, useForBind) { @@ -26,7 +26,7 @@ module.exports = function(useInRegister, useForBind) {
26 26
27 function startBind() { 27 function startBind() {
28 $.ajax({ 28 $.ajax({
29 - url: '/passport/bind/bindMobile', 29 + url: useForBind ? '/passport/bind/bindMobile' : '/passport/bind/relateMobile',
30 type: 'post', 30 type: 'post',
31 data: { 31 data: {
32 areaCode: areaCode.replace('+', ''), 32 areaCode: areaCode.replace('+', ''),
@@ -34,7 +34,8 @@ module.exports = function(useInRegister, useForBind) { @@ -34,7 +34,8 @@ module.exports = function(useInRegister, useForBind) {
34 openId: openId, 34 openId: openId,
35 sourceType: sourceType, 35 sourceType: sourceType,
36 nickname: nickname, 36 nickname: nickname,
37 - password: '' 37 + password: '',
  38 + code: trim($captcha.val())
38 }, 39 },
39 success: function(res) { 40 success: function(res) {
40 if (res.code === 200) { 41 if (res.code === 200) {
@@ -24,3 +24,6 @@ require('./back/new-password'); @@ -24,3 +24,6 @@ require('./back/new-password');
24 require('./bind/bind'); 24 require('./bind/bind');
25 require('./bind/code'); 25 require('./bind/code');
26 require('./bind/password'); 26 require('./bind/password');
  27 +
  28 +// 关联手机
  29 +require('./bind/relate');
@@ -63,6 +63,11 @@ @@ -63,6 +63,11 @@
63 seajs.use('js/passport/bind/code'); 63 seajs.use('js/passport/bind/code');
64 </script> 64 </script>
65 {{/if}} 65 {{/if}}
  66 +{{#if relateCode}}
  67 +<script>
  68 + seajs.use('js/passport/bind/relate');
  69 +</script>
  70 +{{/if}}
66 {{#if bindPwd}} 71 {{#if bindPwd}}
67 <script> 72 <script>
68 seajs.use('js/passport/bind/password'); 73 seajs.use('js/passport/bind/password');
@@ -340,4 +345,3 @@ @@ -340,4 +345,3 @@
340 seajs.use('js/me/currency-new'); 345 seajs.use('js/me/currency-new');
341 </script> 346 </script>
342 {{/if}} 347 {{/if}}
343 -  
@@ -59,6 +59,7 @@ class BindController extends AbstractAction @@ -59,6 +59,7 @@ class BindController extends AbstractAction
59 59
60 $data = array( 60 $data = array(
61 'bindCode' => true, //js标识 61 'bindCode' => true, //js标识
  62 + 'relateCode' => true, // 是否是关联手机
62 'backUrl' => Helpers::url('/signin.html'), // 返回的URL链接 63 'backUrl' => Helpers::url('/signin.html'), // 返回的URL链接
63 'showHeaderImg' => true, // 控制显示头部图片 64 'showHeaderImg' => true, // 控制显示头部图片
64 'isPassportPage' => true, // 模板中模块标识 65 'isPassportPage' => true, // 模板中模块标识