identity.html
7.31 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>用户中心-{$tpshop_config['shop_info_store_title']}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
<link rel="stylesheet" href="__STATIC__/css/security_set.css">
<link rel="stylesheet" href="__STATIC__/css/btn.css">
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/slider.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script><!--弹窗js 参考文档 http://layer.layui.com/-->
</head>
<body>
<include file="public/header" />
<style type="text/css">
.bread_crumbs {
height: 40px;line-height: 40px;
padding-left: 25px;clear: both;
background-color: #fafafa;
width:1200px;margin:auto;
}
.bread_crumbs .crumbs_font {margin: 0 5px;color: #3c3c3c;}
.bread_crumbs .color { color: #f22e00;}
.bread_crumbs span { margin: 0 5px;}
</style>
<div class="wrap">
<div class="bread_crumbs">
<a href="{:U('Home/User/index')}" class="crumbs_font">用户中心</a>><span class="color">找回密码</span>
</div>
<div class="col_main" style="float: none; width: auto;">
<div class="main security_passwd">
<!-- themes star -->
<!-- themes end -->
<section class="security_passwd">
<div class="wrapper-3">
<div class="pub-step" id="step">
<div class="steps-nav fixed w4">
<p class="step-nav step-nav-1">
1.填写用户名<i></i>
</p>
<p class="step-nav step-nav-2 go">
2.验证身份<i></i>
</p>
<p class="step-nav step-nav-3">
3.设置新密码<i></i>
</p>
<p class="step-nav step-nav-4">4.完成</p>
</div>
<div class="steps-con block-01">
<div class="step-col way-ul-1 " id="verify-way">
<div id="way-se">
<label class="title" for="verify-type-selector">请选择验证方式:</label>
<div class="con">
<select id="verify-type-selector">
<if condition="strstr($Request.param.username,'@')">
<option value="email" selected alias-value="2">邮箱验证</option>
<else / >
<option value="phone" selected alias-value="1">手机验证</option>
</if>
</select>
</div>
</div>
<div class="captcha_row">
<!-- way-u-1 begin -->
<ul class="pub-ul way-u way-u-1 fn-form verify-captcha-sms" data-fn-verify="">
<if condition="$userinfo['mobile'] neq ''">
<li class="li-01"><span class="title">已验证手机号码:</span>
<div class="con verify-group">
<span class="s-01">{$userinfo.mobile}</span>
</div>
</li>
</if>
<if condition="$userinfo['email'] neq ''">
<li class="li-02"><span class="title">已验证邮箱:</span>
<div class="con verify-group">
<span class="s-01">{$userinfo.email}</span>
</div>
</li>
</if>
<li class="li-03"><span class="title">验证码:</span>
<div class="con verify-group">
<input type="text" class="msg-code ie-01 verify-ctrl" name="tpcode" id="tpcode" maxlength="10" value="">
<input type="button" class="get-msg-code" id="sendSms" onclick="sendcode(this)" value="获取验证码">
<span class="v-tips verify-tips" data-tips-for="tpcode"><i class="icon"></i><span class="txt"></span></span>
</div>
</li>
<li class="li-04">
<button type="button" class="btn_120 verify-ctrl" id="fx_next" onclick="setpwd()">下一步</button>
</li>
</ul>
<!-- way-u-1 end -->
</div>
</div>
<!-- /#step-col -->
</div>
<div class="steps-con off block-02" id="inform-hint">
<div class="step-col">
<div class="set-hint"><p></p><font color="red" size="+1"><p></p></font></div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<input type="hidden" id="username" value="{$userinfo.username}">
<div style="clear: both;"></div>
<include file="public/footer" />
<script>
function sendcode(o){
$.ajax({
url:'/index.php?m=Home&c=Api&a=send_validate_code&scene=2&t='+Math.random(),
type:'get',
dataType:'json',
data:{type:$('#verify-type-selector').val(),send:$('#username').val()},
success:function(res){
if(res.status==1){
layer.alert(res.msg, {icon: 1});
timer(o);
}else{
layer.alert(res.msg, {icon: 2});
}
}
})
}
var wait=180;
function timer(o) {
$('span[data-tips-for="tpcode"]').find('i').addClass('icon');
$('span[data-tips-for="tpcode"]').find('i').removeClass('icon-warn');
$('span[data-tips-for="tpcode"]').find('.txt').empty();
if (wait == 0) {
o.removeAttribute("disabled");
o.value="获取验证码";
wait = 180;
} else {
o.setAttribute("disabled", true);
o.value="重新发送(" + wait + ")";
wait--;
setTimeout(function() {
timer(o)
}, 1000)
}
}
var is_check = false;
function checkcode(){
var tpcode = $('#tpcode').val();
$('span[data-tips-for="tpcode"]').css('display','inline');
$('span[data-tips-for="tpcode"]').find('i').removeClass('icon');
$('span[data-tips-for="tpcode"]').find('i').addClass('icon-warn');
if(tpcode == ''){
$('span[data-tips-for="tpcode"]').find('.txt').empty().html('验证码不能为空');
return;
}
if(tpcode.length != 4){
$('span[data-tips-for="tpcode"]').find('.txt').empty().html('验证码不正确');
return;
}
$.ajax({
url:'/index.php?m=Home&c=Api&a=check_validate_code&t='+Math.random(),
type:'post',
dataType:'json',
data:{type:$('#verify-type-selector').val(),code:tpcode,send:$('#username').val()},
success:function(res){
if(res.status==1){
is_check = true;
$('span[data-tips-for="tpcode"]').css('display','inline');
$('span[data-tips-for="tpcode"]').find('i').removeClass('icon-warn');
$('span[data-tips-for="tpcode"]').find('i').addClass('icon-loss');
$('span[data-tips-for="tpcode"]').find('.txt').empty();
window.location.href='/index.php?m=Home&c=User&a=set_pwd&t='+Math.random();
}else{
$('span[data-tips-for="tpcode"]').find('.txt').empty().html(res.msg);
//alert('验证码未验证通过');
return false;
}
}
})
}
function setpwd(){
var tpcode = $('#tpcode').val();
$('span[data-tips-for="tpcode"]').css('display','inline');
$('span[data-tips-for="tpcode"]').find('i').removeClass('icon');
$('span[data-tips-for="tpcode"]').find('i').addClass('icon-warn');
if(tpcode == ''){
$('span[data-tips-for="tpcode"]').find('.txt').empty().html('验证码不能为空');
return;
}
if(tpcode.length != 4){
$('span[data-tips-for="tpcode"]').find('.txt').empty().html('验证码不正确');
return;
}
checkcode();
}
</script>
</body>
</html>