430 lines
13 KiB
PHTML
Executable File
430 lines
13 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:180px;">
|
||
<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 accounts blue cursor_p text-c">Retrieve Password</div>
|
||
<div class="des accounts cursor_p text-c">We’ll send you a link so you can reset your password.</div>
|
||
<div class="content">
|
||
<li class="margin-b-5">
|
||
<input type="text" onfocus="hide_err('email')" onblur="check_format('email')" id="email" placeholder="Email Address">
|
||
<div id="err_email" style="color: red"></div>
|
||
</li>
|
||
<div class="tjdl">
|
||
<button class="tjbtn" onclick="update_forget_pwd('update_by_email')">Sumbit</button>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="Register">
|
||
<a href="__ORICOROOT__<?php echo url('/register'); ?>" class="left">Registry</a>
|
||
<a href="__ORICOROOT__<?php echo url('/login'); ?>" class="right">Login</a>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="text-c login_bottom">2015 ORICO Technologies Co.,Ltd copyright(<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030702002297" >GuangDong ICP No. 15,025,109</a>)</div>
|
||
<!-- 注册 e -->
|
||
|
||
<!-- 新闻详情页 e -->
|
||
|
||
<script type="text/javascript">
|
||
$(document).ready(function(){
|
||
$(".accounts").click(function(){
|
||
hide_err_batch(2);
|
||
update_flag = 1;
|
||
$(this).siblings().removeClass("blue");
|
||
$(this).addClass("blue");
|
||
$(".content_02").hide();
|
||
$(".content_01").show();
|
||
})
|
||
$(".short_letter").click(function(){
|
||
alert('邮箱暂不可用');
|
||
return;
|
||
hide_err_batch(1);
|
||
update_flag = 2;
|
||
$(this).siblings().removeClass("blue");
|
||
$(this).addClass("blue");
|
||
$(".content_01").hide();
|
||
$(".content_02").show();
|
||
})
|
||
})
|
||
</script>
|
||
</body>
|
||
</html>
|
||
<script type="text/javascript">
|
||
var update_flag = 1;
|
||
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')
|
||
{
|
||
var url = '/index/customer/sendresetemail';
|
||
var email = $("#email").val();
|
||
var data = {
|
||
email: email
|
||
};
|
||
|
||
if (sendsms_flag == 0)
|
||
{
|
||
return;
|
||
}
|
||
|
||
if (!check_format('email'))
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
|
||
$.ajax({
|
||
url: url,
|
||
type: 'post',
|
||
dataType: 'json',
|
||
data: data,
|
||
success: function(data) {
|
||
if (data.code == 200) {
|
||
|
||
//设置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 update_forget_pwd(type) {
|
||
if (type == 'update_by_tel')
|
||
{
|
||
var telephone = $("#telephone").val();
|
||
var captcha = $("#captcha1").val();
|
||
var password = $("#password").val();
|
||
var re_password = $("#re_password").val();
|
||
var data = {
|
||
telephone: telephone,
|
||
captcha: captcha,
|
||
password: password
|
||
};
|
||
|
||
if (!check_format('telephone') || !check_format('password') || !check_format('re_password'))
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
else if (type == 'update_by_email')
|
||
{
|
||
var email = $("#email").val();
|
||
var captcha = $("#captcha2").val();
|
||
var password = $("#password2").val();
|
||
var re_password = $("#re_password2").val();
|
||
var data = {
|
||
email: email,
|
||
captcha: captcha,
|
||
password: password
|
||
};
|
||
|
||
if (!check_format('email') || !check_format('password2') || !check_format('re_password2'))
|
||
{
|
||
return;
|
||
}
|
||
}
|
||
|
||
$.ajax({
|
||
url: 'index/customer/update_forget_pwd',
|
||
type: 'post',
|
||
dataType: 'json',
|
||
data: data,
|
||
success: function (res) {
|
||
if (res.code == 200)
|
||
{
|
||
alert(res.msg);
|
||
location.href = '/login.html';
|
||
}
|
||
else if (res.code == -3)
|
||
{
|
||
var html = '<span style="color: red">' + res.msg + '</span>';
|
||
show_err('captcha1', html);
|
||
}
|
||
else if (res.code == -5)
|
||
{
|
||
var html = '<span style="color: red">' + res.msg + '</span>';
|
||
show_err('captcha2', html);
|
||
}
|
||
else
|
||
{
|
||
alert(res.msg);
|
||
}
|
||
}
|
||
})
|
||
};
|
||
|
||
function check_format(id)
|
||
{
|
||
if (id == 'password' || id == 'password2')
|
||
{
|
||
var flag = id == 'password' ? 1 : 0;
|
||
var _id = flag == 1 ? 're_password' : 're_password2';
|
||
var err_id = flag == 1 ? 'pwd' : 'pwd2';
|
||
|
||
var re_password = $("#" + _id).val();
|
||
if (re_password != '')
|
||
{
|
||
check_format(_id);
|
||
}
|
||
|
||
var password = $("#" + id).val();
|
||
var arg = /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*-.]+$)[a-zA-Z\d!@#$%^&*-.]{8,20}$/;
|
||
if (!arg.test(password))
|
||
{
|
||
var html = '<span style="color: red">The password must contain 8-20 characters and at least two types of characters.</span>';
|
||
show_err(err_id, html);
|
||
return false;
|
||
}
|
||
else
|
||
{
|
||
hide_err(err_id);
|
||
return true;
|
||
}
|
||
}
|
||
else if (id == 're_password' || id == 're_password2')
|
||
{
|
||
var flag = id == 're_password' ? 1 : 0;
|
||
var pwd_id = flag == 1 ? 'password' : 'password2';
|
||
var err_id = flag == 1 ? 're_pwd' : 're_pwd2';
|
||
|
||
var password = $("#" + pwd_id).val();
|
||
var re_password = $("#" + id).val();
|
||
if (password != re_password)
|
||
{
|
||
var html = '<span style="color: red"> Two password inconsistencies </span>';
|
||
show_err(err_id, html);
|
||
return false;
|
||
}
|
||
else
|
||
{
|
||
hide_err(err_id);
|
||
return true;
|
||
}
|
||
}
|
||
else if (id == 'telephone')
|
||
{
|
||
var telephone = $("#telephone").val();
|
||
var arg = /^1[3456789]\d{9}$/;
|
||
if (!arg.test(telephone))
|
||
{
|
||
var html = '<span style="color: red">Please check the E-mail</span>';
|
||
show_err('telephone', html);
|
||
return false;
|
||
}
|
||
else
|
||
{
|
||
hide_err('telephone');
|
||
return true;
|
||
}
|
||
}
|
||
else if (id == 'email')
|
||
{
|
||
var email = $("#email").val();
|
||
var arg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/;
|
||
if (!arg.test(email))
|
||
{
|
||
var html = '<span style="color: red">Error Mail Form</span>';
|
||
show_err('email', html);
|
||
return false;
|
||
}
|
||
else
|
||
{
|
||
hide_err('email');
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
/*倒数计时*/
|
||
function SetRemainTime() {
|
||
if (curCount < 1) {
|
||
window.clearInterval(InterValObj); //停止计时器
|
||
InterValObj = null;
|
||
$(".Obtain").removeAttr("disabled"); //启用按钮
|
||
$(".Obtain").html("获取短信验证码");
|
||
} else {
|
||
curCount--;
|
||
$(".Obtain").html("重新获取" + curCount + "秒");
|
||
}
|
||
}
|
||
|
||
$(document).keyup(function(e) {
|
||
var code = e.keyCode;
|
||
var type = update_flag == 1 ? 'update_by_tel' : 'update_by_email';
|
||
if (code == 13)
|
||
{
|
||
update_forget_pwd(type);
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
function hide_err_batch(id)
|
||
{
|
||
if (id == 1)
|
||
{
|
||
hide_err('telephone');
|
||
hide_err('captcha1');
|
||
hide_err('password');
|
||
hide_err('re_password');
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
}
|
||
|
||
function hide_err(id)
|
||
{
|
||
if (id == 'password')
|
||
{
|
||
var err_id = 'err_pwd';
|
||
var input_id = 'password';
|
||
}
|
||
else if (id == 're_password')
|
||
{
|
||
var err_id = 'err_repwd';
|
||
var input_id = 're_password';
|
||
}
|
||
if (id == 'password2')
|
||
{
|
||
var err_id = 'err_pwd2';
|
||
var input_id = 'password2';
|
||
}
|
||
else if (id == 're_password2')
|
||
{
|
||
var err_id = 'err_repwd2';
|
||
var input_id = 're_password2';
|
||
}
|
||
else if (id == 'email')
|
||
{
|
||
var err_id = 'err_email';
|
||
var input_id = 'email';
|
||
}
|
||
else 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';
|
||
}
|
||
else if (id == 'captcha2')
|
||
{
|
||
var err_id = 'err_captcha2';
|
||
var input_id = 'captcha2';
|
||
}
|
||
|
||
$('#' + err_id).html('');
|
||
$('#' + input_id).css('border', '1px solid #dedfe0');
|
||
}
|
||
|
||
function show_err(id, html)
|
||
{
|
||
if (id == 'pwd')
|
||
{
|
||
var err_id = 'err_pwd';
|
||
var input_id = 'password';
|
||
}
|
||
else if (id == 're_pwd')
|
||
{
|
||
var err_id = 'err_repwd';
|
||
var input_id = 're_password';
|
||
}
|
||
else if (id == 'pwd2')
|
||
{
|
||
var err_id = 'err_pwd2';
|
||
var input_id = 'password2';
|
||
}
|
||
else if (id == 're_pwd2')
|
||
{
|
||
var err_id = 'err_repwd2';
|
||
var input_id = 're_password2';
|
||
}
|
||
else if (id == 'email')
|
||
{
|
||
var err_id = 'err_email';
|
||
var input_id = 'email';
|
||
}
|
||
else 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';
|
||
}
|
||
else if (id == 'captcha2')
|
||
{
|
||
var err_id = 'err_captcha2';
|
||
var input_id = 'captcha2';
|
||
}
|
||
|
||
$('#' + 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>
|