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
<template>
<el-dialog
title="退款详情"
center
append-to-body
:visible.sync="dialogObj.show"
width="90%">
<el-table
:data="detail"
style="width: 100%">
<el-table-column
prop="refund_no"
label="退款编号">
</el-table-column>
<el-table-column
prop="out_trade_no"
label="订单号">
</el-table-column>
<el-table-column
label="用户信息"
min-width="140"
className="userInfo"
>
<template slot-scope="scope">
<img class="avatar" :src="scope.row.user_avatar">
{{scope.row.user_nickname}}(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column
prop="order_money"
label="订单金额">
<template slot-scope="scope">
{{parseFloat(scope.row.order_money / 100)}}元
</template>
</el-table-column>
<el-table-column
prop="refund_money"
label="退款金额">
<template slot-scope="scope">
{{parseFloat(scope.row.refund_money / 100)}}元
</template>
</el-table-column>
<el-table-column
prop="desc"
label="备注">
</el-table-column>
<el-table-column
label="退款状态">
<template slot-scope="scope">
{{scope.row.status|filterStatus}}
</template>
</el-table-column>
<el-table-column
prop="success_at"
label="退款成功时间">
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import {getRefundListApi} from "../../service/api";
export default {
name: "refundDetail",
props:[
'dialogObj'
],
data(){
return{
detail:[]
}
},
filters:{
filterStatus:function (value) {
let msg = '';
if(value === 0){
msg = '退款中'
}else if(value === 1){
msg = '退款成功'
}else if(value === 2){
msg = '退款失败'
}
return msg;
}
},
// mounted(){
// this.initPage()
// },
methods:{
initPage(){
let json = {
out_trade_no:this.dialogObj.out_trade_no,
limit:200
};
getRefundListApi(json).then(res=>{
this.detail = res.list
})
}
},
watch:{
'dialogObj.show'(value) {
if (value === true) {
this.initPage()
}
}
}
}
</script>
<style scoped>
.avatar {
width:50px;
height: 50px;
border-radius: 50%;
}
</style>