-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.html
285 lines (252 loc) · 13 KB
/
register.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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GAMES 2023 Registration</title>
<link href="./static/css/register_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src='./static/js/jquery1.min.js'></script>
</head>
<body>
<div class='body_main'>
<div class='box_title'>
<div class='text_content'>
<h1>GAMES 2023 注册</h1>
</div>
</div>
<div class='box_main'>
<div id="register" class="register">
<div id="form">
<div id="form_submit" class="form_submit">
<div class="fieldset">
<div class="field-group">
<label class="required title">姓名</label>
<span class="control-group" id="name_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="name" name="name" value=""
onblur="__changeUserName('name');">
</div>
</span>
<label class="tips">*</label>
</div>
<div class="field-group">
<label class="required title">单位</label>
<span class="control-group" id="affiliation_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="affiliation" name="affiliation"
value="" onblur="__changeUserName('affiliation');">
</div>
</span>
<label class="tips">*</label>
</div>
<div class="field-group">
<label class="required title">职称</label>
<span class="control-group" id="title_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="title" name="title" value=""
onblur="__changeUserName('title');">
</div>
</span>
<label class="tips">*(学生请注明研究生或本科生)</label>
</div>
<div class="field-group">
<label class="required title">职务</label>
<span class="control-group" id="position_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="position" name="position" value=""
onblur="__changeUserName('position');">
</div>
</span>
</div>
<div class="field-group">
<label class="required title">研究方向</label>
<span class="control-group" id="field_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="research" name="research" value=""
onblur="__changeUserName('research');">
</div>
</span>
</div>
<div class="field-group">
<label class="required title">Email</label>
<span class="control-group" id="email_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="email" name="email" value=""
onblur="__changeUserName('email');">
</div>
</span>
<label class="tips">*</label>
</div>
<div class="field-group">
<label class="required title">电话号码</label>
<span class="control-group" id="mobile_input">
<div class="input_add_long_background">
<input class="register_input" type="text" id="mobile" name="mobile" value=""
onblur="__changeUserName('mobile');">
</div>
</span>
<label class="tips">*</label>
</div>
</div>
</div>
<div>
* <b style="color:red; margin-top: 10px;">4月15日24:00截止注册</b><br>
* <b style="color:red; margin-top: 10px;">收到报名序号才是注册成功,如果注册之后没有收到报名序号,请及时联系我们。</b>
<br>
* 若遗忘报名序号,可使用 相同姓名+手机号+相同注册类型 再次注册,返回报名序号相同。
<br>
</div>
<div id="div_submit" class="div_submit">
<div class='div_submit_button'>
<input onclick="check()" id="submit" value="注册" class='button_button disabled'>
</div>
</div>
</form>
</div>
</div>
<div class='box_bottom'></div>
</div>
<script type="text/javascript">
function __changeUserName(of) {
var username = $('#' + of).val();
if (of == 'email') {
if (username.search(/^[\w\.+-]+@[\w\.+-]+$/) == -1) {
showTooltips('email_input', '请输入正确的邮箱地址');
return;
}
} else if (of == 'mobile') {
if (username == '' || !isMobilePhone(username)) {
showTooltips('mobile_input', '请输入正确的电话号码');
return;
}
} else if (of == 'name') {
if (username == '') {
showTooltips('name_input', '请输入姓名');
return;
}
} else if (of == 'affiliation') {
if (username == '') {
showTooltips('affiliation_input', '请输入单位');
return;
}
} else if (of == 'title') {
if (username == '') {
showTooltips('title_input', '请输入职称');
return;
}
}
}
function checkEmail(email) {
if (email.search(/^.+@.+$/) == -1) {
showTooltips('email_input', '邮箱地址格式不正确');
} else {
hideTooltips('email_input');
}
}
function check() {
hideAllTooltips();
var ckh_result = true;
if ($('#name').val() == '') {
showTooltips('name_input', '姓名不能为空');
ckh_result = false;
}
if ($('#affiliation').val() == '') {
showTooltips('affiliation_input', '单位不能为空');
ckh_result = false;
}
if ($('#title').val() == '') {
showTooltips('title_input', '职称不能为空');
ckh_result = false;
}
if ($('#email').val() == '') {
showTooltips('email_input', '邮箱不能为空');
ckh_result = false;
}
if ($('#mobile').val() == '' || !isMobilePhone($('#mobile').val())) {
showTooltips('mobile_input', '手机号码不正确');
ckh_result = false;
}
if (ckh_result) {
var _data = {
"name": $('#name').val(),
"affiliation": $('#affiliation').val(),
"title": $('#title').val(),
"position": $('#position').val(),
"field": $('#research').val(),
"email": $('#email').val(),
"telnumber": $('#mobile').val()
}
$.ajax({
async: false,
url: "https://rubbly.cn/games/api/user/add",
type: "POST",
data: _data,
dataType: "jsonp",
jsonp: 'jsoncallback',
success: function (json) {
console.log(json);
var status = json.status;
if (status >= 0) {
if (confirm("报名完成,注册成功邮件已发送至您的邮箱(检查垃圾邮件)。您的报名序号为" + status + ",请牢记您的报名序号。是否关闭页面?")) {
window.opener = null;
window.open('', '_self');
window.close();
}
}
else if (status < -100) {
num = 0 - status - 100
alert("您已经报名,您的报名序号为" + num + "。您可以于注册邮箱中查收注册成功邮件(检查垃圾邮件)");
}
else {
alert(json.msg.errmsg);
}
}
});
}
return ckh_result;
}
function checkMobilePhone(telphone) {
if (telphone == '' || !isMobilePhone(telphone)) {
showTooltips('mobile_input', '请输入正确的手机号');
} else {
hideTooltips('mobile_input');
}
}
function isMobilePhone(value) {
if (value.search(/^(\+\d{2,3})?\d{11}$/) == -1)
return false;
else
return true;
}
/*Error message Tooltips*/
$(document).ready(function () {
/*点击éšè—错误æ示,如果ä¸æƒ³è®©æ示点击消失,需è¦åŠ 上class='not_click_hide'*/
$('.control-group input').not('.not_click_hide').focus(function () {
hideTooltips($(this).parent().parent().attr('id'));
});
});
function showTooltips(msgid, msg, time) {
if (msgid == '') { return; }
if (msg == '') { msg = 'Error!'; }
$('#' + msgid).prepend("<div class='for_fix_ie6_bug' style='position:relative;'><div class='tooltips_main'><div class='tooltips_box'><div class='tooltips'><div class='msg'>" + msg + "</div></div><div class='ov'></div></div></div></div>");
$('#' + msgid + ' .tooltips_main').fadeIn("slow").animate({ marginTop: "-23px" }, { queue: true, duration: 400 });
try {
if (typeof time != "undefined") {
setTimeout('hideTooltips("' + msgid + '")', time);
}
} catch (err) { }
}
function hideTooltips(msgid) {
try {
$('#' + msgid).find('.tooltips_main').fadeOut("slow");
$('#' + msgid).find('.tooltips_main').remove();
} catch (e) { }
}
function hideAllTooltips() {
$('.tooltips_main').fadeOut("slow");
$('.tooltips_main').remove();
}
/*End error message tooltips*/
</script>
</body>
</html>