Authored by htoooth

fix

@@ -139,10 +139,11 @@ const cert = { @@ -139,10 +139,11 @@ const cert = {
139 139
140 if (_.get(result, 'data.isCanBind') === 'Y') { 140 if (_.get(result, 'data.isCanBind') === 'Y') {
141 nextUrl = helpers.urlFormat('/passport/cert/cert'); 141 nextUrl = helpers.urlFormat('/passport/cert/cert');
  142 + return {code: 200, message: result.message, data: {next: nextUrl}};
142 } else { 143 } else {
143 - nextUrl = helpers.urlFormat('/passport/cert/relate'); 144 + // 不可以关联
  145 + return {code: 403, message: '绑定失败,该手机号已注册,请更换或使用该手机号直接登录'};
144 } 146 }
145 - return {code: 200, message: result.message, data: {next: nextUrl}};  
146 } else { 147 } else {
147 return {code: result.code, message: result.message, data: result.data ? result.data : ''}; 148 return {code: result.code, message: result.message, data: result.data ? result.data : ''};
148 } 149 }
@@ -21,6 +21,8 @@ var $wrapper = $('.bindwrapper'), @@ -21,6 +21,8 @@ var $wrapper = $('.bindwrapper'),
21 var captcha = new Captcha('#captcha').init(); 21 var captcha = new Captcha('#captcha').init();
22 var captcha2; 22 var captcha2;
23 23
  24 +var Alert = require('../../plugins/dialog').Alert;
  25 +
24 require('../../simple-header'); 26 require('../../simple-header');
25 27
26 /** 28 /**
@@ -196,12 +198,6 @@ function yohoBindBtn() { @@ -196,12 +198,6 @@ function yohoBindBtn() {
196 $('#alreayregist').hide(); 198 $('#alreayregist').hide();
197 $('.backdrop').hide(); 199 $('.backdrop').hide();
198 }); 200 });
199 -  
200 - $(document).on('click', '#yohobindbtn3', function() {  
201 - $('.phonenum').val('');  
202 - $('#norelate').hide();  
203 - $('.backdrop').hide();  
204 - });  
205 } 201 }
206 202
207 /** 203 /**
@@ -387,21 +383,7 @@ function nextStep() { @@ -387,21 +383,7 @@ function nextStep() {
387 circleTime($('#mobile').val()); 383 circleTime($('#mobile').val());
388 } else if (data.code === 203) { 384 } else if (data.code === 203) {
389 // 已注册 可关联 385 // 已注册 可关联
390 -  
391 - $('#registphone-relate').text(mobile);  
392 - $('#username-relate').text(username);  
393 - if (headImg === '') {  
394 - $('#userphoto-relate').attr('src', 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/' +  
395 - '01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100');  
396 - } else {  
397 - $('#userphoto-relate').attr('src', headImg);  
398 - }  
399 -  
400 - $('#norelate .mask').css({  
401 - 'padding-top': winHeight > 440 ? winHeight / 2 : 217  
402 - });  
403 - $('#norelate').show();  
404 - 386 + new Alert('绑定失败,该手机号已注册,请更换或使用该手机号直接登录').show();
405 } else if (data.code === 205) { 387 } else if (data.code === 205) {
406 // 未注册 不可关联 388 // 未注册 不可关联
407 username = data.data.user.username; 389 username = data.data.user.username;
@@ -11,6 +11,8 @@ var $wrapper = $('.bindwrapper'), @@ -11,6 +11,8 @@ var $wrapper = $('.bindwrapper'),
11 $phoneTip = $wrapper.find('.phone-err-tip'), 11 $phoneTip = $wrapper.find('.phone-err-tip'),
12 $nextBtn = $wrapper.find('.yohobindbtn'); 12 $nextBtn = $wrapper.find('.yohobindbtn');
13 13
  14 +var Alert = require('../../plugins/dialog').Alert;
  15 +
14 require('../../simple-header'); 16 require('../../simple-header');
15 17
16 /** 18 /**
@@ -151,7 +153,7 @@ function nextStep() { @@ -151,7 +153,7 @@ function nextStep() {
151 $phoneTip.removeClass('hide'); 153 $phoneTip.removeClass('hide');
152 } else { 154 } else {
153 if (data && data.message) { 155 if (data && data.message) {
154 - alert(data.message); // eslint-disable-line 156 + new Alert(data.message).show();
155 } 157 }
156 } 158 }
157 } 159 }