-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclass.html
511 lines (483 loc) · 19.4 KB
/
class.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Color theme for statusbar -->
<meta name="theme-color" content="#000">
<!-- Your app title -->
<title>班级</title>
<!-- Path to Framework7 Library CSS -->
<link rel="stylesheet" href="css/framework7.css">
<link rel="stylesheet" href="css/framework7-icons.css">
<link rel="stylesheet" href="css/style.css">
<style>
.ios a {
color: black;
}
</style>
</head>
<body>
<div id="app">
<div class="view view-main view-init">
<div class="navbar">
<div class="navbar-inner">
<div class="left">
<a href="#" class="item-link icon" id="back" style="color: white;">
<i class="icon f7-icons" style="font-size: 25px">chevron_left</i>
</a>
</div>
<div class="title">我的班级</div>
<div class="right"></div>
</div>
</div>
<!-- 工具栏标签 -->
<div class="toolbar tabbar-labels">
<div class="toolbar-inner">
<a href="index.html" class="tab-link an-button link external">
<!-- Different icons for iOS and MD themes -->
<i class="icon f7-icons ios-only">home_fill</i>
<span class="tabbar-label">首页</span>
</a>
<a href="#" class="tab-link-active an-button link external">
<!-- Different icons for iOS and MD themes -->
<i class="icon f7-icons ios-only">book_fill</i>
<span class="tabbar-label">作业</span>
</a>
<a href="classmates.html" class="tab-link an-button link external">
<i class="icon f7-icons ios-only">persons_fill</i>
<span class="tabbar-label active-state">成员</span>
</a>
<!-- <a href="#" class="tab-link an-button">
<i class="icon f7-icons ios-only">chat_fill
<span class="badge color-red">5</span>
</i>
<span class="tabbar-label">消息</span>
</a> -->
</div>
</div>
<div class=" page-content">
<div class="list media-list annotator">
<ul>
<li>
<div class="item-content class">
<div class="item-media">
<img src="images/teacher.jpg" width="44" />
</div>
<div class="item-inner">
<div class="item-title">
<div class="item-title" id="classname"></div>
</div>
<div class="item-subtitle">教师:张宇宙老师</div>
</div>
</div>
</li>
</ul>
</div>
<div class="list class">
<ul>
<!-- 未完成作业栏 -->
<li class="accordion-item accordion-item-opened">
<a href="#" class="item-content item-link">
<div class="item-inner">
<div class="item-title">未完成的作业</div>
<div class="item-after">
<span class="badge color-red" id="unfinnum">0</span>
</div>
</div>
</a>
<div class="accordion-item-content">
<div class="list media-list">
<ul class="unfinish0">
</ul>
</div>
</div>
</li>
<!-- 已完成作业栏 -->
<li class="accordion-item">
<a href="#" class="item-content item-link">
<div class="item-inner">
<div class="item-title">已完成的作业</div>
<div class="item-after">
<span class="badge" id="finnum">0</span>
</div>
</div>
</a>
<div class="accordion-item-content">
<div class="list media-list">
<ul class="finish0">
</ul>
</div>
</div>
</li>
<li class="accordion-item">
<a href="#" class="item-content item-link">
<div class="item-inner">
<div class="item-title">教师讲义</div>
<div class="item-after">
<span class="badge" id="notenum">0</span>
</div>
</div>
</a>
<div class="accordion-item-content">
<div class="list media-list">
<ul id="handout">
</ul>
</div>
</div>
</li>
<li class="accordion-item accordion-item">
<a href="#" class="item-content item-link">
<div class="item-inner">
<div class="item-title">优秀作业</div>
<div class="item-after">
<span class="badge" id="greatnum">0</span>
</div>
</div>
</a>
<div class="accordion-item-content">
<div class="list media-list">
<ul class="great0">
</ul>
</div>
</div>
</li>
<li class="accordion-item accordion-item">
<a href="#" class="item-content item-link">
<div class="item-inner">
<div class="item-title">未能按时完成的作业</div>
<div class="item-after">
<span class="badge" id="undonum">0</span>
</div>
</div>
</a>
<div class="accordion-item-content">
<div class="list media-list">
<ul class="undo">
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<script src="js/framework7.min.js"></script>
<script src="js/app.js"></script>
<script src="js/jquery.min.js"></script>
<script>
// 返回按钮
var back = document.getElementById("back");
if (back) {
back.addEventListener('touchstart', function () {
window.history.back(-2);
})
};
function getcontent(text) {
var html = text;
return html.replace(/<[^>]*>|/g, "");
}
function getDateDiff(dateTimeStamp) {
var dateTimeStamp = new Date(Date.parse(dateTimeStamp.replace(/-/gi, "-")));
dateTimeStamp = dateTimeStamp.getTime();
var result;
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var halfamonth = day * 15;
var month = day * 30;
var now = new Date().getTime();
var diffValue = now - dateTimeStamp;
if (diffValue < 0) {
return;
}
var monthC = diffValue / month;
var weekC = diffValue / (7 * day);
var dayC = diffValue / day;
var hourC = diffValue / hour;
var minC = diffValue / minute;
if (monthC >= 1) {
if (monthC <= 12)
result = "" + parseInt(monthC) + "个月前";
else {
result = "" + parseInt(monthC / 12) + "年前";
}
} else if (weekC >= 1) {
result = "" + parseInt(weekC) + "周前";
} else if (dayC >= 1) {
result = "" + parseInt(dayC) + "天前";
} else if (hourC >= 1) {
result = "" + parseInt(hourC) + "小时前";
} else if (minC >= 1) {
result = "" + parseInt(minC) + "分钟前";
} else {
result = "刚刚";
}
return result;
};
//获取登录者id
// $.ajax({
// url: 'http://212.64.11.56:8080/EAnnotation/getCurrentUser',
// type: 'post',
// dataType: 'jsonp',
// xhrFields: {
// withCredentials: true
// },
// crossDomain: true,
// success: function (data) {
// localStorage.id = data.id;
// },
// error: function () {}
// })
var num = 0,
num1 = 0,
num2 = 0,
num3 = 0,
num4 = 0;
// 获取所有作业
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/getAllHomework?studentId=' + localStorage.id + '&classId=' +
localStorage.classid,
type: "post",
success: function (data) {
//获取现在的时间
var now = new Date().getTime();
$.each(data, function (i, item) {
//比较时间大小
var endtime = item.endTime;
endtime = new Date(Date.parse(endtime.replace(/-/gi, "-")));
endtime = endtime.getTime();
if (item.finish == false && now < endtime) {
num++;
$('#unfinnum').text(num);
$("ul[class=unfinish0]").append(
` <li class="swipeout ">
<div class="swipeout-content">
<label class="item-content item-checkbox" ontouchstart="window.location.href='subanntator.html?id=` +
item.passageId +
`'">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">
<a href="subanntator.html?id=` +
item.passageId + `" class="link external" style="display: inline;">` + item.passageTitle +
`</a>
</div>
</div>
<div class="item-subtitle">` +
item.passageTheme + ` · ` + item.endTime +
`截止</div>
<div class="item-text">
` +
getcontent(item.passageContent) +
`
</div>
</div>
</label>
</div>
<div class="swipeout-actions-left">
<a href="#" class="color-green swipeout-overswipe alert-reply">Reply</a>
<a href="#" class="color-blue alert-forward">Forward</a>
</div>
<div class="swipeout-actions-right">
<a href="#" class="color-orange alert-mark">置顶</a>
<a href="#" data-confirm="您确定要删除该次作业记录吗?" class="swipeout-delete swipeout-overswipe">删除</a>
</div>
</li>`
);
//已经截止的但是没做完的放到未能按时完成列表
} else if (item.finish == false && now > endtime) {
num4++;
$('#undonum').text(num4);
$("ul[class=undo]").append(
` <li class="swipeout ">
<div class="swipeout-content">
<label class="item-content item-checkbox" ontouchstart="window.location.href='#">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">
<a href="#" class="link external" style="display: inline;">` +
item.passageTitle +
`</a>
</div>
</div>
<div class="item-subtitle">` +
item.passageTheme + ` · ` + item.endTime +
`截止</div>
<div class="item-text">
` +
getcontent(item.passageContent) +
`
</div>
</div>
</label>
</div>
<div class="swipeout-actions-left">
<a href="#" class="color-green swipeout-overswipe alert-reply">Reply</a>
<a href="#" class="color-blue alert-forward">Forward</a>
</div>
<div class="swipeout-actions-right">
<a href="#" class="color-orange alert-mark">置顶</a>
<a href="#" data-confirm="您确定要删除该次作业记录吗?" class="swipeout-delete swipeout-overswipe">删除</a>
</div>
</li>`
)
} else if (item.finish == true) {
num1++;
$('#finnum').text(num1);
if (item.score == "未批改") {
var score = "";
} else {
var score = "成绩:";
}
$("ul[class=finish0]").append(
` <li class="swipeout ">
<div class="swipeout-content">
<label class="item-content item-checkbox" ontouchstart="window.location.href='stucompelet.html?id=` +
item.id +
`'">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">
<a href="stucompelet.html?id=` +
item.id + `" class="link external" style="display: inline;">` + item.passageTitle +
`</a>
</div>
<div class="item-after">` +
score + `<span class="red">` + item.score +
`</span></div>
</div>
<div class="item-subtitle">` +
item.passageTheme + ` · ` + item.endTime +
`截止</div>
<div class="item-text">
` +
getcontent(item.passageContent) +
`
</div>
</div>
</label>
</div>
<div class="swipeout-actions-left">
<a href="#" class="color-green swipeout-overswipe alert-reply">Reply</a>
<a href="#" class="color-blue alert-forward">Forward</a>
</div>
<div class="swipeout-actions-right">
<a href="#" class="color-orange alert-mark">置顶</a>
<a href="#" data-confirm="您确定要删除该次作业记录吗?" class="swipeout-delete swipeout-overswipe">删除</a>
</div>
</li>`
)
}
})
},
error: function (e) {}
})
//讲义列表
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/getHandout?classId=' + localStorage.classid,
type: "post",
success: function (data) {
$.each(data, function (i, item) {
num2++;
$('#notenum').text(num2);
$('#handout').append(
` <li class="swipeout ">
<div class="swipeout-content">
<label href="#" class="item-content item-checkbox" ontouchstart="window.location.href='handoutStudent.html?id=` +
item.id + `&teacherId=` + item.teacherId +
`'">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">
<a href="handoutStudent.html?id=` +
item.id + `&teacherId=` + item.teacherId +
`" class="link external" style="display: inline;">` + item.title +
`</a>
</div>
</div>
<div class="item-subtitle">` +
item.theme + ` · ` + getDateDiff(item.releaseTime) +
`</div>
<div class="item-text">
` +
getcontent(item.content) +
`
</div>
</div>
</label>
</div>
<div class="swipeout-actions-left">
<a href="#" class="color-green swipeout-overswipe alert-reply">Reply</a>
<a href="#" class="color-blue alert-forward">Forward</a>
</div>
<div class="swipeout-actions-right">
<a href="#" class="color-orange alert-mark">置顶</a>
<a href="#" data-confirm="您确定要删除该次作业记录吗?" class="swipeout-delete swipeout-overswipe">删除</a>
</div>
</li>`
)
})
}
});
//优秀作业列表
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/getExcellent?classId=' + localStorage.classid,
type: "post",
success: function (data) {
$.each(data, function (i, item) {
num3++;
$('#greatnum').text(num3);
$("ul[class=great0]").append(
` <li class="swipeout ">
<div class="swipeout-content">
<label href="#" class="item-content item-checkbox" ontouchstart="window.location.href='great.html?id=` +
item.passageId + `&userId=` + item.userId +
`&author=` + item.userName +
`'&scoreId=`+ item.id +`">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">
<a href="great.html?id=` +
item.passageId + `&userId=` + item.userId +
`&scoreId=`+ item.id +`&author=` + item.userName + `" class="link external" style="display: inline;">` + item.title +
`</a>
</div>
</div>
<div class="item-subtitle">` +
item.theme + ` · 批注人: ` + item.userName +
`</div>
<div class="item-text">
` +
getcontent(item.content) +
`
</div>
</div>
</label>
</div>
<div class="swipeout-actions-left">
<a href="#" class="color-green swipeout-overswipe alert-reply">Reply</a>
<a href="#" class="color-blue alert-forward">Forward</a>
</div>
<div class="swipeout-actions-right">
<a href="#" class="color-orange alert-mark">置顶</a>
<a href="#" data-confirm="您确定要删除该次作业记录吗?" class="swipeout-delete swipeout-overswipe">删除</a>
</div>
</li>`
)
})
}
});
//班级列表
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/getClassById?id=' + localStorage.classid,
type: 'POST',
success: function (data) {
$('#classname').html(data.className);
}
});
</script>
</body>
</html>