|
@@ -1,122 +1,127 @@
|
1
|
1
|
<template>
|
2
|
2
|
<view class="page">
|
3
|
3
|
<cu-custom :isBack="true"></cu-custom>
|
4
|
|
- <view class="header" :style="[{top:topHeader + 'px'}]">
|
|
4
|
+ <view class="header" :style="[{ top: topHeader + 'px' }]">
|
5
|
5
|
<view class="header-title">
|
6
|
6
|
<view class="header-title-main">
|
7
|
|
- <view class="margin-bottom-xs">{{title}}</view>
|
|
7
|
+ <view class="margin-bottom-xs">{{ title }}</view>
|
8
|
8
|
<view class="point"></view>
|
9
|
9
|
</view>
|
10
|
10
|
</view>
|
11
|
11
|
<swiper-tab :menuList="menuList" @changeTab="changeTab" :activeTab="currentIndex"></swiper-tab>
|
12
|
12
|
</view>
|
13
|
|
- <scroll-view scroll-y="true" class="scroll-main" :style="[{height:'calc(100vh - 74px - '+ topHeader+'px)'}]"
|
14
|
|
- :refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="onRefresh"
|
15
|
|
- @scrolltolower="loadMore">
|
16
|
|
- <view class="list" v-if="params.type<7">
|
17
|
|
- <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in orders" :key="index">
|
|
13
|
+ <scroll-view
|
|
14
|
+ scroll-y="true"
|
|
15
|
+ class="scroll-main"
|
|
16
|
+ :style="[{ height: 'calc(100vh - 74px - ' + topHeader + 'px)' }]"
|
|
17
|
+ :refresher-enabled="true"
|
|
18
|
+ :refresher-triggered="triggered"
|
|
19
|
+ @refresherrefresh="onRefresh"
|
|
20
|
+ @scrolltolower="loadMore"
|
|
21
|
+ >
|
|
22
|
+ <view class="list" v-if="params.type < 7">
|
|
23
|
+ <view class="cu-card margin-top margin-bottom shadow" v-for="(item, index) in orders" :key="index">
|
18
|
24
|
<view class="cu-item">
|
19
|
25
|
<view class="card-header flex justify-between solid-bottom">
|
20
|
|
- <view>{{index}}</view>
|
|
26
|
+ <view>{{ index }}</view>
|
21
|
27
|
<view class="text-student course-status">
|
22
|
|
- {{item.status|status}}
|
|
28
|
+ {{ item.status | status }}
|
23
|
29
|
</view>
|
24
|
30
|
</view>
|
25
|
|
- <view class="card-center" v-for="(course,i) in item.list" :key="i">
|
|
31
|
+ <view class="card-center" v-for="(course, i) in item.list" :key="i">
|
26
|
32
|
<view class="card flex">
|
27
|
33
|
<view class="card-left">
|
28
|
|
- <img mode="scaleToFill" :src="course.image" alt="" class="card-image">
|
|
34
|
+ <img mode="scaleToFill" :src="course.image" alt="" class="card-image" />
|
29
|
35
|
</view>
|
30
|
36
|
<view class="card-right flex-sub margin-left-sm text-sm">
|
31
|
37
|
<view class="card-title">
|
32
|
|
- <text>{{course.name}}</text>
|
|
38
|
+ <text>{{ course.name }}</text>
|
33
|
39
|
</view>
|
34
|
40
|
<view class="card-item margin-top-xs">
|
35
|
41
|
<text class="card-label">时间:</text>
|
36
|
|
- <text class="card-text">{{course.attend_day}}</text>
|
|
42
|
+ <text class="card-text">{{ course.attend_day }}</text>
|
37
|
43
|
</view>
|
38
|
44
|
<view class="card-item margin-top-xs">
|
39
|
45
|
<text class="card-label">课时:</text>
|
40
|
|
- <text class="card-text">{{course.class_total}}</text>
|
|
46
|
+ <text class="card-text">{{ course.class_total }}</text>
|
41
|
47
|
</view>
|
42
|
48
|
<view class="card-item margin-top-xs">
|
43
|
49
|
<text class="card-label">学生:</text>
|
44
|
|
- <text class="card-text">{{course.student_name}}</text>
|
|
50
|
+ <text class="card-text">{{ course.student_name }}</text>
|
45
|
51
|
</view>
|
46
|
52
|
<view class="card-item margin-top-xs">
|
47
|
53
|
<text class="card-label">老师:</text>
|
48
|
|
- <text class="card-text">{{course.teacher||'--'}}</text>
|
|
54
|
+ <text class="card-text">{{ course.teacher || '--' }}</text>
|
49
|
55
|
</view>
|
50
|
|
- <view class="card-item margin-top-xs" v-if="dropStatus.includes(item.status)&&course.is_return===1">
|
51
|
|
- <view class="text-student text-right">{{course.return_status}}</view>
|
|
56
|
+ <view class="card-item margin-top-xs" v-if="dropStatus.includes(item.status) && course.is_return === 1">
|
|
57
|
+ <view class="text-student text-right">{{ course.return_status }}</view>
|
52
|
58
|
</view>
|
53
|
59
|
</view>
|
54
|
60
|
</view>
|
55
|
61
|
<view class="flex card-footer solid-bottom padding-bottom-xs">
|
56
|
|
- <view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
|
57
|
|
- <text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
|
|
62
|
+ <view v-for="(prop, k) in course.prop" :key="k" class="margin-right-xs">
|
|
63
|
+ <text class="card-label">{{ prop.name }}:</text><text class="text-price">{{ prop.money }}</text>
|
58
|
64
|
</view>
|
59
|
65
|
</view>
|
60
|
66
|
<view class="card-bottom flex justify-end margin-top-xs">
|
61
|
|
- <button @tap="dropCourse(course.order_info_id)" class="cu-btn round bg-student text-white"
|
62
|
|
- v-if="dropStatus.includes(item.status)&&course.is_return===0">退课</button>
|
|
67
|
+ <button @tap="dropCourse(course.order_info_id)" class="cu-btn round bg-student text-white" v-if="dropStatus.includes(item.status) && course.is_return === 0">
|
|
68
|
+ 退课
|
|
69
|
+ </button>
|
63
|
70
|
<!-- <button @tap="droping" class="cu-btn round sm line-cyan" v-if="dropStatus.includes(item.status)&&course.is_return===1">退课中</button> -->
|
64
|
71
|
</view>
|
65
|
72
|
</view>
|
66
|
73
|
<view class="card-bottom margin-top-xs flex justify-between">
|
67
|
74
|
<view>
|
68
|
|
- <text class="text-price text-red">{{item.sum_money}}</text>
|
|
75
|
+ <text class="text-price text-red">{{ item.sum_money }}</text>
|
69
|
76
|
</view>
|
70
|
77
|
<view>
|
71
|
|
- <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm"
|
72
|
|
- v-if="item.status===0">立即付款</button>
|
73
|
|
- <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray"
|
74
|
|
- v-if="item.status===0&&!isPaying">取消</button>
|
|
78
|
+ <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm" v-if="item.status === 0">立即付款</button>
|
|
79
|
+ <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray" v-if="item.status === 0 && !isPaying">取消</button>
|
75
|
80
|
</view>
|
76
|
81
|
</view>
|
77
|
82
|
</view>
|
78
|
83
|
</view>
|
79
|
84
|
</view>
|
80
|
85
|
<view class="list" v-else>
|
81
|
|
- <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
|
|
86
|
+ <view class="cu-card margin-top margin-bottom shadow" v-for="(item, index) in list" :key="index">
|
82
|
87
|
<view class="cu-item">
|
83
|
88
|
<view class="card-header flex justify-between solid-bottom">
|
84
|
|
- <view>{{item.refund_code}}</view>
|
|
89
|
+ <view>{{ item.refund_code }}</view>
|
85
|
90
|
<view class="text-student course-status">
|
86
|
|
- {{item.status|dropStatus}}
|
|
91
|
+ {{ item.status | dropStatus }}
|
87
|
92
|
</view>
|
88
|
93
|
</view>
|
89
|
94
|
<view class="card flex">
|
90
|
95
|
<view class="card-left">
|
91
|
|
- <img mode="scaleToFill" :src="item.image" alt="" class="card-image">
|
|
96
|
+ <img mode="scaleToFill" :src="item.image" alt="" class="card-image" />
|
92
|
97
|
</view>
|
93
|
98
|
<view class="card-right flex-sub margin-left-sm text-sm">
|
94
|
|
- <view class="card-title">{{item.name}}</view>
|
|
99
|
+ <view class="card-title">{{ item.attend_name }}</view>
|
95
|
100
|
<view class="card-item margin-top-xs">
|
96
|
101
|
<text class="card-label">时间:</text>
|
97
|
|
- <text class="card-text">{{item.day}}</text>
|
|
102
|
+ <text class="card-text">{{ item.day }}</text>
|
98
|
103
|
</view>
|
99
|
104
|
<view class="card-item margin-top-xs">
|
100
|
105
|
<text class="card-label">课时:</text>
|
101
|
|
- <text class="card-text">{{item.class_total}}</text>
|
|
106
|
+ <text class="card-text">{{ item.class_total }}</text>
|
102
|
107
|
</view>
|
103
|
108
|
<view class="card-item margin-top-xs">
|
104
|
109
|
<text class="card-label">学生:</text>
|
105
|
|
- <text class="card-text">{{item.student_name}}</text>
|
|
110
|
+ <text class="card-text">{{ item.student_name }}</text>
|
106
|
111
|
</view>
|
107
|
112
|
<view class="card-item margin-top-xs">
|
108
|
113
|
<text class="card-label">老师:</text>
|
109
|
|
- <text class="card-text">{{item.teacher||'--'}}</text>
|
|
114
|
+ <text class="card-text">{{ item.teacher || '--' }}</text>
|
110
|
115
|
</view>
|
111
|
116
|
<view class="card-item margin-top-xs">
|
112
|
117
|
<text class="card-label">订单:</text>
|
113
|
|
- <text class="card-text">{{item.code}}</text>
|
|
118
|
+ <text class="card-text">{{ item.code }}</text>
|
114
|
119
|
</view>
|
115
|
120
|
</view>
|
116
|
121
|
</view>
|
117
|
122
|
<view class="flex card-footer padding-bottom-xs">
|
118
|
|
- <view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
|
119
|
|
- <text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
|
|
123
|
+ <view v-for="(prop, k) in course.prop" :key="k" class="margin-right-xs">
|
|
124
|
+ <text class="card-label">{{ prop.name }}:</text><text class="text-price">{{ prop.money }}</text>
|
120
|
125
|
</view>
|
121
|
126
|
</view>
|
122
|
127
|
</view>
|
|
@@ -135,7 +140,7 @@ export default {
|
135
|
140
|
components: {
|
136
|
141
|
swiperTab
|
137
|
142
|
},
|
138
|
|
- data () {
|
|
143
|
+ data() {
|
139
|
144
|
return {
|
140
|
145
|
title: '订单',
|
141
|
146
|
topHeader: this.globalCustomBarHeight,
|
|
@@ -182,11 +187,11 @@ export default {
|
182
|
187
|
return '状态未知'
|
183
|
188
|
}
|
184
|
189
|
},
|
185
|
|
- dropStatus (v) {
|
|
190
|
+ dropStatus(v) {
|
186
|
191
|
return v === 0 ? '审核中' : v === 1 ? '审核通过' : '驳回'
|
187
|
192
|
}
|
188
|
193
|
},
|
189
|
|
- onLoad (option) {
|
|
194
|
+ onLoad(option) {
|
190
|
195
|
if (option.type) {
|
191
|
196
|
const index = decodeURIComponent(option.type)
|
192
|
197
|
this.changeTab(index)
|
|
@@ -195,7 +200,7 @@ export default {
|
195
|
200
|
}
|
196
|
201
|
},
|
197
|
202
|
watch: {
|
198
|
|
- ifReloadOrder (n, o) {
|
|
203
|
+ ifReloadOrder(n, o) {
|
199
|
204
|
if (n) {
|
200
|
205
|
this.changeTab(0)
|
201
|
206
|
this.$store.dispatch('setReload', false)
|
|
@@ -203,23 +208,21 @@ export default {
|
203
|
208
|
}
|
204
|
209
|
},
|
205
|
210
|
computed: {
|
206
|
|
- ...mapGetters([
|
207
|
|
- 'ifReloadOrder'
|
208
|
|
- ])
|
|
211
|
+ ...mapGetters(['ifReloadOrder'])
|
209
|
212
|
},
|
210
|
213
|
methods: {
|
211
|
|
- refresh () {
|
|
214
|
+ refresh() {
|
212
|
215
|
this.params.page = 1
|
213
|
216
|
this.get_list()
|
214
|
217
|
},
|
215
|
|
- onRefresh () {
|
|
218
|
+ onRefresh() {
|
216
|
219
|
this.triggered = true
|
217
|
220
|
this.refresh()
|
218
|
221
|
setTimeout(() => {
|
219
|
222
|
this.triggered = false
|
220
|
223
|
}, 1000)
|
221
|
224
|
},
|
222
|
|
- loadMore () {
|
|
225
|
+ loadMore() {
|
223
|
226
|
if (this.noMore) {
|
224
|
227
|
uni.showToast({ title: '没有更多了', icon: 'none' })
|
225
|
228
|
return false
|
|
@@ -227,14 +230,14 @@ export default {
|
227
|
230
|
this.params.page++
|
228
|
231
|
this.get_list()
|
229
|
232
|
},
|
230
|
|
- get_list () {
|
|
233
|
+ get_list() {
|
231
|
234
|
if (this.params.type < 7) {
|
232
|
235
|
this.get_orders()
|
233
|
236
|
} else {
|
234
|
237
|
this.get_drops()
|
235
|
238
|
}
|
236
|
239
|
},
|
237
|
|
- get_orders () {
|
|
240
|
+ get_orders() {
|
238
|
241
|
_orderCenter(this.params).then(res => {
|
239
|
242
|
if (this.params.page > 1) {
|
240
|
243
|
if (Object.keys(res.data).length < this.page_size) this.noMore = true
|
|
@@ -245,7 +248,7 @@ export default {
|
245
|
248
|
}
|
246
|
249
|
})
|
247
|
250
|
},
|
248
|
|
- get_drops () {
|
|
251
|
+ get_drops() {
|
249
|
252
|
_dropList({ page: this.params.page }).then(res => {
|
250
|
253
|
if (this.params.page > 1) {
|
251
|
254
|
if (!res.data.drop_course_data) {
|
|
@@ -260,10 +263,10 @@ export default {
|
260
|
263
|
}
|
261
|
264
|
})
|
262
|
265
|
},
|
263
|
|
- droping () {
|
|
266
|
+ droping() {
|
264
|
267
|
this.changeTab(3)
|
265
|
268
|
},
|
266
|
|
- dropCourse (id) {
|
|
269
|
+ dropCourse(id) {
|
267
|
270
|
const params = { order_info_id: id, refund_explanation: '', type_id: 0 }
|
268
|
271
|
const _self = this
|
269
|
272
|
uni.showModal({
|
|
@@ -281,14 +284,12 @@ export default {
|
281
|
284
|
}
|
282
|
285
|
})
|
283
|
286
|
},
|
284
|
|
- pay (id) {
|
|
287
|
+ pay(id) {
|
285
|
288
|
const _self = this
|
286
|
289
|
_self.isPaying = true
|
287
|
290
|
uni.showModal({
|
288
|
291
|
title: '温馨提示:',
|
289
|
|
- content: '1、感谢您的购买;\n' +
|
290
|
|
- '2、退费规则请咨询客服;\n' +
|
291
|
|
- '3、本平台对以上细则有最终解释权。',
|
|
292
|
+ content: '1、感谢您的购买;\n' + '2、退费规则请咨询客服;\n' + '3、本平台对以上细则有最终解释权。',
|
292
|
293
|
cancelText: '取消',
|
293
|
294
|
confirmText: '确定',
|
294
|
295
|
success: res => {
|
|
@@ -330,7 +331,7 @@ export default {
|
330
|
331
|
}
|
331
|
332
|
})
|
332
|
333
|
},
|
333
|
|
- cancel (id) {
|
|
334
|
+ cancel(id) {
|
334
|
335
|
const _self = this
|
335
|
336
|
uni.showModal({
|
336
|
337
|
title: '提示',
|
|
@@ -347,7 +348,7 @@ export default {
|
347
|
348
|
}
|
348
|
349
|
})
|
349
|
350
|
},
|
350
|
|
- changeTab (index) {
|
|
351
|
+ changeTab(index) {
|
351
|
352
|
this.orders = {}
|
352
|
353
|
this.params.page = 1
|
353
|
354
|
this.currentIndex = index
|