orderDetail.vue
9.61 KB
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<template>
<div class="marketing">
<div class="container-detail">
<div class="order-info">
<div class="order-info-title">订单信息</div>
<glsx-rows class="order-info-wrap" :layoutData="detailData" :layoutParams="orderParams">
<template slot="refundDate" slot-scope="scope">
<span class="text-14 color-3 line-20">{{ dateFormatFun(scope.scope.refundDate) }}</span>
</template>
</glsx-rows>
</div>
<div class="order-info">
<div class="order-info-title">基本信息</div>
<glsx-rows class="order-info-wrap" :layoutData="detailData" :layoutParams="basicParams">
<template slot="paySource">
<span class="text-14 color-3 line-20">微信支付</span>
</template>
<template slot="orderStatus">
<span class="text-14 color-3 line-20">已付款</span>
</template>
</glsx-rows>
<glsx-descriptions class="order-info-desc" :tableModel="theSameDescri" :showData="detailData">
<span slot="couponList" slot-scope="scope">
{{ scope.scope.couponList && scope.scope.couponList.length > 0 ? scope.scope.couponList[0].couponName : ' — ' }}
</span>
<template slot="orderType" slot-scope="scope">
<span>{{ scope.scope.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template>
<template slot="amount">
<span>1</span>
</template>
<template slot="totalPrice" slot-scope="scope">
<span>{{ scope.scope.originalPrice * 1 }}</span>
</template>
<template slot="orderStatus" slot-scope="scope">
<span>{{ scope.scope.orderStatus == 2 ? '待收货' : scope.scope.orderStatus == 3 ? '已完成' : scope.scope.orderStatus == 4 ? '售后中' : scope.scope.orderStatus == 5 ? '退款失败' : scope.scope.orderStatus == 6 ? '已退款' : '' }}</span>
</template>
</glsx-descriptions>
</div>
<template v-if="detailData.orderType == 1">
<div class="order-info">
<div class="order-info-title">套餐使用详情</div>
<GLTable class="meal-table" ref="mealRef" :searchForm="tableSearchForm" :getListApi="getListApi" :hasPage="false" :tableParams="tableParams">
<div slot="verification" slot-scope="scope">
<GLTable :hasNum="false" class="verificationTable" :hasPage="false" :noDataImg="url" :tableParams="verificationParams" :tableData="scope.scope.verificationPackageCouponList">
<span slot="verificationDate" slot-scope="scope">
{{ dateFormatFun(scope.scope.verificationDate) }}
</span>
</GLTable>
</div>
<div slot="discountType" slot-scope="scope">
<img class="content-meal-logo" :src="numToCoupon[scope.scope.discountType]" />
</div>
<div slot="residueCount" slot-scope="scope">
<span v-if="scope.scope.residueCount == -1">无限次</span>
<span v-else>{{ scope.scope.residueCount }}</span>
</div>
</GLTable>
</div>
</template>
</div>
</div>
</template>
<script>
import { getOrderPageDetail, getCouponList } from '@/api/modules/order'
import { dateFormat } from '@/utils/index.js'
export default {
data() {
return {
detailData: {}, //this.$route.query.detail,
mylist: [],
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
orderParams: [
{
label: '订单编号:',
prop: 'orderCode',
span: 8
},
{
label: '下单时间:',
prop: 'createDate',
span: 8
},
{
label: '退款时间:',
prop: 'refundDate',
addHtml: 'refundDate',
span: 8,
isHidden: data => {
if (data.orderStatus == 4 || data.orderStatus == 5 || data.orderStatus == 6) {
return true
}
return false
}
},
{
label: '退款说明:',
prop: 'refundReason',
span: 8,
isHidden: data => {
if (data.orderStatus == 4 || data.orderStatus == 5 || data.orderStatus == 6) {
return true
}
return false
}
},
{
label: '推荐人:',
prop: 'shareStaffName',
span: 8
}
],
basicParams: [
{
label: '用户名称:',
prop: 'accountName',
span: 8
},
{
label: '手机号:',
prop: 'mobile',
span: 8
},
{
label: '付款状态:',
prop: 'orderStatus',
addHtml: 'orderStatus',
span: 8
},
{
label: '付款金额:',
prop: 'realPayPrice',
span: 8
},
{
label: '付款方式:',
prop: 'paySource',
addHtml: 'paySource',
span: 8
},
{
label: '付款时间:',
prop: 'createDate',
span: 8
},
{
label: '开通门店:',
prop: 'merchantName',
span: 8
}
],
theSameDescri: [
{
colList: [{ thColspan: 1, tdColspan: 5, label: '商品名称', name: 'couponList', addHtml: 'couponList' }]
},
{
colList: [
{ thColspan: 1, tdColspan: 2, label: '类型', name: 'orderType', addHtml: 'orderType' },
{ thColspan: 1, tdColspan: 2, label: '单价/元', name: 'originalPrice' }
]
},
{
colList: [
{ thColspan: 1, tdColspan: 2, label: '数量', name: 'amount', addHtml: 'amount' },
{ thColspan: 1, tdColspan: 2, label: '小计/元', name: 'totalPrice', addHtml: 'totalPrice' }
]
},
{
colList: [
{ thColspan: 1, tdColspan: 2, label: '实收金额', name: 'realPayPrice', color: '#5850FF' },
{ thColspan: 1, tdColspan: 2, label: '状态', name: 'orderStatus', addHtml: 'orderStatus' }
]
}
],
getListApi: getCouponList,
tableParams: {
listName: '',
tableOption: false,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'verification'
},
{
label: '券类型',
prop: 'discountType',
addHtml: 'discountType',
width: '240'
},
{
label: '券名称',
prop: 'couponName',
width: '180'
},
{
label: '已核销次数',
prop: 'usedCount'
},
{
label: '剩余核销次数',
prop: 'residueCount',
addHtml: 'residueCount'
}
]
},
verificationParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '核销门店',
prop: 'verificationMerchantName',
width: 300
},
{
label: '核销日期',
prop: 'verificationDate',
addHtml: 'verificationDate',
width: 300
}
]
},
numToCoupon: {
2: require('../../assets/coupon/icon-discount.png'),
3: require('../../assets/coupon/icon-cash.png'),
4: require('../../assets/coupon/icon-exchange.png'),
7: require('../../assets/coupon/icon-service.png')
},
tableSearchForm: {}
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
this.accountLevel = this.$globalState.session.accountLevel
}
this.tableSearchForm = {
id: this.$route.query.id
}
this.getOrderPageDetail()
},
mounted() {},
methods: {
dateFormatFun(date) {
return dateFormat(date)
},
getOrderPageDetail() {
getOrderPageDetail({ id: this.$route.query.id }).then(res => {
if (res.code == '0') {
this.detailData = res.data
} else {
this.$message.error(`${res.message}`)
}
})
},
goBack() {
this.$router.push('/memberCenter/order')
}
}
}
</script>
<style lang="scss" scoped>
.marketing {
.container-detail {
padding-bottom: 20px;
.order-info {
width: 100%;
height: auto;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-bottom: 10px;
&-title {
line-height: 28px;
font-size: 16px;
font-weight: 500;
color: #333333;
padding: 15px 0 15px 20px;
border-bottom: 1px solid #d8d8d8;
}
&-wrap {
padding: 32px 68px;
}
&-desc {
padding: 0 0 32px 68px;
margin-top: -12px;
}
.meal-table {
padding: 20px;
.verificationTable {
padding-left: 10px;
}
.content-meal-logo {
width: 58px;
height: 22px;
}
}
}
.m-b-7 {
margin-bottom: 70px;
}
}
.footer-panel {
position: fixed;
bottom: 0px;
height: 78px;
left: 220px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index: 999;
div {
display: inline-block;
position: relative;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
margin-left: -110px;
}
}
}
</style>