You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
6.5 KiB
HTML

2 years ago
<extend name="Public/base" />
<block name="body" >
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<div class="g-container">
<div class="g-main">
<include file="Public/user_head" />
<div class="user-bd laybox fix">
<include file="Public/user_base" />
<div class="user-section-wrap fl" id="user-section-wrap">
<div class="us2-mibao">
<form class="form1" action="{:U('resetpwd')}" method="post">
<div class="section-tit">修改密码</div>
<div class="w-item">
<label for="" class="w-label">用户名:</label>
<div class="w-div"><if condition="session('member_auth.nickname') eq 'Uc用户'">{:session('member_auth.account')}<else/>{$user.account}</if></div>
</div>
<div class="w-item">
<label for="" class="w-label"><span style="color: red">*</span>原密码:</label>
<input placeholder="请输入原密码" name="password_old" class="w-input" type="password" value="" >
<span class="error-msg" style="color: red"></span>
</div>
<div class="w-item">
<label for="" class="w-label"><span style="color: red">*</span>新密码:</label>
<input placeholder="6-30位数字、字母或特殊字符组成" name="password" class="w-input" type="password" >
<span class="error-msg" style="color: red"></span>
</div>
<div class="w-item">
<label for="" class="w-label"><span style="color: red">*</span>确认新密码:</label>
<input placeholder="请输入确认新密码" name="password1" class="w-input" type="password">
<span class="error-msg" style="color: red"></span>
</div>
<div class="w-item">
<label for="" class="w-label"></label>
<input type="button" class="g-btn fsumit" value="修 改">
</div>
<div class="utips">
<h4>友情提示</h4>
<ul>
<li>修改游戏密码,是指根据原密码由您自定义新密码。</li>
<li>混合使用数字、大小字母的密码能使您的账号更安全。</li>
<li>当您疑似账号异常时,请换一台电脑重新修改游戏密码。</li>
</ul>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="turl" name="turl" value="">
<script>
queren = false;
$("input[name='password_old']").blur(function () {
yzz(1);
});
$("input[name='password']").blur(function () {
yzz(2);
});
$("input[name='password1']").blur(function () {
yzz(3);
});
function yzz(type) {
var a = $("input[name='password_old']");
var b = $("input[name='password']");
var c = $("input[name='password1']");
$opwd=a.val();
$pwd=b.val();
$pwd1=c.val();
if (type == 1){
if ($opwd == ''){
a.next().html("*原密码不能为空");
a.next().show();
return false;
}else{
$.ajax({
url:"{:U('ajaxPwdDetect')}",
type:"POST",
data:{opwd:$opwd},
dataType:"json",
success:function(result){
if(result.status == 1){
a.next().hide();
}else{
a.next().html("*"+result.msg);
a.next().show();
}
}
})
}
}else if(type == 2){
if ($pwd == ''){
b.next().html("*新密码不能为空");
b.next().show();
return false;
}else if($pwd.length <6 || $pwd.length >30){
b.next().html("*密码由6-30位字母、数字或下划线组成");
b.next().show();
return false;
}else{
b.next().hide();
}
}else if(type == 3){
if ($pwd1 == ''){
c.next().html("*确认密码不能为空");
c.next().show();
return false;
}else if($pwd1.length <6 || $pwd1.length >30){
c.next().html("*密码由6-30位字母、数字或下划线组成");
c.next().show();
return false;
}else{
c.next().hide();
}
if ($pwd !== $pwd1){
//b.next().html("*新密码和确认新密码不一致,请重新输入");
//b.next().show();
c.next().html("*新密码和确认新密码不一致,请重新输入");
c.next().show();
return false;
}else{
b.next().hide();
c.next().hide();
}
}
if (a.next().is(":hidden") && b.next().is(":hidden") && c.next().is(":hidden")){
queren = true;
}
}
$(".fsumit").click(function(){
var a = $("input[name='password_old']");
var b = $("input[name='password']");
var c = $("input[name='password1']");
yzz(1);yzz(2);yzz(3);
if (queren == false){
return false;
}
$opwd=$("input[name='password_old']").val();
$pwd=$("input[name='password']").val();
$pwd1=$("input[name='password1']").val();
if ($opwd == ''){
a.next().html("*原密码不能为空");
a.next().show();
return false;
}
if ($pwd == ''){
b.next().html("新密码不能为空");
b.next().show();
return false;
}
if ($pwd.length <6 || $pwd.length >30 ) {
b.next().html("*密码由6-30位字母、数字或下划线组成");
b.next().show();
return false;
}
if (!(/^[a-zA-z0-9_]{6,30}$/.test($pwd))) {
b.next().html("*密码由6-30位字母、数字或下划线组成");
b.next().show();
return false;
}
if ($pwd1 == ''){
c.next().html("请填写确认密码");
c.next().show();
return false;
}
if ($pwd !== $pwd1){
c.next().html("新密码和确认新密码不一致,请重新输入");
c.next().show();
return false;
}
data=$(".form1").serialize();
$.ajax({
type: 'POST',
url: "{:U('resetpwd')}" ,
data:data,
success:function(data){
if(data.status){
layer.msg(data.msg,{icon:1});
$('#turl').val('Member/plogin');
$('#quitlogin').trigger('click');
}else{
layer.msg(data.msg,{icon:2});
}
}
});
});
</script>
</block>