Authored by wangqing

提交第三方登录

... ... @@ -4,8 +4,12 @@
欢迎加入
<span class="yoho">YOHO!FAMILY</span>
</h3>
<p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
<form action="" id="bindmobileform">
<form action="" id="bindmobileform" method="post">
<input type="hidden" value="{{openId}}" id="openId" name="openId"/>
<input type="hidden" value="{{sourceType}}" id="sourceType" name="sourceType"/>
<input type="hidden" value="+86" id="areacode" name="area"/>
<div class="yohobindrow">
<div class="name areatag">地区</div>
<div class="content">
... ... @@ -15,9 +19,11 @@
<span class="righttag"></span>
</div>
<div class="optionslist hide">
<div class="optionitem" areanum="+88">中国香港</div>
<div class="optionitem" areanum="+87">中国台湾</div>
<div class="optionitem" areanum="+86">中国</div>
{{#each region}}
<div class="optionitem" areanum="{{areaCode}}">{{name}}
</div>
{{/each}}
</div>
</div>
</div>
... ... @@ -27,7 +33,7 @@
<div class="content">
<div class="yohophonewrapper">
<div class="areanum" id="areanum">+86</div>
<input type="text" class="phonenum" />
<input type="text" class="phonenum" name="mobile"/>
</div>
</div>
</div>
... ...
{{> layout/simple-header}}
<div class="bindwrapper">
<h3 class="welcomeword">
欢迎加入
<span class="yoho">YOHO!FAMILY</span>
</h3>
<p class="safeword">为了您的账户安全,请您完善账户信息,以便为您提供更优质的服务</p>
<p class="sendnotify novisiable">验证码已发送至<span class="sendphone">{{mobile}}</span></p>
<div class="validaterow">
<div class="name phonetag">短信验证码</div>
<div class="content">
<div class="yohophonewrapper">
<input type="text" class="phonenum" value="" />
</div>
</div>
<div class="validatewrapper">
<a href="javascript:void(0)" class="yohobindbtn disabled" id="sendmessage" disabled="disabled">免费获取短信验证码</a>
</div>
<div class="hide" id="nopermissionmessage">
<span class="second">60</span>秒后可重新操作
</div>
</div>
<div class="setpwdcontent">
<div class="yohobindrow setpwdwrapper">
<div class="name setpwdtag">设置密码</div>
<div class="content">
<div class="yohophonewrapper">
<input type="password" class="phonenum pwdcontent" maxlength="20" id="pwd"/>
<div id="pwd-tips" class="pwd-tips hide">
<div class="yes" id="pwd-tip1">密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2">建议由字母、 数字、 符号两种以上组合</div>
</div>
</div>
</div>
</div>
<div class="safelevel clearfix">
安全程度: &nbsp; <span class="low pwd-intensity">低</span><span class="mid pwd-intensity">中</span><span class="high pwd-intensity">高</span>
</div>
</div>
<div class="btnwrapper confirmwrapper">
<a href="javascript:void(0)" class="yohobindbtn" >确定</a>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -113,6 +113,12 @@
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 第三方绑定--}}
{{#if thirdLogin}}
<script>
seajs.use('js/passport/thirdlogin');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
... ...
... ... @@ -1323,10 +1323,14 @@ function actionLoopUpdCartNum() {
* @return {[type]} [description]
*/
function actionExeTemplate() {
var resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
$('#goodcartempwarpper').html(resulthtml);
vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
var $goodcartempwarpper = $('#goodcartempwarpper');
var resulthtml = '';
if ($goodcartempwarpper && $goodcartempwarpper.html()) {
resulthtml = $('#goodcartempwarpper').html().replace(/\\/g, '');
$('#goodcartempwarpper').html(resulthtml);
vipInfoCombine = handlebars.compile($('#tmpl-my-login-new').html());
}
}
/**
* 执行搜索
... ...
... ... @@ -6,4 +6,5 @@ require('./reg');
require('./back');
require('./login');
require('./reset');
require('./vertification');
\ No newline at end of file
require('./vertification');
require('./thirdlogin');
\ No newline at end of file
... ...
/**
* 登录
* @author: wq
* @date: 2016/1/21
*/
var $ = require('yoho.jquery');
function chooseProtocol() {
$('.choosetag').on('change', function() {
if ($(this).attr('checked')) {
$('.choosewrapper').css({
'background-image': 'url("http://webstatic.dev.yohobuy.com/img/passport/choosed.png")'
});
} else {
$('.choosewrapper').css({
'background-image': 'none'
});
}
})
}
function chooseAreaToogle() {
$('.optionshow').on('click', function() {
$('.optionslist').toggleClass('hide');
});
}
function cancelChooseArea() {
$(document).on('click', 'body', function(e) {
var $target = $(e.target);
if ($target.hasClass('yohoselectarea') || $target.hasClass('yohoselectarea') || $target.hasClass('areaname') || $target.hasClass('righttag') || $target.hasClass('optionslist') || $target.hasClass('optionitem')) {
return;
} else {
$('.optionslist').addClass('hide');
}
})
}
function chooseArea() {
$('.optionitem').on('click', function() {
var $option = $(this);
var areanum = $option.attr('areanum');
var areaname = $option.text();
$('#areaname').text(areaname);
$('#areanum').text(areanum);
$('#areacode').val(areanum);
$('.optionslist').addClass('hide');
})
}
function isagree() {
return $('.choosetag').attr('checked');
}
function nextStep() {
var openId = '';
var sourceType = '';
var mobile = '';
var areaCode = '';
$('#bindfirststep').on('click', function(e) {
e.preventDefault();
mobile = $('.phonenum').val();
areaCode = $('.areanum').text();
if (mobile === '') {
alert('手机号码不能为空');
return;
}
if (!isagree()) {
alert('请先同意我们的协议');
return;
}
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) {
if (data.code === 200) {
if (data.data.isReg === 0) {
$('#bindmobileform').attr('action','/passport/thirdlogin/noregist');
$('#bindmobileform').submit();
} else {
}
} else {
alert(data.message);
}
}
});
})
}
function init() {
chooseProtocol();
chooseArea();
chooseAreaToogle();
cancelChooseArea();
nextStep();
}
init();
\ No newline at end of file
... ...
... ... @@ -40,4 +40,11 @@ class ThirdloginController extends WebAction
$this->_view->display('index', $data);
}
public function noregistAction()
{
$mobile = trim($this->post('mobile'));
$data = array('mobile' => $mobile);
$this->_view->display('noregist', $data);
}
}
... ...