-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
179 lines (178 loc) · 5.58 KB
/
index.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>教务系统查询</title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<link rel="stylesheet" href="css/weui.css"/>
<link rel="stylesheet" href="css/weui2.css"/>
<link rel="stylesheet" href="css/weui3.css"/>
<script src="js/zepto.min.js"></script>
</head>
<body ontouchstart style="background-color: #f8f8f8;">
</div>
<div class="form">
<div class="weui-header bg-blue">
<h1 class="weui-header-title">成绩查询</h1>
<div class="weui-header-right">
</div>
</div>
<div class="weui_cells_title">
请输入下列信息查询成绩信息
</div>
<div class="weui_cells weui_cells_form">
<div class="weui_cell weui_cell_select weui_select_after">
<div class="weui_cell_hd">
<label for="" class="weui_label">学期</label>
</div>
<div class="weui_cell_bd weui_cell_primary">
<select class="weui_select" name="xueqi" id="xueqi">
<!--系统默认通过semeter.php加载选项,开发者可删除自己设置,格式为
<option value="2016-2017*1">2016-2017 第1学期</option>
<option value="2016-2017*2">2016-2017 第2学期</option>
<option value="2016-2017*3">2016-2017 第3学期</option>
-->
</select>
</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd">
<label class="weui_label">用户名</label>
</div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" type="number" pattern="[0-9]*" placeholder="请输入用户名" name="number"/>
</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd">
<label class="weui_label">密码</label>
</div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" type="password" placeholder="请输入密码" name="password"/>
</div>
</div>
<div class="weui_cell weui_vcode">
<div class="weui_cell_hd">
<label class="weui_label">验证码</label>
</div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" type="text" placeholder="请输入验证码" name="yzm"/>
</div>
<div class="weui_cell_ft">
<i class="weui_icon_warn"></i>
<div id="img"></div>
</div>
</div>
</div>
<script>
$(function(){
$.ajax({
url: 'code/semester.php', //请求的url地址
type : 'GET',
dataType:"json",
async : false,
success : function (response, stutas, xhr) {
var data = eval(response); //数组
$('input[name=number]').val(data['number']);
$('#xueqi').prepend(data['data']);
}
});
$.ajax({
url: 'code/captcha.php', //请求的url地址
type : 'GET',
dataType:"json",
async : false,
success : function (response, stutas, xhr) {
var data = eval(response); //数组
$('input[name=yzm]').val(data['captcha']);
$('#img').prepend("<img src="+data['image']+">");
}
});
var max = $('#count_max').text();
$('#textarea').on('input', function(){
var text = $(this).val();
var len = text.length;
$('#count').text(len);
if(len > max){
$(this).closest('.weui_cell').addClass('weui_cell_warn');
}
else{
$(this).closest('.weui_cell').removeClass('weui_cell_warn');
}
});
$('.weui-header-right').live("click",function(){
if($(this).html()=='简易版'){
$(this).text('标准版');
$('.weui-form-preview').hide();
$('.weui-table').show();
}else{
$(this).text('简易版');
$('.weui-form-preview').show();
$('.weui-table').hide();
}
});
$('#ok').click(function(){
if(($('#xueqi').val().length)=='0'){
$.toast("请选择一个学期", "cancel");
return false;
}
if(($('input[name=number]').val().length)=='0'){
$.toast("请输入用户名", "cancel");
return false;
}
if(($('input[name=password]').val().length)=='0'){
$.toast("请输入密码", "cancel");
return false;
}
if(($('input[name=yzm]').val().length)=='0'){
$.toast("请输入验证码", "cancel");
return false;
}
var xueqi=$('#xueqi').val();
var number=$('input[name=number]').val();
var password=$('input[name=password]').val();
var code=$('input[name=yzm]').val();
$.ajax({
url: 'code/score.php', //请求的url地址
type : 'POST',
dataType : "json", //json类型
data : {
xueqi : xueqi, number : number, password : password, yzm : code
},
async : true,
beforeSend: function() {
$.showLoading();
},
success : function (response, stutas, xhr) {
$.hideLoading();
var info = eval(response);
if(!isNaN(info['code'])){
$.toast(info['error'], "cancel");
setTimeout(function () {
location.reload();
}, 1500);
}else{
$('.form').hide();
$('.info').html(info['data']);
}
}
});
});
});
</script>
<div class="weui_btn_area">
<button class="weui_btn weui_btn_primary" id="ok">确定</a>
</div>
<br/>
<div class="weui-footer">
<p class="weui-footer-text">
Copyright © 邢益堂
</p>
</div>
</div>
</form>
</div> </div>
<div class="info">
</div>
</body>
</html>