forgetPassword_reset_frm_login.html
4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>重置密码</title>
<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/login/forgetPassword.css"/>
<style>
html,
body{
background-color: #F4F6F9;
}
</style>
</head>
<body>
<div class="form-panel">
<div class="aui-list" style="border-radius:8px;">
<div class="aui-list-item" style="border-bottom: none;background-size: 100% 0px;margin-top:-0.5rem;">
<div class="aui-list-item-left">
<img src="../../image/login_icon_password.png" style="height:24px;width:24px;margin-top:-0.1rem;"/>
</div>
<div class="aui-list-item-center">
<input id="newPwd" class="aui-input input-style-normal" type="password" placeholder="输入新密码" style="height:3.3rem;border-bottom:1px solid #F0F5FF;margin-right:15px;">
</div>
</div>
<div class="aui-list-item" style="margin-top:-1rem;margin-bottom:-1rem;">
<div class="aui-list-item-left">
<img src="../../image/login_icon_repassword.png" style="height:24px;width:24px;margin-top:-0.1rem;"/>
</div>
<div class="aui-list-item-center">
<input id="rePwd" class="aui-input input-style-normal" type="password" placeholder="确认新密码" style="height:3.3rem;border-bottom:1px solid #F0F5FF;margin-right:15px;">
</div>
</div>
</div>
</div>
<div style="margin-left:15px;margin-right:15px;margin-top:15px;">
<span tapmode onclick="handleReset();" class="next-btn">确认</span>
</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
apiready = function(){
api.parseTapmode();
api.sendEvent({
name: 'sendThisTitle',
extra: {
title: '设置新密码'
}
});
console.log(api.pageParam.phone);
};
function handleReset() {
var newpwd_dom = $api.byId("newPwd");
var repwd_dom = $api.byId("rePwd");
newpwd_dom.blur();
repwd_dom.blur();
var inputed_new_pwd = $api.trim($api.val($api.byId("newPwd")));
var inputed_re_pwd = $api.trim($api.val($api.byId("rePwd")));
if (inputed_new_pwd != inputed_re_pwd) {
api.toast({msg: '两次密码不一致',duration: 2000,location: 'bottom'});
}else if (inputed_new_pwd == '') {
api.toast({msg: '密码不可为空',duration: 2000,location: 'bottom'});
}else if (inputed_new_pwd.length<6 || inputed_new_pwd.length>10) {
api.toast({msg: '请输入6-10位密码',duration: 2000,location: 'bottom'});
}else {
api.ajax({
url: HOST + '/iot_api/v1/app/reset_password',
method: 'post',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
data: {
body: {
phone: api.pageParam.phone,
code: api.pageParam.code,
cid: api.pageParam.cid,
new_password: inputed_new_pwd
}
}
}, function(ret, err) {
console.log(JSON.stringify(ret));
if (ret.code == 0) {
api.toast({msg: '修改成功',duration: 2000,location: 'bottom'});
api.openWin({
name: 'reset_success',
url: './resetSuccess.html',
slidBackEnabled: false,
});
}else {
api.toast({msg: '修改失败',duration: 2000,location: 'bottom'});
}
});
}
}
</script>
</html>