PaymentPropertion.vue
2.42 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
<!-- 收款方式占比 -->
<template>
<div class="payment-box">
<box-title title="收款方式占比"></box-title>
<inner-tab class="tab-box" :list="tabList" :width="18.22" :itemPadding="1.74" @changeTab="changeTab"></inner-tab>
<RightViewContent v-if="paymentData.length" class="content-box" :chart="paymentChart" :listData="paymentData" :legentList="paymentLegend" :legendColors="paymentChart.colors"></RightViewContent>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import RightViewContent from '../../solar/RightViewContent.vue'
export default {
name: 'PaymentProprtion',
components: {
RightViewContent
},
data() {
return {
dataList: {},
tabList: ['总场次', '进行中', '已完成'],
paymentData: [],
paymentChart: {
id: 'paymentPropertion',
keys: ['paymentModel', 'num'],
height: '15.56vh',
colors: ['#747DFF', '#16E193', '#FFC200', '#EB6001']
},
paymentLegend: [
{
name: 'paymentModel',
width: '12vw'
},
{
name: 'rate',
type: 'decimal',
width: '3vw'
},
{
name: 'num',
type: 'number',
width: '4vw',
unitIcon: '场'
}
]
}
},
created() {
this.$bus.$on('crowdFundingMonth', data => {
this.getPaymentModel(data)
})
},
mounted() {},
methods: {
// 获取 产值、转换率、退单率 门店排名
async getPaymentModel(Month) {
const _result = await this.api.crowdFunding.getPaymentModel({ Month })
this.dataList = _result.data.dataList[0]
this.paymentData = this.dataList.totalData
},
// tab切换
changeTab(val) {
switch (val) {
case 0:
this.paymentData = this.dataList.totalData
break
case 1:
this.paymentData = this.dataList.inProgress
break
case 2:
this.paymentData = this.dataList.completed
break
}
}
}
}
</script>
<style lang="scss" scoped>
.payment-box {
width: 36.94vw;
height: 34vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.tab-box {
margin: 2.22vh auto;
}
.content-box {
padding: 0 1.39vw;
height: 21.67vh;
/deep/ .legend-box .legend-item {
margin-bottom: 0.89vh;
}
}
.empty {
height: 21.67vh;
display: flex;
align-items: center;
}
}
</style>