feat: 初始化
This commit is contained in:
9
pages/partner/overviewChart/index.scss
Normal file
9
pages/partner/overviewChart/index.scss
Normal file
@ -0,0 +1,9 @@
|
||||
.container {
|
||||
padding: 0 18px 24px;
|
||||
.swiper {
|
||||
margin: 14px 0 18px;
|
||||
}
|
||||
.title {
|
||||
margin: 14px 0 15px;
|
||||
}
|
||||
}
|
43
pages/partner/overviewChart/index.vue
Normal file
43
pages/partner/overviewChart/index.vue
Normal file
@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<NavBar />
|
||||
<view class="container">
|
||||
<view class="title">
|
||||
<PageTitle :title="$t('menu.partner')" />
|
||||
</view>
|
||||
</view>
|
||||
<OverviewChart :chartData="overviewData" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OverviewChart from '@/pages/components/overviewChart/index.vue';
|
||||
import { getOverviewChart } from '@/services/partner/overview.ts';
|
||||
import dayjs from 'dayjs';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chartParams: {},
|
||||
overviewData: {}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async getOverviewChartData() {
|
||||
const res = await getOverviewChart(this.chartParams);
|
||||
if (res && res.code === 0) {
|
||||
this.overviewData.categories = res.data.map((item) => dayjs(item.date).format('M-D'));
|
||||
this.overviewData.series = [{ name: this.chartParams.label, data: res.data.map((item) => item.amount) }];
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(params) {
|
||||
this.chartParams = JSON.parse(params.params);
|
||||
this.getOverviewChartData();
|
||||
},
|
||||
components: {
|
||||
OverviewChart
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
Reference in New Issue
Block a user