diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue index 06581a1..9edb949 100644 --- a/src/views/dashboard/PanelGroup.vue +++ b/src/views/dashboard/PanelGroup.vue @@ -101,6 +101,7 @@ import CountTo from 'vue-count-to' import RankList from '@/views/components/rankList' import LineChart from '../dashboard/LineChart' +import { staticIndex } from '@/api/cai/static' const chartSelect = [ { label: '最近一周', key: '1' }, @@ -210,7 +211,6 @@ export default { handleDatePickerChange(value) { console.log('----value:', value); }, - handleChartTimeChange(val) { // todo }, @@ -219,40 +219,44 @@ export default { }, getTodayStatistics() { // todo fetch - const { - todayLoginNum, - todayLoginDiffLast, - anchorNum, - todayRechargeAmountNum, - todayRechargeNum, - todayRechargeAmountDiffLast, - todayWithdrawAmount, - todayWithdrawNum, - todayWithdrawAmountDiffLast - } = { - todayLoginNum: 100, - todayLoginDiffLast: 8.6, - anchorNum: 58, - todayRechargeAmountNum: 200, - todayRechargeNum: 10, - todayRechargeAmountDiffLast: 5.6, - todayWithdrawAmount: 500, - todayWithdrawNum: 1, - todayWithdrawAmountDiffLast: 5.9 - } - this.loginModel.count = todayLoginNum - this.loginModel.trendDirection = 1 // 增加还是减少 - this.loginModel.trendNum = todayLoginDiffLast + staticIndex().then(response => { + const { + todayLoginNum, + todayLoginDiffLast, + anchorNum, + todayRechargeAmountNum, + todayRechargeNum, + todayRechargeAmountDiffLast, + todayWithdrawAmount, + todayWithdrawNum, + todayWithdrawAmountDiffLast + } = response.data + /* { + todayLoginNum: 100, + todayLoginDiffLast: 8.6, + anchorNum: 58, + todayRechargeAmountNum: 200, + todayRechargeNum: 10, + todayRechargeAmountDiffLast: 5.6, + todayWithdrawAmount: 500, + todayWithdrawNum: 1, + todayWithdrawAmountDiffLast: 5.9 + } */ - this.topUpModel.count = anchorNum // 主播人数 + this.loginModel.count = todayLoginNum + this.loginModel.trendDirection = 1 // 增加还是减少 + this.loginModel.trendNum = todayLoginDiffLast - this.withdrawDepositModel.count = todayRechargeAmountNum // 充值金额 - this.withdrawDepositModel.money = todayRechargeNum - this.withdrawDepositModel.trendNum = todayRechargeAmountDiffLast // 与昨日相比 + this.topUpModel.count = anchorNum // 主播人数 - this.anchorModel.count = todayWithdrawAmount - this.anchorModel.money = todayWithdrawNum - this.anchorModel.trendNum = todayWithdrawAmountDiffLast + this.withdrawDepositModel.count = todayRechargeAmountNum // 充值金额 + this.withdrawDepositModel.money = todayRechargeNum + this.withdrawDepositModel.trendNum = todayRechargeAmountDiffLast // 与昨日相比 + + this.anchorModel.count = todayWithdrawAmount + this.anchorModel.money = todayWithdrawNum + this.anchorModel.trendNum = todayWithdrawAmountDiffLast + }) } } }