GoodsPayPropertion.vue
2.35 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
<template>
<div class="goods-pay-box">
<box-title title="订单支付方式占比"></box-title>
<RightViewContent
v-if="goodsPayData.length"
class="content-box"
:chart="goodsPayChart"
:listData="goodsPayData"
:legentList="goodsPayLegend"
:legendColors="goodsPayChart.colors"
></RightViewContent>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import { boutiqueMixin } from '@/mixins'
import RightViewContent from '../solar/RightViewContent.vue'
export default {
name: 'GoodsPayPropertion',
mixins: [boutiqueMixin],
components: {
RightViewContent
},
props: {
merchantid: String,
year: String
},
data() {
return {
goodsPayData: [],
goodsPayChart: {
id: 'goodsPay',
keys: ['payType', 'orderNum'],
height: '15.34vh',
colors: ['#34AFFF', '#16E193', '#FFC200', '#EB6001'],
formatter: 'total',
formatterName: '支付订单',
formtUnit: '单'
},
goodsPayLegend: [
{
name: 'payType',
width: '5vw'
},
{
name: 'rate',
type: 'decimal',
width: '3vw'
},
{
name: 'orderNum',
type: 'number',
width: '5vw',
unitIcon: '单'
}
]
}
},
mounted() {},
methods: {
init() {
this.getMerchantPay(this.merchantid, this.year)
},
// 获取门店支付方式占比
async getMerchantPay(merchantid, year) {
const _data = await this.api.boutique.getMerchantPay({ year, MerchantId: merchantid })
this.goodsPayData = _data.data.dataList
},
}
}
</script>
<style lang="scss" scoped>
.goods-pay-box {
width: 100%;
background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
height: 25vh;
margin-bottom: 1.78vh;
.content-box {
padding: 0 1.39vw;
height: 21.67vh;
}
.empty {
height: 21.67vh;
display: flex;
align-items: center;
}
}
</style>
<style lang="scss">
.goods-pay-box {
.legend-item {
&-text {
min-width: 6vh;
justify-content: normal;
&:first-child {
min-width: 15vh;
}
&:last-child .item-content {
display: inline-block;
text-align: right;
width: 10vh !important;
max-width: 10vh !important;
}
}
}
}
</style>