index.vue
6.2 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
<template>
<u-navbar :autoBack="true" bgColor="transparent" placeholder safeAreaInsetTop :titleStyle="{ color: 'transparent' }" leftIconColor="#fff"></u-navbar>
<view class="topbg"></view>
<view class="total Zindex">
<view class="total-ffftext" style="margin-bottom: 18rpx">总资产(元)</view>
<view class="flexJ" style="margin-bottom: 50rpx">
<u-count-to :endVal="Number(dataTotal?.amount) || 0" separator="," duration="2000" color="#fff" fontSize="32" decimals="2" bold></u-count-to>
<view class="flexA total-ffftext tix">
<image src="/static/images/moneyicon.png" class="moneyicon" mode="aspectFill" />
<view @click="proxy.$h.jumpUrl(`/pages2/money/withdrawDeposit`)">去提现</view>
<u-icon name="arrow-right" color="#fff" size="16"></u-icon>
</view>
</view>
<view class="flexA total-ffftext" style="margin-bottom: 46rpx">
<view style="margin-right: 20rpx">昨日收入</view>
<view style="margin-right: 82rpx">{{ dataTotal?.yesIncome || 0 }}</view>
<view style="margin-right: 20rpx">累积收入</view>
<view>{{ dataTotal?.income || 0 }}</view>
</view>
<view class="total-numCard">
<view class="flexJ" style="margin-bottom: 46rpx">
<view class="title">我的接诊数量</view>
</view>
<up-row customStyle="margin-bottom: 10px" gutter="10">
<up-col span="6">
<view class="flexCCol card">
<u-count-to :endVal="Number(dataTotal?.receiveNum) || 0" duration="1000" color="#323233" fontSize="22" bold></u-count-to>
<view class="graytext">积累接诊数量</view>
</view>
</up-col>
<up-col span="6">
<view class="flexCCol card">
<u-count-to :endVal="Number(dataTotal?.yesReceiveNum) || 0" duration="1000" color="#323233" fontSize="22" bold></u-count-to>
<view class="graytext">昨日接诊数量</view>
</view>
</up-col>
</up-row>
</view>
<view class="total-numCard">
<view class="flexJ" style="margin-bottom: 46rpx">
<view class="title flexA">
<view style="margin-right: 6rpx">我的评价</view>
</view>
<view class="flexA">
<view style="margin-right: 6rpx; color: #ffc525">{{ dataTotal?.star || 0 }}分</view>
<u-rate :count="5" v-model="value" allowHalf activeColor="#ffc525" readonly></u-rate>
</view>
</view>
<up-row customStyle="margin-bottom: 10px" gutter="10">
<up-col span="6">
<view class="flexA" style="margin-bottom: 44rpx">
<image src="/static/images/totalhao.png" class="totalhao" mode="aspectFill" />
<view>
<u-count-to :endVal="Number(dataTotal?.good) || 0" duration="1000" color="#323233" fontSize="22" bold></u-count-to>
<view class="graytext">好评</view>
</view>
</view>
<view class="flexA" style="margin-bottom: 44rpx">
<image src="/static/images/badic.png" style="transform: rotateX(0)" class="totalhao" mode="aspectFill" />
<view>
<view class="graytext">差评</view>
<u-count-to :endVal="Number(dataTotal?.bad) || 0" duration="1000" color="#323233" fontSize="22" bold></u-count-to>
</view>
</view>
</up-col>
<up-col span="6">
<view class="charts-box">
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
</view>
</up-col>
</up-row>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, ComponentPublicInstance } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { getIndex } from '../../api'
import { IndexType } from '../../types'
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
const value = ref(0)
const chartData = ref({})
const dataTotal = ref<IndexType>()
const opts = ref({
color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
padding: undefined,
title: { name: '64.2%', fontSize: 20, color: '#323233' },
subtitle: { name: '占比', fontSize: 13, color: '#666666' },
extra: {
arcbar: { type: 'circle', width: 12, backgroundColor: '#f3f3f3', startAngle: 1.5, endAngle: 0.25, gap: 2 }
}
})
const getServerData = async () => {
let res = {
series: [{ name: '占比', color: '#64b7f6', data: 0.642 }]
}
const { result }: { result: IndexType } = await getIndex()
value.value = result?.star
dataTotal.value = result
if (result.goodPercent.indexOf('%') === -1) {
res.series[0].data = Number(result.goodPercent)
opts.value.title.name = (+result.goodPercent * 100).toFixed(2) + '%'
} else {
res.series[0].data = Number(result.goodPercent.split('%')[0])
opts.value.title.name = result.goodPercent
}
chartData.value = JSON.parse(JSON.stringify(res))
}
onLoad(() => {
getServerData()
})
</script>
<style>
page {
background: #f7f8fa !important;
}
</style>
<style lang="scss" scoped>
.charts-box {
width: 238rpx;
height: 238rpx;
}
.topbg {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 526rpx;
background: linear-gradient(117deg, #66acff 5%, #05b8d2 94.19%);
}
.total {
box-sizing: border-box;
padding: 15rpx 32rpx;
.totalhao {
width: 96rpx;
height: 96rpx;
margin-right: 20rpx;
}
&-ffftext {
color: #ffffff;
font-size: 28rpx;
font-weight: 700;
}
&-numCard {
border-radius: 24rpx;
box-sizing: border-box;
background: #fff;
padding: 28rpx 28rpx 50rpx;
font-size: 26rpx;
margin-bottom: 26rpx;
.title {
color: #323233;
font-size: 36rpx;
font-weight: 700;
}
.card {
width: 100%;
box-sizing: border-box;
padding: 34rpx 0 30rpx;
background: #f9f9f9;
}
.numtext {
color: #323233;
font-size: 44rpx;
font-weight: 700;
margin-bottom: 8rpx;
}
}
.tix {
box-sizing: border-box;
padding: 18rpx 8rpx 18rpx 26rpx;
border-radius: 40rpx 0 0 40rpx;
background: linear-gradient(90deg, #37d2ed 39.09%, #37d2ed42 100%);
margin-right: -32rpx;
}
.moneyicon {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
.fffbox {
}
}
</style>