<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>修改密码</title>
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<link rel="stylesheet" href="css/mui.min.css">
|
<link rel="stylesheet" href="node_modules/weui/dist/style/weui.css"/>
|
<style>
|
#content div{
|
height:40px;
|
line-height:40px;
|
background-color:#ffffff;
|
margin-bottom:25px;
|
|
}
|
#content div .font{
|
float: left;
|
width:25%;
|
padding-left:10px;
|
}
|
#content div input{
|
float: right;
|
width:60%;
|
border:0px;
|
color:#353535;
|
}
|
#tishi_message{
|
position: absolute;
|
top:20%;
|
left:10%;
|
}
|
|
</style>
|
</head>
|
|
<body>
|
|
|
<!--内容部分-->
|
<div id="content" class="mui-content mui-scroll-wrapper">
|
<!--<div class="mui-scroll">-->
|
<div style="margin-top:25px"><div class="font">旧密码</div><input type="password" id="pwd_old" placeholder="请输入您的密码"/></div>
|
<div><div class="font">新密码</div><input type="password" id="pwd_new" placeholder="请输入您的新密码"/></div>
|
<div><div class="font">确认密码</div><input type="password" id="pwd_news" placeholder="确认您的新密码"/></div>
|
|
<a href="#" class="weui-btn weui-btn_primary" style="width:80%;margin-top:100px">确定</a>
|
<!--提示信息-->
|
<div style="height:200px;width:300px;display:none;border-radius:10px" id="tishi_message">
|
<div class="close"><img src="images/close.png" alt="" style="height:30px;float: right;padding-right:20px;padding-top:10px "/></div>
|
<div class="content" style="text-align:center">
|
</div>
|
<button style="margin-left:40%" id="queding">确定</button>
|
|
</div>
|
<!--</div>-->
|
</div>
|
|
|
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
|
<!--<script src="js/common.js" ></script>-->
|
<script src="js/mui.min.js"></script>
|
<script>
|
|
|
|
|
$('input:password').each(function(){
|
var txt = $(this).val();
|
$(this).focus(function(){
|
if(txt === $(this).val())
|
$(this).val("");
|
}).blur(function(){
|
if($(this).val() == "") $(this).val(txt);
|
});
|
})
|
|
|
|
|
var serverUrl = "http://www.fschool365.cn/";
|
// if(sessionCache.getSessionCashe("userToken") == null){
|
// location.href="login.html";
|
// }
|
|
// mui_.init({
|
// load:true,
|
// pull:true,
|
// callback:function(){
|
|
// var school = sessionCache.getSessionCashe("organizationTree",sessionCache.json_value);
|
// var schoolId="";
|
// $.each(school,function(index,entity){
|
// schoolId =schoolId + ","+entity.id;
|
// });
|
// var posts = sessionCache.getSessionCashe("userPosts",sessionCache.json_value);
|
// var postsId="";
|
// $.each(posts,function(index,entity){
|
// postsId =postsId + ","+entity.id;
|
// });
|
// 达标
|
// $("#submit_button").click(function(){
|
// var status=document.getElementById("x11").checked;
|
// var isUpStandard=0;
|
// if(status){
|
// isUpStandard=1;
|
// }
|
var sessionCache = {
|
json_value : "json",
|
getSessionCashe : function(key,dataType,remove){
|
var obj = window.localStorage.getItem(key);
|
if(dataType != null && dataType === "json"){
|
/*if(remove){
|
window.localStorage.removeItem(key);
|
}*/
|
return jQuery.parseJSON(obj);
|
}else{
|
/*if(remove){
|
window.localStorage.removeItem(key);
|
}*/
|
return obj;
|
}
|
},
|
setSessionCashe : function(key,value,dataType){
|
if(dataType != null && dataType === "json"){
|
window.localStorage.setItem(key,JSON.stringify(value));
|
}else{
|
window.localStorage.setItem(key,value);
|
}
|
}
|
}
|
|
|
$(".weui-btn").click(function(){
|
var oldpwd=$("#pwd_old").val();
|
var newpwd=$("#pwd_new").val();
|
var rnewpwd=$("#pwd_news").val();
|
mui.ajax(
|
serverUrl + "auth/user/changePwd.json?newPwd="+newpwd+"&oldPwd="+oldpwd, {
|
data:JSON.stringify(
|
/* {
|
"oldPwd":oldpwd,
|
"newPwd":newpwd
|
|
}*/
|
),
|
dataType:'json',
|
async : false,
|
type: 'get', //HTTP请求类型
|
headers: {
|
'Content-Type': 'application/json',
|
'Authorization': sessionCache.getSessionCashe("userToken")
|
},
|
success: function(data) {
|
if(data.code==000){
|
$("#tishi_message").show();
|
// alert(data.message);
|
$(".content").text(data.message);
|
$(".close").bind("tap",function(){
|
mui.openWindow({
|
url:'login.html'
|
});
|
});
|
$("#queding").bind("tap",function(){
|
mui.openWindow({
|
url:'login.html'
|
});
|
});
|
|
}
|
|
|
},
|
error: function(xhr, type, errorThrown) {
|
//异常处理;
|
console.log(type);
|
}
|
});
|
});
|
|
|
|
// }
|
// });
|
</script>
|
</body>
|
|
</html>
|