|
|
@@ -5,10 +5,18 @@
|
|
5
|
5
|
<view class="card_item today">
|
|
6
|
6
|
<view class="card_item_content">
|
|
7
|
7
|
<view class="card_header">
|
|
8
|
|
- <text class="card_title">今天消耗(元)</text>
|
|
|
8
|
+ <text class="card_title">抖音<br />今天消耗(元)</text>
|
|
9
|
9
|
</view>
|
|
10
|
10
|
<view class="card_content">
|
|
11
|
|
- <text class="card_value">{{ cardData.todayConsume }}</text>
|
|
|
11
|
+ <text class="card_value">{{ formatMoney(cardData.todayConsumeDy) }}</text>
|
|
|
12
|
+ </view>
|
|
|
13
|
+ </view>
|
|
|
14
|
+ <view class="card_item_content">
|
|
|
15
|
+ <view class="card_header">
|
|
|
16
|
+ <text class="card_title">广点通<br />今天消耗(元)</text>
|
|
|
17
|
+ </view>
|
|
|
18
|
+ <view class="card_content">
|
|
|
19
|
+ <text class="card_value">{{ formatMoney(cardData.todayConsumeGdt) }}</text>
|
|
12
|
20
|
</view>
|
|
13
|
21
|
</view>
|
|
14
|
22
|
<view class="card_item_content">
|
|
|
@@ -140,6 +148,8 @@ export default {
|
|
140
|
148
|
// 卡片数据
|
|
141
|
149
|
cardData: {
|
|
142
|
150
|
todayConsume: '-',
|
|
|
151
|
+ todayConsumeDy: '-',
|
|
|
152
|
+ todayConsumeGdt: '-',
|
|
143
|
153
|
todayPerformance: '-',
|
|
144
|
154
|
countTypeA: '-',
|
|
145
|
155
|
countTypeB: '-',
|
|
|
@@ -168,7 +178,7 @@ export default {
|
|
168
|
178
|
yAxis: {
|
|
169
|
179
|
gridType: "dash",
|
|
170
|
180
|
dashLength: 2,
|
|
171
|
|
- axisLabel:{
|
|
|
181
|
+ axisLabel: {
|
|
172
|
182
|
show: false
|
|
173
|
183
|
}
|
|
174
|
184
|
},
|
|
|
@@ -188,6 +198,12 @@ export default {
|
|
188
|
198
|
},
|
|
189
|
199
|
|
|
190
|
200
|
methods: {
|
|
|
201
|
+ formatMoney(val) {
|
|
|
202
|
+ if (val === null || val === undefined || val === '' || val === '-') return '-';
|
|
|
203
|
+ const num = Number(val);
|
|
|
204
|
+ if (Number.isNaN(num)) return '-';
|
|
|
205
|
+ return num.toFixed(2);
|
|
|
206
|
+ },
|
|
191
|
207
|
getCardData() {
|
|
192
|
208
|
uni.$u.api.getPersonCards({ userId: this.$store.state.user.userInfo.userId }).then(res => {
|
|
193
|
209
|
if (res.code === 200) {
|