-
Notifications
You must be signed in to change notification settings - Fork 0
/
refund_detail.html
286 lines (279 loc) · 8.32 KB
/
refund_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
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
<!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="lname"></span>
</p>
<p class='mui-ellipsis'>
<label>课程费用:</label>
<span id="total"></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="oid"></span>
</p>
<p class='mui-ellipsis'>
<label>订单状态:</label>
<span id="status"></span>
</p>
<p class='mui-ellipsis'>
<label>实付费用:</label>
<span id="actual"></span>
</p>
<p class='mui-ellipsis'>
<label>下单时间:</label>
<span id="ordertime"></span>
</p>
<p class='mui-ellipsis'>
<label>真实姓名:</label>
<span id="username"></span>
</p>
<p class='mui-ellipsis'>
<label>联系方式:</label>
<span id="tel"></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="refundmoney"></span>
</p>
<p class='mui-ellipsis'>
<label>退款状态:</label>
<span id="refundstatus"></span>
</p>
<p class='mui-ellipsis'>
<label>退款时间:</label>
<span id="refundtime"></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 oid = ((window.location + '').split('?')[1]).split('=')[1];
jqxhr=$.ajax({
type: "post",
async: true,
url:PREPATH + "/user/selectRefundByOID",
data: {oid: oid},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
success: function(data) {
//注入订单详情信息
$("#imgurl").attr('src', IMGPATH + data.imgurl);
$("#lname").text(data.lname);
$("#total").text(data.total);
$("#branch").text(data.branch);
$("#oid").text(data.oid);
$("#status").text(data.status);
$("#actual").text(data.actual);
$("#ordertime").text((data.ordertime).substring(0,19));
$("#username").text(data.username);
$("#tel").text(data.tel);
$("#refundmoney").text(data.actual);
$("#refundstatus").text(data.refundstatus);
$("#refundtime").text((data.refundtime).substring(0,19));
$("#refundreason").val(data.refundreason);
console.log(data.status);
//加载页面按钮
if (data.status === "退款中") {
var btnHtml = '';
btnHtml += '<div class="mui-content-padded" style="float: right;">';
btnHtml += ' <button id="cancelRefundUnprocessed" 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);
console.log(data.status);
$("#cancelRefundUnprocessed").click(function() {
jqxhr=$.ajax( {
type: "post",
async: true,
url:PREPATH + "/user/cancelRefundUnprocessed",
data: {oid: data.oid},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
beforeSend: function() {
mui($("#cancelRefundUnprocessed")).button('loading');
},
success: function(data) {
mui($("#cancelRefundUnprocessed")).button('reset');
if (data.state === 1) {
mui.toast("取消成功");
mui.openWindow({
url: "my_orders.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="deleteSorderRefunded" 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);
$("#deleteSorderRefunded").click(function() {
jqxhr=$.ajax( {
type: "post",
async: true,
url:PREPATH + "/user/deleteSorderRefunded",
data: {oid: oid},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
beforeSend: function() {
mui($("#deleteSorderRefunded")).button('loading');
},
success: function(data) {
mui($("#deleteSorderRefunded")).button('reset');
if (data.state === 1) {
mui.toast("删除成功");
mui.openWindow({
url: "my_orders.html"
});
}
else {
mui.toast("删除失败");
}
},
error: function() {
mui.toast("删除失败");
}
});
});
}
else {
mui.toast("系统出错");
}
},
error: function() {
mui.toast("信息获取失败");
}
})
})
</script>
</html>