-
Notifications
You must be signed in to change notification settings - Fork 0
/
refund.html
177 lines (168 loc) · 4.99 KB
/
refund.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
<!DOCTYPE html>
<html class="ui-page-login">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>Education</title>
<link href="css/mui.min.css" rel="stylesheet" />
<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/config.js" type="text/javascript"></script>
<script src="js/loading.animation.js" type="text/javascript"></script>
<style>
.title {
margin: 15px 15px 0px;
color: #6d6d72;
font-size: 18px;
font-weight: 900;
}
.mui-icon-clear {
margin-top: 8px;
}
</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 class="mui-title">申请退款</h1>
</header>
<div class="mui-content">
<div class="mui-content-padded" style="margin: 10px;">
<form class="mui-input-group">
<div class="mui-input-row" style="height: 50px; padding: 8px;">
<label>订单编号</label>
<input id="lessonTitle" type="text" value="" readonly>
</div>
<div class="mui-input-row" style="height: 50px; padding: 8px;">
<label>课程名称</label>
<input id="lname" type="text" value="" readonly>
</div>
<div class="mui-input-row" style="height: 50px; padding: 8px;">
<label>应退费用</label>
<input id="actual" type="text" value="" style="width: 57%; float: none;" readonly>
<span style="width: 5%;">¥</span>
</div>
<div class="mui-input-row" style="height: 160px; padding: 8px;">
<label>退款理由</label>
<textarea id="refundreason" rows="5" placeholder="请说明退款理由,亲"></textarea>
</div>
<div class="mui-button-row" style="height: 60px; padding: 10px;">
<button id="reserve" type="button" class="mui-btn mui-btn-primary" style="width: 40%; height: 40px; font-size: 16px;">
申请退款
</button>
</div>
</form>
</div>
</div>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">
//mui初始化
mui.init({
swipeBack: true //启用右滑关闭功能
});
var parameters = ((window.location + '').split('?')[1]).split('='); // ?oid=0
var oid = parameters[1];
getLesson(oid);
function getLesson(oid) {
jqxhr = $.ajax( {
type: "post",
async: true,
url:PREPATH+"/user/selectRefundInfoByOID",
data: {
oid: oid
},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
success: function(data) { // lname ,lprice , refundreason
$("#lessonTitle").val(data.oid);
$("#lname").val(data.lname);
console.log(data.actual);
$("#actual").val(data.actual + '¥');
},
error: function(xhr, type, errorThrown) {
//异常处理;
mui.alert('服务器异常', '提示', function() {
});
}
});
}
function saveRefund(oid, refundreason) {
jqxhr=$.ajax( {
type: "post",
async: true,
url:PREPATH+"/user/saveRefund",
data: {
oid: oid,
refundreason: refundreason
},
dataType: "json",
xhrFields: {
withCredentials: true
},
headers:{
"X-Requested-With":"XMLHttpRequest"
},
crossDomain: true,
success: function(data) {
if(data.state == 1) {
mui.alert('申请成功', '提示', function() {
mui.openWindow({
url: 'my_orders.html',
id: 'my_orders.html'
});
});
} else {
mui.alert('申请失败', '提示', function() {
mui.openWindow({
url: 'my_orders.html',
id: 'my_orders.html'
});
});
}
},
error: function(xhr, type, errorThrown) {
mui.alert('申请失败', '提示', function() {
mui.openWindow({
url: 'my_orders.html',
id: 'my_orders.html'
});
});
}
});
}
document.getElementById("reserve").addEventListener('tap', function() {
var reason = $('#refundreason').val();
if(reason==""){
mui.toast("请说明退款理由,亲");
return;
}
var btnArray = ['是', '否'];
mui.confirm('是否确定申请退款?', '提示', btnArray, function(e) {
if(e.index == 0) {
saveRefund(oid, reason);
}
})
});
</script>
</body>
</html>