232 lines
7.2 KiB
PHTML
Executable File
232 lines
7.2 KiB
PHTML
Executable File
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
{include file="include/head-product" /}
|
||
<script type="text/javascript">
|
||
var navID = "1";
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<!--top End-->
|
||
|
||
<!-- 新闻详情页 s -->
|
||
<body class="bg-gray">
|
||
<!-- 注册 -->
|
||
<div class="login" style="margin-top:186px;">
|
||
<div class="swt-Container">
|
||
<div class="login_content_register">
|
||
<div class="text-c" style="margin-bottom: 2vw"><img src="/uploads/default/logo-black.png"></div>
|
||
<div class="title text-c">
|
||
<span class="accounts f_black">绑定手机</span>
|
||
</div>
|
||
<div class="content content_01">
|
||
<li class="margin-b-7">
|
||
<input type="text" onfocus="hide_err('telephone')" onblur="check_format('telephone')" id="telephone" placeholder="请输入手机号码">
|
||
<div id="err_tel"></div>
|
||
</li>
|
||
<li class="margin-b-7">
|
||
<input type="text" onfocus="hide_err('captcha1')" id="captcha1" placeholder="请输入验证码">
|
||
<button class="Obtain" onclick="get_captcha('captcha1')">获取验证码</button>
|
||
<div id="err_captcha1"></div>
|
||
</li>
|
||
</div>
|
||
|
||
<div class="tjdl">
|
||
<button class="tjbtn" onclick="third_register()">提交</button>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="text-c login_bottom">2015 ORICO Technologies Co.,Ltd 版权所有(<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030702002297" >粤ICP备15025109号-3</a>)
|
||
<p> <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030702002297" ><img src=""/>粤公网安备 44030702002297号 <img src="__PUBLIC__/web/images/orico_co_icon.png" style="vertical-align: middle;"></a></p>
|
||
</div>
|
||
|
||
<!-- 新闻详情页 e -->
|
||
</body>
|
||
</html>
|
||
<!-- 新闻详情页 e -->
|
||
|
||
<script type="text/javascript">
|
||
$(document).ready(function(){
|
||
$(".accounts").click(function(){
|
||
$(this).siblings().removeClass("blue");
|
||
$(this).addClass("blue");
|
||
$(".content_02").hide();
|
||
$(".content_01").show();
|
||
})
|
||
$(".short_letter").click(function(){
|
||
$(this).siblings().removeClass("blue");
|
||
$(this).addClass("blue");
|
||
$(".content_01").hide();
|
||
$(".content_02").show();
|
||
})
|
||
})
|
||
</script>
|
||
</body>
|
||
</html>
|
||
<script type="text/javascript">
|
||
|
||
var sendsms_flag = 1;
|
||
function get_captcha(type)
|
||
{
|
||
if (type == 'captcha1')
|
||
{
|
||
var url = '/index/customer/sendsms';
|
||
var telephone = $("#telephone").val();
|
||
var data = {
|
||
telephone: telephone
|
||
};
|
||
|
||
if (sendsms_flag == 0)
|
||
{
|
||
return;
|
||
}
|
||
|
||
if (!check_format('telephone'))
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
else if (type == 'captcha2')
|
||
{
|
||
alert('邮箱找回暂不可用');
|
||
return;
|
||
}
|
||
|
||
$.ajax({
|
||
url: url,
|
||
type: 'post',
|
||
dataType: 'json',
|
||
data: data,
|
||
success: function(data) {
|
||
if (data.code) {
|
||
//设置button效果,开始计时
|
||
curCount = 60;
|
||
$(".Obtain").attr("disabled", "true");
|
||
$(".Obtain").html("重新获取" + curCount + "秒");
|
||
InterValObj = window.setInterval(SetRemainTime, 1000);
|
||
sendsms_flag = 0;
|
||
setTimeout(function() {
|
||
sendsms_flag = 1;
|
||
}, 60000);
|
||
} else {
|
||
alert(data.msg);
|
||
}
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
function third_register() {
|
||
var telephone = $("#telephone").val();
|
||
var captcha = $("#captcha1").val();
|
||
var openid = '<?php echo isset($openid) ? $openid : ''; ?>';
|
||
var access_token = '<?php echo isset($access_token) ? $access_token : ''; ?>';
|
||
var userinfo = '<?php echo isset($userinfo) ? json_encode($userinfo) : ''; ?>';
|
||
|
||
var data = {
|
||
telephone: telephone,
|
||
captcha: captcha,
|
||
openid: openid,
|
||
access_token: access_token,
|
||
userinfo: userinfo
|
||
};
|
||
|
||
$.ajax({
|
||
url: '/index/customer/qq_register',
|
||
type: 'post',
|
||
dataType: 'json',
|
||
data: data,
|
||
success: function (res) {
|
||
if (res.code == 200)
|
||
{
|
||
location.href = '/index/customer/personal.html';
|
||
}
|
||
else if (res.code == -3)
|
||
{
|
||
var html = '<span style="color: red">' + res.msg + '</span>';
|
||
show_err('captcha1', html);
|
||
}
|
||
}
|
||
})
|
||
};
|
||
|
||
function check_format(id)
|
||
{
|
||
if (id == 'telephone')
|
||
{
|
||
var telephone = $("#telephone").val();
|
||
var arg = /^1[3456789]\d{9}$/;
|
||
if (!arg.test(telephone))
|
||
{
|
||
var html = '<span style="color: red">请检查手机格式</span>';
|
||
show_err('telephone', html);
|
||
return false;
|
||
}
|
||
else
|
||
{
|
||
hide_err('telephone');
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
|
||
$(document).keyup(function(e) {
|
||
var code = e.keyCode;
|
||
if (code == 13)
|
||
{
|
||
third_register();
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
function hide_err(id)
|
||
{
|
||
if (id == 'telephone')
|
||
{
|
||
var err_id = 'err_tel';
|
||
var input_id = 'telephone';
|
||
}
|
||
else if (id == 'captcha1')
|
||
{
|
||
var err_id = 'err_captcha1';
|
||
var input_id = 'captcha1';
|
||
}
|
||
|
||
$('#' + err_id).html('');
|
||
$('#' + input_id).css('border', '1px solid #dedfe0');
|
||
}
|
||
|
||
function show_err(id, html)
|
||
{
|
||
if (id == 'telephone')
|
||
{
|
||
var err_id = 'err_tel';
|
||
var input_id = 'telephone';
|
||
}
|
||
else if (id == 'captcha1')
|
||
{
|
||
var err_id = 'err_captcha1';
|
||
var input_id = 'captcha1';
|
||
}
|
||
|
||
$('#' + err_id).html(html);
|
||
$('#' + input_id).css('border', '1px solid red');
|
||
}
|
||
/*验证码倒计时*/
|
||
|
||
function SetRemainTime() {
|
||
if (curCount < 1) {
|
||
window.clearInterval(InterValObj); //停止计时器
|
||
InterValObj = null;
|
||
$(".Obtain").removeAttr("disabled"); //启用按钮
|
||
$(".Obtain").html("获取短信验证码");
|
||
} else {
|
||
curCount--;
|
||
$(".Obtain").html("重新获取" + curCount + "秒");
|
||
}
|
||
}
|
||
</script>
|