-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclasslistTeacher.html
205 lines (189 loc) · 6.42 KB
/
classlistTeacher.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
<!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;
}
.popup.create {
top: unset;
bottom: 30%;
height: 50%;
}
.create_title {
font-size: 25px;
margin: 10px auto;
text-align: center;
}
</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 toolbar-bottom-md fab-morph-target tabbar-labels">
<div class="toolbar-inner">
<a class="link popup-open" href="#" data-popup=".popup2">创建班级</a>
<a class="link fab-close">取消</a>
</div>
</div>
<div class="fab fab-right-bottom fab-morph" data-morph-to=".toolbar">
<a href="#">
<i class="icon f7-icons ios-only">add</i>
<i class="icon f7-icons ios-only">close</i>
<i class="icon material-icons md-only">add</i>
<i class="icon material-icons md-only">close</i>
</a>
</div>
<div class="popup popup2 create">
<div class="create_title">创建班级</div>
<div class="list">
<ul>
<li class="item-content item-input">
<div class="item-inner">
<!-- <div class="item-title item-label text-center" style="font-size: 20px;">班级名</div> -->
<div class="item-input-wrap size-20" style="width: 70%;margin-left: 25%;">
<div class="name-iuput">
<i class="icon f7-icons">layers_fill</i>
</div>
<input type="text" name="classname" placeholder="请输入班级名" style="width: 80%;margin-left: 35px;">
</div>
</div>
</li>
</ul>
</div>
<div class="bottom text-center">
<button class="col button color-white size-16 popup-close create_btn margin0-auto bgcolor " id="create">创建</button>
<a class="link popup-close margin-top10 size-16" href="#">关闭</a>
</div>
</div>
<div class=" page-content">
<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="course">
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<script src="js/framework7.min.js"></script>
<script src="js/app.js"></script>
<script src="js/rangy-core.js"></script>
<script src="js/rangy-classapplier.js"></script>
<script src="js/jquery.min.js"></script>
<script>
// 返回按钮
var back = document.getElementById("back");
if (back) {
back.addEventListener('touchstart', function () {
window.history.back(-1);
})
};
// 获取所有班级
$(function () {
allClass()
})
function allClass() {
//情况列表防止重复
$("ul[class=course]").html("");
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/getAllClassByTech?teacherId=' + localStorage.id + '',
type: "post",
success: function (data) {
$.each(data, function (i, item) {
$("ul[class=course]").append(
`<li>
<a href="classteacher.html?name=` + item.className +
`" class="link item-content external" ontouchstart="pushclass(` + item.classId +
`)">
<div class="item-media"><img src="images/teacher.jpg" width="44"/></div>
<div class="item-inner">
<div class="item-title">
<div class="item-title">` +
item.className +
`</div>
</div>
</div>
</a>
</li>`
)
})
},
error: function (e) {}
})
}
function pushclass(id) {
localStorage.classid = id;
}
//创建班级ajax
$("#create").on("touchstart", function () {
create();
});
function create() {
var name = $("input[name='classname']").val();
$.ajax({
url: 'http://212.64.11.56:8080/EAnnotation/createClass?teacherId=' + localStorage.id + '&name=' + name,
type: "post",
success: function (data) {
//重新刷新我的班级列表
allClass();
$("input[name='classname']").val("");
app.dialog.create({
text: '创建成功',
buttons: [{
text: '确定',
}, ],
verticalButtons: true,
}).open();
},
error: function (e) {
app.dialog.create({
text: '创建失败',
buttons: [{
text: '确定',
}, ],
verticalButtons: true,
}).open();
}
})
}
</script>
</body>
</html>