login.html
6.2 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
208
209
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<include file="public@head_common"/>
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/register_login/login.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/augly.css" />
<title>登录</title>
<style>
html,body {
display: flex;
flex-flow: column;
background: url("__TMPL__/public/mobile/images/login_bg.png") center no-repeat;
background-size: 100% 100%;
overflow: hidden;
margin: 0;
/*background-attachment: fixed;*/
}
.container {
display: flex;
flex: 1;
flex-direction: column;
overflow: auto;
}
.footer {
display: flex;
position: relative;
height: 1rem;
color: #BBBBBB;
background-color: #FFFFFF;
box-shadow: 0.1rem 0.1rem 0.2rem rgba(0,0,0,0.6);
}
.get_num {
position: absolute;
font-size: 0.28rem;
color: #F4AC30;
line-height: 1rem;
right: 1rem;
}
/*.footbac{*/
/*background: url(__TMPL__/public/mobile/images/footbac.png) repeat-x;*/
/*background-size: 100% 100%;*/
/*}*/
</style>
</head>
<body>
<div class="test_num"></div>
<div class="header">
<div class="return">
<span class="back_href">
<i class="iconfont icon-jiantou-copy"></i>返回
</span>
</div>
登录
</div>
<div class="container">
<!--<div class="header_wrap"></div>-->
<!--banner-->
<div class="login_img">
<div class="baby_img">
<img src="__TMPL__/public/mobile/images/login_pic1.png" class="img_detail" />
</div>
<div class="login_text">
<p>用户登录</p>
<span>仅限天津及唐山地区用户</span>
</div>
</div>
<div class="input_num">
<i class="iconfont icon-icon--"></i>
<input type="text" name="mobile" id="mobile" value="" class="input_text" placeholder="请输入手机号" />
</div>
<div class="input_num">
<i class="iconfont icon-duanxin"></i>
<input type="text" name="code" id="code" value="" class="input_text" placeholder="请输入验证码" />
<p class="get_num">获取验证码</p>
</div>
<div class="btn">
登录
</div>
<p class="no_num">还没有账号,<span class="to_register">去注册</span></p>
<div class="bottom_icon">
<img src="__TMPL__/public/mobile/images/biglogo@2x.png" class="bottom_img" />
<p class="bottom_text">{$site_info.site_name}</p>
</div>
</div>
<div class="footbac"></div>
<script src="__TMPL__/public/mobile/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/swiper-4.3.5.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var h=$(window).height();
$("body").height(h+"px")
$('.to_register').click(function(){
window.location.href = "{:url('user/Register/index')}";
});
var popup_switch = true;
$('.btn').click(function() {
var mobile = $('input[name=mobile]').val();
var reg = /^1(3|4|5|7|8|9)\d{9}$/;
var code = $('input[name=code]').val();
if(!(reg.test(mobile))){
_error("手机号码错误");
return false;
} else if(code.length != 6){
_error("验证码错误");
return false;
} else {
var data = {
mobile: mobile,
code: code
};
$.ajax({
url: "{:url('user/Login/doLogin')}",
type: "POST",
data: data,
dataType: "JSON",
success: function (res) {
console.log(res);
if (res.code == 1) {
_error(res.msg);
setTimeout(function() {
window.location.href = res.url;
},1000);
} else {
_error(res.msg);
}
}
});
}
});
var get_switch = true;
$('.get_num').click(function() {
var mobile = $('input[name=mobile]').val();
var reg = /^1(3|4|5|7|8|9)\d{9}$/;
if(!(reg.test(mobile))){
_error("手机号码错误");
return false;
} else {
if(get_switch) {
var data = {
mobile: mobile,
is_login: 1
};
$.ajax({
url: "{:url('user/Common/sendCode')}",
type: "POST",
data: data,
dataType: "JSON",
success: function (res) {
console.log(res);
if (res.code == 1) {
_error(res.msg);
get_switchs();
} else {
_error(res.msg);
}
}
});
}
}
});
// 弹窗提示
function _error(test) {
if(popup_switch) {
popup_switch = false;
$('.test_num').html(test);
$('.test_num').removeClass('Augly-fadeout');
$('.test_num').addClass('Augly-fadein');
$('.test_num').show();
setTimeout(function() {
$('.test_num').removeClass('Augly-fadein');
$('.test_num').addClass('Augly-fadeout');
popup_switch = true
}, 1500)
} else {
popup_switch = true
}
}
// 倒计时
function get_switchs() {
console.log(get_switch);
if(get_switch) {
get_switch = false;
$('.get_num').html('60' + 's')
var num = parseInt(60);
var timer = setInterval(function() {
if(parseInt($('.get_num').html()) > 1) {
num--
$('.get_num').html(num + 's')
} else {
get_switch = true;
$('.get_num').html('获取')
clearInterval(timer)
}
}, 1000)
}
}
</script>
</body>
</html>