init
This commit is contained in:
226
app/us/view/customer/forgetpwd.phtml
Executable file
226
app/us/view/customer/forgetpwd.phtml
Executable file
@@ -0,0 +1,226 @@
|
||||
<!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">Change Password</div>
|
||||
<div class="content">
|
||||
<li class="margin-b-5">
|
||||
<input type="password" id="password" onfocus="hide_err('password')" onblur="check_format('password')" placeholder="New password">
|
||||
<div id="err_password"></div>
|
||||
</li>
|
||||
<li class="margin-b-5">
|
||||
<input type="password" id="re_password" onfocus="hide_err('re_password')" onblur="check_format('re_password')" placeholder="Confirm New Password">
|
||||
<div id="err_re_password"></div>
|
||||
</li>
|
||||
<div class="tjdl">
|
||||
<button class="tjbtn" onclick="update_forget_pwd()">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(){
|
||||
$(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">
|
||||
function update_forget_pwd() {
|
||||
|
||||
var password = $("#password").val();
|
||||
var re_password = $("#re_password").val();
|
||||
var token = '<?php echo isset($token) ? $token : ''; ?>';
|
||||
var data = {
|
||||
token: token,
|
||||
password: password
|
||||
};
|
||||
|
||||
if (!check_format('password') || !check_format('re_password'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/us/customer/change_password',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (res) {
|
||||
if (res.code == 200)
|
||||
{
|
||||
alert(res.msg);
|
||||
location.href = '/us/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')
|
||||
{
|
||||
var re_password = $("#re_password").val();
|
||||
if (re_password != '')
|
||||
{
|
||||
check_format('re_password');
|
||||
}
|
||||
|
||||
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('password', html);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
hide_err('password');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (id == 're_password')
|
||||
{
|
||||
var password = $("#password").val();
|
||||
var re_password = $("#re_password").val();
|
||||
if (password != re_password)
|
||||
{
|
||||
var html = '<span style="color: red"> Two password inconsistencies </span>';
|
||||
show_err('re_password', html);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
hide_err('re_password');
|
||||
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;
|
||||
|
||||
if (code == 13)
|
||||
{
|
||||
update_forget_pwd();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function hide_err(id)
|
||||
{
|
||||
if (id == 'password')
|
||||
{
|
||||
var err_id = 'err_password';
|
||||
var input_id = 'password';
|
||||
}
|
||||
else if (id == 're_password')
|
||||
{
|
||||
var err_id = 'err_re_password';
|
||||
var input_id = 're_password';
|
||||
}
|
||||
|
||||
$('#' + err_id).html('');
|
||||
$('#' + input_id).css('border', '1px solid #dedfe0');
|
||||
}
|
||||
|
||||
function show_err(id, html)
|
||||
{
|
||||
if (id == 'password')
|
||||
{
|
||||
var err_id = 'err_password';
|
||||
var input_id = 'password';
|
||||
}
|
||||
else if (id == 're_password')
|
||||
{
|
||||
var err_id = 'err_re_password';
|
||||
var input_id = 're_password';
|
||||
}
|
||||
|
||||
$('#' + 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>
|
||||
Reference in New Issue
Block a user