-
Notifications
You must be signed in to change notification settings - Fork 0
/
book_detail.html
252 lines (246 loc) · 7.47 KB
/
book_detail.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Education</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!--标准mui.css-->
<link rel="stylesheet" href="css/mui.min.css">
<link rel="stylesheet" type="text/css" href="css/icons-extra.css" />
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css" />
<link rel="stylesheet" type="text/css" href="css/loaders.min.css" />
<link rel="stylesheet" type="text/css" href="css/loading.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/loading.animation.js" type="text/javascript"></script>
<script src="js/config.js" type="text/javascript"></script>
<style>
.title {
margin: 20px 15px 10px;
color: #6d6d72;
font-size: 17px;
font-weight: 700;
}
p label {
width: 27%;
float: left;
padding-left: 2%;
}
p span {
width: 73%;
float: right;
}
p textarea {
width: 73%;
border: 0px solid;
margin: 0px;
padding: 0px;
}
</style>
</head>
<!--loading页开始-->
<div class="loading">
<div class="loader">
<div class="loader-inner pacman">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
<!--loading页结束-->
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 id="lessonHeader" class="mui-title">预约详情</h1>
</header>
<div id="orderDetail" class="mui-content">
<div class="mui-content-padded">
<img id="imgurl" src="" width="100%"/>
</div>
<div class="title">
试听课信息
</div>
<div class="mui-card">
<div class="mui-content-padded">
<p class='mui-ellipsis'>
<label>课程名称:</label>
<span id="title"></span>
</p>
<p class='mui-ellipsis'>
<label>开课分部:</label>
<span id="branch"></span>
</p>
</div>
</div>
<div class="title">
预约信息
</div>
<div class="mui-card">
<div class="mui-content-padded">
<p class='mui-ellipsis'>
<label>预约编号:</label>
<span id="id"></span>
</p>
<p class='mui-ellipsis'>
<label>预约状态:</label>
<span id="status"></span>
</p>
<p class='mui-ellipsis'>
<label>预约时间:</label>
<span id="booktime"></span>
</p>
<p class='mui-ellipsis'>
<label>真实姓名:</label>
<span id="username"></span>
</p>
<p class='mui-ellipsis'>
<label>联系方式:</label>
<span id="tel"></span>
</p>
<p class='mui-ellipsis'>
<label>预约备注:</label>
<textarea id="refundreason" rows="3" readonly></textarea>
</p>
</div>
</div>
</div>
</body>
<script src="js/mui.min.js"></script>
<script>
mui.init({
swipeBack: true //启用右滑关闭功能
});
$(function() {
var id = ((window.location + '').split('?')[1]).split('=')[1];
jqxhr=$.ajax( {
type: "post",
url:PREPATH + "/user/selectFreeListenBookById",
async: true,
data: {id: id},
dataType: "json",
headers:{
"X-Requested-With":"XMLHttpRequest"
},
xhrFields: {
withCredentials: true
},
crossDomain: true,
success: function(data) {
//注入订单详情信息
$("#imgurl").attr('src', IMGPATH + data.imgurl);
$("#title").text(data.title);
$("#total").text(data.total);
$("#branch").text(data.branch);
$("#id").text(data.id);
$("#status").text(data.status);
$("#booktime").text((data.booktime).substring(0,19));
$("#username").text(data.username);
$("#tel").text(data.tel);
$("#comment").val(data.comment);
//加载页面按钮
if (data.status === "待处理") {
var btnHtml = '';
btnHtml += '<div class="mui-content-padded" style="float: right;">';
btnHtml += ' <button id="cancelFreeListenBookUnprocessed" type="button" class="mui-btn mui-btn-primary mui-btn-outlined"';
btnHtml += ' data-loading-text="取消中" data-loading-icon-position="right" style="font-size: 15px;">';
btnHtml += ' <span style="padding-right: 1px;">取消试听课预约</span>';
btnHtml += ' <span class="mui-icon mui-icon-close"></span>';
btnHtml += ' </button>';
btnHtml += '</div>';
$("#orderDetail").append(btnHtml);
$("#cancelFreeListenBookUnprocessed").click(function() {
mui.ajax(PREPATH + "/user/cancelFreeListenBookUnprocessed", {
type: "post",
async: true,
data: {id: id},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
beforeSend: function() {
mui($("#cancelFreeListenBookUnprocessed")).button('loading');
setTimeout("",5000);
},
success: function(data) {
mui($("#cancelFreeListenBookUnprocessed")).button('reset');
if (data.state === 1) {
mui.toast("取消成功");
mui.openWindow({
url: "my_reservations.html"
});
}
else {
mui.toast("取消失败");
}
},
error: function() {
mui.toast("取消失败");
}
});
});
}
else if (data.status === "已处理") {
var btnHtml = '';
btnHtml += '<div class="mui-content-padded" style="float: right;">';
btnHtml += ' <button id="deleteFreeListenBookProcessed" type="button" class="mui-btn mui-btn-primary mui-btn-outlined"';
btnHtml += ' data-loading-text="删除中" data-loading-icon-position="right" style="font-size: 15px;">';
btnHtml += ' <span style="padding-right: 1px;">删除预约记录</span>';
btnHtml += ' <span class="mui-icon mui-icon-trash"></span>';
btnHtml += ' </button>';
btnHtml += '</div>';
$("#orderDetail").append(btnHtml);
$("#deleteFreeListenBookProcessed").click(function() {
mui.ajax(PREPATH + "/user/deleteFreeListenBookProcessed", {
type: "post",
async: true,
data: {id: id},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
beforeSend: function() {
mui($("#deleteFreeListenBookProcessed")).button('loading');
setTimeout("",5000);
},
success: function(data) {
mui($("#deleteFreeListenBookProcessed")).button('reset');
if (data.state === 1) {
mui.toast("删除成功");
mui.openWindow({
url: "my_reservations.html"
});
}
else {
mui.toast("删除失败");
}
},
error: function() {
mui.toast("删除失败");
}
});
});
}
else {
mui.toast("系统出错");
}
},
error: function() {
mui.toast("信息获取失败");
}
})
})
</script>
</html>