|
- <!DOCTYPE html>
- <html class="ui-page-login">
-
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title></title>
- <link href="css/mui.min.css" rel="stylesheet" />
- <link href="css/style.css" rel="stylesheet" />
- <style>
- .area {
- margin: 20px auto 0px auto;
- }
-
- .mui-input-group:first-child {
- margin-top: 20px;
- }
-
- .mui-input-group label {
- width: 30%;
- }
-
- .mui-input-row label~input,
- .mui-input-row label~select,
- .mui-input-row label~textarea {
- width: 70%;
- }
-
- .mui-checkbox input[type=checkbox],
- .mui-radio input[type=radio] {
- top: 6px;
- }
-
- .mui-content-padded {
- margin-top: 25px;
- }
-
- .mui-btn {
- padding: 10px;
- }
-
- .mui-input-row label~input,
- .mui-input-row label~select,
- .mui-input-row label~textarea {
- margin-top: 1px;
- }
- </style>
- </head>
-
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title">修改密码</h1>
- </header>
- <div class="mui-content">
- <form class="mui-input-group">
- <div class="mui-input-row">
- <label>原密码</label>
- <input id='tboldpwd' type="password" class="mui-input-password mui-input" placeholder="请输入原密码">
- </div>
- <div class="mui-input-row">
- <label>新密码</label>
- <input id='tbnwepwd' type="password" class="mui-input-password mui-input" placeholder="请输入新密码">
- </div>
- <div class="mui-input-row">
- <label>新密码</label>
- <input id='tbnwepwd2' type="password" class="mui-input-password mui-input" placeholder="请输入新密码">
- </div>
- </form>
- <div class="mui-content-padded">
- <button id='btchange' class="mui-btn mui-btn-block mui-btn-primary">立即修改</button>
- </div>
- </div>
- <script src="js/mui.min.js"></script>
- <script src="js/serverurl.js"></script>
- <script src="js/userinfos.js"></script>
- <script>
- (function($, doc) {
- $.init();
- $.plusReady(function() {
- CheckLogin();
- document.getElementById("btchange").addEventListener("tap", function() {
- if(document.getElementById("tboldpwd").value == "") {
- plus.nativeUI.toast('修改失败!请输入原密码。');
- return;
- }
- if(document.getElementById("tbnwepwd").value == "" || document.getElementById("tbnwepwd").value.length < 6) {
- plus.nativeUI.toast('修改失败!请输入至少6位的新密码。');
- return;
- }
- if(document.getElementById("tbnwepwd").value!=document.getElementById("tbnwepwd2").value) {
- plus.nativeUI.toast('修改失败!两次输入的新密码不相同。');
- return;
- }
- //更新服务端
-
- plus.nativeUI.showWaiting("加载中...");
- var param={
- userid:users.ID,
- oldpwd:document.getElementById("tboldpwd").value,
- newpwd:document.getElementById("tbnwepwd").value
- }
- mui.post(api+'/user/updatePwdStu',{data:JSON.stringify(param)},function(res){
- plus.nativeUI.closeWaiting();
- if(res.code=="200"){
- plus.webview.currentWebview().close();
- plus.nativeUI.toast('修改成功。');
- }else{
- plus.nativeUI.toast("您输入的原密码不正确。");
- }
- },'json')
- });
- });
- }(mui, document));
- </script>
- </body>
-
- </html>
|