find_pwd.html
5.12 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
<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop1.2" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<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']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/login.css"/>
<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/mobile_common.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js" ></script>
</head>
<body>
<header id="header" class='header'>
<div class="h-left"><a href="javascript:history.back(-1)"></a></div>
<div class="h-mid">找回密码</div>
</header>
<div id="tbh5v0">
<div class="find">
<section class="innercontent">
<form action="" method="post" id="fpForm" name="fpForm" class="c-form login-form">
<div class="item validate_type">
<label style=" font-size:14px;">请选择验证身份方式:</label>
<select id="validate_type" name="validate_type" class="select">
<if condition="strstr($user['username'],'@')">
<option id="validate_type_email" value="email" val="{$user.email}">邮箱</option>
<else />
<option id="validate_type_mobile" value="mobile" val="{$user.mobile}">手机</option>
</if>
</select>
</div>
<div class="v_mobile v_item">
<label>手机号:</label>
<span id="l_mobile_phone">{$user['mobile']}</span>
</div>
<div id="c_mobile_code" class="field auth-code v_item v_mobile">
<div class="codeTxt">
<input type="text" id="mobile_code" name="mobile_code" placeholder="手机验证码" class="hq_phone" />
</div>
<input id="zphone" type="button" value="获取手机验证码" class="m_phone" style="color:#FFF;"/>
</div>
<div class="email v_email v_item" style="display: none">
<label>邮箱:</label>
<span id="l_email">{$user['email']}</span>
</div>
<div id="c_email_code" class=" v_item v_email" style="display: none">
<div class="codeTxt">
<input type="text" id="email_code" name="email_code" class="hq_phone" value="" />
</div>
<div class="codePhoto">
<input id="zemail" type="button" value="获取邮箱验证码" class="m_phone" style=" color:#FFF">
</div>
</div>
<div class="submit-btn " style=" padding-top:40px;">
<input type="button" name="button" id="btn_submit" class="btn_big1" value="提 交" />
</div>
</form>
</section>
<include file="public/footer"/>
</div>
</div>
<include file="public/footer_nav"/>
<script type="text/javascript">
function show_validate_type(validate_type_obj){
var type = $(validate_type_obj).val();
var value = $("#validate_type_"+type).attr("val");
$("#l_"+type).html(value);
$(".v_item").hide();
$(".v_"+type).show();
}
function sendcode(o){
var type = $("#validate_type").val();
var send = $("#validate_type_"+type).attr("val");
$.ajax({
url:'/index.php?m=Home&c=Api&a=send_validate_code&t='+Math.random(),
type:'post',
dataType:'json',
data:{type:type,send:send,scene:2},
success:function(res){
if(res.status==1){
layer.open({content:res.msg,time:1});
countdown(o);
}else{
layer.open({content:res.msg,time:2});
}
}
})
}
$(document).ready(function(){
show_validate_type($("#validate_type"));
$("#validate_type").change(function(){
show_validate_type($(this));
});
$("#zphone").click(function(){
sendcode($(this));
});
$("#zemail").click(function(){
sendcode($(this));
});
$("#btn_submit").click(function(){
var type = $("#validate_type").val();
var send = $("#validate_type_"+type).attr("val");
if(type == 'mobile'){
if($("#mobile_code").val().length == 0){
$("#mobile_code").focus();
alert("验证码不能为空!");
return false;
}
tpcode = $("#mobile_code").val();
}else if(type == 'email'){
if($("#email_code").val().length == 0){
$("#email_code").focus();
alert("验证码不能为空!");
return false;
}
tpcode = $("#email_code").val();
}
$.ajax({
url:'/index.php?m=Home&c=Api&a=check_validate_code&t='+Math.random(),
type:'post',
dataType:'json',
data:{code:tpcode,send:send,type:type},
success:function(res){
if(res.status==1){
window.location.href = '/index.php?m=Mobile&c=User&a=set_pwd';
}else{
layer.open({content:res.msg,time:2});
}
}
})
});
});
var wait = 150;
function countdown(obj, msg) {
obj = $(obj);
if (wait == 0) {
obj.removeAttr("disabled");
obj.val(msg);
wait = 150;
} else {
if (msg == undefined || msg == null) {
msg = obj.val();
}
obj.attr("disabled", "disabled");
obj.val(wait + "秒后重新获取");
wait--;
setTimeout(function() {
countdown(obj, msg)
}, 1000)
}
}
</script>
</body>
</html>