...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
*/
|
|
|
var $ = require('yoho-jquery');
|
|
|
var phoneRegx = require('../common/mail-phone-regx').phoneRegx;
|
|
|
var Captcha = require('../../plugins/captcha');
|
|
|
|
|
|
var nopermissionoption = $('#nopermissionmessage').html(); // 倒计时dom
|
|
|
var sendmessagehtml = $('.validatewrapper').html(); // 发送短信dom
|
...
|
...
|
@@ -17,6 +18,8 @@ var $wrapper = $('.bindwrapper'), |
|
|
$phoneTip = $wrapper.find('.phone-err-tip'),
|
|
|
$nextBtn = $wrapper.find('.yohobindbtn');
|
|
|
|
|
|
var captcha = new Captcha('#captcha', {checkURI: '/passport/thirdlogin/checkCaptcha'}).init();
|
|
|
|
|
|
require('../../simple-header');
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -229,6 +232,7 @@ function sendMessageValidate() { |
|
|
return;
|
|
|
}
|
|
|
circleTime($('#mobile').val());
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/passport/autouserinfo/sendBindMsg',
|
...
|
...
|
@@ -323,76 +327,77 @@ function nextStep() { |
|
|
}
|
|
|
openId = $('#openId').val() || '29803EC6D4AAC3AAB8ABDB6AE829D579';
|
|
|
sourceType = $('#sourceType').val() || 'qq';
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: '/passport/autouserinfo/bindCheck',
|
|
|
data: {
|
|
|
mobile: mobile,
|
|
|
area: areaCode,
|
|
|
openId: openId,
|
|
|
sourceType: sourceType
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
var winHeight = $(window).height();
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
$('#bindmobileform').attr('action', data.data.next);
|
|
|
$('#bindmobileform').submit();
|
|
|
} else if (data.code === 201) {
|
|
|
|
|
|
// 已注册 未绑定
|
|
|
username = data.data.user.username;
|
|
|
headImg = data.data.user.headImg;
|
|
|
$('#registphone').text(mobile);
|
|
|
$('#username').text(username);
|
|
|
if (headImg === '') {
|
|
|
$('#userphoto').attr('src', 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/' +
|
|
|
'01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100');
|
|
|
} else {
|
|
|
$('#userphoto').attr('src', headImg);
|
|
|
}
|
|
|
$('#logindirectly2').attr('href', data.data.user.bindLogin);
|
|
|
$('.backdrop').show();
|
|
|
$('#sendmessage').click();
|
|
|
$('#alreayregist .mask').css({
|
|
|
'padding-top': winHeight > 440 ? winHeight / 2 : 217
|
|
|
});
|
|
|
$('#alreayregist').show();
|
|
|
} else if (data.code === 203) {
|
|
|
|
|
|
// 已注册 可关联
|
|
|
$('#bindmobileform').attr('action', data.data.next);
|
|
|
$('#bindmobileform').submit();
|
|
|
} else if (data.code === 205) {
|
|
|
|
|
|
// 未注册 不可关联
|
|
|
username = data.data.user.username;
|
|
|
headImg = data.data.user.headImg;
|
|
|
$('#registphonetwo').text(mobile);
|
|
|
$('#username1').text(username);
|
|
|
if (headImg === '') {
|
|
|
$('#userphoto1').attr('src', 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/' +
|
|
|
'01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100');
|
|
|
|
|
|
captcha.check().then(function() {
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: '/passport/autouserinfo/bindCheck',
|
|
|
data: {
|
|
|
mobile: mobile,
|
|
|
area: areaCode,
|
|
|
openId: openId,
|
|
|
sourceType: sourceType
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
var winHeight = $(window).height();
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
$('#bindmobileform').attr('action', data.data.next);
|
|
|
$('#bindmobileform').submit();
|
|
|
} else if (data.code === 201) {
|
|
|
|
|
|
// 已注册 未绑定
|
|
|
username = data.data.user.username;
|
|
|
headImg = data.data.user.headImg;
|
|
|
$('#registphone').text(mobile);
|
|
|
$('#username').text(username);
|
|
|
if (headImg === '') {
|
|
|
$('#userphoto').attr('src', 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/' +
|
|
|
'01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100');
|
|
|
} else {
|
|
|
$('#userphoto').attr('src', headImg);
|
|
|
}
|
|
|
$('#logindirectly2').attr('href', data.data.user.bindLogin);
|
|
|
$('.backdrop').show();
|
|
|
$('#sendmessage').click();
|
|
|
$('#alreayregist .mask').css({
|
|
|
'padding-top': winHeight > 440 ? winHeight / 2 : 217
|
|
|
});
|
|
|
$('#alreayregist').show();
|
|
|
} else if (data.code === 203) {
|
|
|
// 已注册 可关联
|
|
|
$('#bindmobileform').attr('action', data.data.next);
|
|
|
$('#bindmobileform').submit();
|
|
|
} else if (data.code === 205) {
|
|
|
// 未注册 不可关联
|
|
|
username = data.data.user.username;
|
|
|
headImg = data.data.user.headImg;
|
|
|
$('#registphonetwo').text(mobile);
|
|
|
$('#username1').text(username);
|
|
|
if (headImg === '') {
|
|
|
$('#userphoto1').attr('src', 'http://img10.static.yhbimg.com/headimg/2013/11/28/09/' +
|
|
|
'01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100');
|
|
|
} else {
|
|
|
$('#userphoto1').attr('src', headImg);
|
|
|
}
|
|
|
$('#logindirectly').attr('href', data.data.user.bindLogin);
|
|
|
$('.backdrop').show();
|
|
|
$('#bindconfirm .mask').css({
|
|
|
'padding-top': winHeight > 440 ? winHeight / 2 : 217
|
|
|
});
|
|
|
$('#bindconfirm').show();
|
|
|
} else if (data.code === 402) {
|
|
|
$phoneTip.find('em').text('手机格式错误');
|
|
|
$phoneTip.removeClass('hide');
|
|
|
} else {
|
|
|
$('#userphoto1').attr('src', headImg);
|
|
|
if (data && data.message) {
|
|
|
alert(data.message); // eslint-disable-line
|
|
|
}
|
|
|
}
|
|
|
$('#logindirectly').attr('href', data.data.user.bindLogin);
|
|
|
$('.backdrop').show();
|
|
|
$('#bindconfirm .mask').css({
|
|
|
'padding-top': winHeight > 440 ? winHeight / 2 : 217
|
|
|
});
|
|
|
$('#bindconfirm').show();
|
|
|
} else if (data.code === 402) {
|
|
|
$phoneTip.find('em').text('手机格式错误');
|
|
|
$phoneTip.removeClass('hide');
|
|
|
} else {
|
|
|
if (data && data.message) {
|
|
|
alert(data.message); // eslint-disable-line
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|