1 Star 0 Fork 2

panwan1483/畅行吉林_hzs

forked from celticsv5/畅行吉林_hzs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
changePwd.html 8.63 KB
一键复制 编辑 原始数据 按行查看 历史
13601014569 提交于 2018-08-28 22:56 . 上传项目hzs就是我
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改密码</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="iconfont/iconfont.css" />
<link rel="stylesheet" type="text/css" href="css/all_css.css" />
<link rel="stylesheet" type="text/css" href="css/weui/base.css" />
<link rel="stylesheet" type="text/css" href="lib/weui.css" />
<link rel="stylesheet" type="text/css" href="css/weui/jquery-weui.css" />
<style type="text/css">
#checkQus_main {
max-width: 640px;
min-width: 320px;
width: 100%;
margin: 0px auto;
}
.app_head_left {
float: left;
width: 30%;
padding-left: 6px;
padding-top: 6px;
}
.app_head_left a {
color: #FFFFFF;
font-size: 1.5em;
font-weight: bold;
}
.app_head_mid {
float: left;
width: 40%;
padding-top: 5px;
}
.app_head_right {
float: right;
width: 30%;
text-align: right;
padding: 12px;
}
.app_head_right a {
color: #FFFFFF;
font-size: 1.3em;
font-weight: bold;
font-family: "黑体";
}
#app_head_title {
text-align: center;
color: #FFFFFF;
font-size: 1.6em;
font-family: "宋体";
font-weight: bold;
}
.inputAndBtn {
width: 94%;
height: 55px;
margin-left: 3%;
margin-right: 3%;
border: 1px solid #E9E9E9;
border-radius: 8px;
font-size: 0.9em;
}
#changePwd_mid {
padding-top: 70px;
}
#changePwd_mid input {
width: 100%;
border: none;
outline: none;
height: 100%;
border-radius: 8px;
font-size: 1.3em;
color: #CDCDCD;
padding-left: 1em;
}
/*----提交按钮----*/
.btnBottom {
max-width: 640px;
min-width: 320px;
margin: 0px auto;
width: 100%;
margin-top: 55px;
/*position: fixed;*/
text-align: center;
}
.myRegister {
font-size: 1.2em;
width: 40%;
height: 45px;
border-radius: 20px;
display: block;
background-color: #0070B4;
text-align: center;
line-height: 45px;
color: #FFFFFF;
font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
}
.mycannotRegister {
font-size: 1.2em;
width: 40%;
height: 45px;
border-radius: 20px;
display: block;
background-color: #DCDCDC;
text-align: center;
line-height: 45px;
color: #FFFFFF;
font-family: Tahoma, fzltxhk, "\5fae\8f6f\96c5\9ed1";
}
/*----验证提示----*/
.yanzhengtishi {
color: #FF0000;
margin-top: 5px;
text-align: left;
height: 25px;
font-size: 14px;
width: 90%;
margin: 0 auto;
}
/*----添加提示边框----*/
.wrongB {
border-color: #FF0000 !important;
}
.trueB {
border-color: #0070B4 !important;
}
</style>
</head>
<body ontouchstart>
<div id="checkQus_main">
<div class="index_head">
<div class="app_head_left">
<a href="my.html" class="iconfont">&#xe6d4;</a>
</div>
<div class="app_head_mid">
<p id="app_head_title">修改密码</p>
</div>
</div>
<div id="changePwd_mid">
<!--旧密码-->
<div class="inputAndBtn mt50">
<input type="password" id="oldPwd" placeholder="请输入旧密码" />
</div>
<p class="yanzhengtishi"></p>
<!--输入新密码-->
<div class="inputAndBtn mt10">
<input type="password" id="newPwd" placeholder="请输入新密码" />
</div>
<!--验证提示1-->
<p class="yanzhengtishi"></p>
<!--确认新密码-->
<div class="inputAndBtn mt10">
<input type="password" id="newPwdAgain" placeholder="确认新密码" />
</div>
<!--验证提示2-->
<p class="yanzhengtishi"></p>
<!--修改按钮-->
<div class="btnBottom">
<a href="javascript:;" class="myRegister" id="getNewPwd" style="display: none;">&nbsp;&nbsp;</a>
<a href="javascript:;" class="mycannotRegister" id="cannotGetNewPwd">&nbsp;&nbsp;</a>
</div>
</div>
</div>
<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
<script src="js/md5.js" type="text/javascript" charset="utf-8"></script>
<script src="js/weui/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
<script src="js/back_end.js" type="text/javascript" charset="utf-8"></script>
<script src="libs/crypto-js.js" type="text/javascript" charset="utf-8"></script>
<script src="libs/aes.js" type="text/javascript" charset="utf-8"></script>
<script src="libs/pad-zeropadding.min.js" type="text/javascript" charset="utf-8"></script>
<script src="libs/encryption.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var num0 = 0;
var num1 = 0;
var num2 = 0;
function changeBlue() {
if(num0 == 1 && num1 == 1 && num2 == 1) {
$("#cannotGetNewPwd").css("display", "none");
$("#getNewPwd").css("display", "block");
} else {
$("#getNewPwd").css("display", "none");
$("#cannotGetNewPwd").css("display", "block");
}
// console.log(num0 + "--" + num1 + "--" + num2 + "--" + num3);
}
$("#oldPwd").keyup(function() {
var Pwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,18}$/;
var Input = $(this).parent();
if(Pwd.test(this.value)) {
Input.removeClass("wrongB");
Input.next().html("");
num0 = 1;
} else {
Input.addClass("wrongB");
Input.next().html("请输入旧的8-18位密码");
num0 = 0;
}
changeBlue();
});
//验证自定义密码
$("#newPwd").keyup(function() {
var Pwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,18}$/;
var Input = $(this).parent();
//重复密码框
var nextInput = $("#newPwdAgain").val();
if(Pwd.test(this.value)) {
Input.removeClass("wrongB");
// Input.addClass("trueB");
Input.next().html("");
num1 = 1;
// document.getElementById("cannotregister").style.display = "none";
// document.getElementById("register").style.display = "block";
if(nextInput == this.value) {
$("#newPwdAgain").parent().removeClass("wrongB");
// $("#newPwdAgain").parent().addClass("trueB");
num2 = 1;
} else {
// $("#newPwdAgain").parent().removeClass("trueB");
$("#newPwdAgain").parent().addClass("wrongB");
num2 = 0;
}
} else {
// Input.removeClass("trueB");
Input.addClass("wrongB");
Input.next().html("请输入8-18位数字和英文字母作为新密码");
num1 = 0;
}
changeBlue();
});
//重复密码
$("#newPwdAgain").keyup(function() {
var Input = $(this).parent();
var pwdFirst = Input.prev().prev().children().val();
if(this.value != pwdFirst) {
// Input.removeClass("trueB");
Input.addClass("wrongB");
num2 = 0;
} else {
var Pwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,18}$/;
if(!Pwd.test(this.value)) {
// Input.removeClass("trueB");
Input.addClass("wrongB");
num2 = 0;
} else {
Input.removeClass("wrongB");
// Input.addClass("trueB");
num2 = 1;
}
}
changeBlue();
});
//验证:修改按钮
$("#getNewPwd").click(function() {
var userName = JSON.parse(localStorage.userJson)[0].username;
var n1 = $("#oldPwd").val();
var n2 = $("#newPwd").val();
var allData = "USERNAME:" + userName + ",OLDPASSWORD:" + n1 + ",NEWPASSWORD:" + n2;
allData = encrypt(allData);
// console.log(userName);
$.ajax({
type: "post",
url: Url,
data: {
"type": "modify_password",
"DATA": "" + allData + ""
},
async: false,
cache: false,
dataType: "jsonp", //数据类型为jsonp
jsonp: "callbackparam", //服务端用于接收callback调用的function名的参数
jsonpCallback: "jsonpCallback1",
success: function(data) {
if(data.MSG == "成功") {
$.alert("新密码修改成功", "提示", function() {
window.location.href = "my.html";
});
} else {
$.alert("原密码输入有误", "提示", function() {
$("#oldPwd").val("");
$("#getNewPwd").css("display", "none");
$("#cannotGetNewPwd").css("display", "block");
});
}
},
error: function(data) {
$.alert("连接超时,请稍后再试", "提示");
}
});
});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/panwan1483/jilin__hzs.git
git@gitee.com:panwan1483/jilin__hzs.git
panwan1483
jilin__hzs
畅行吉林_hzs
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385