xiaokuaisong-shopapp/uniapp05/pages/Statistics/Statistics.vue
2024-10-18 16:05:19 +08:00

54 lines
1.0 KiB
Vue

<template>
<view class="title">订单收益统计</view>
<view class="charts-box">
<qiun-data-charts type="column" :chartData="chartData" />
</view>
</template>
<script>
export default {
data() {
return {
chartData: {},
};
},
onReady() {
this.getServerData();
},
methods: {
getServerData() {
//模拟从服务器获取数据时的延时
setTimeout(() => {
let res = {
categories: ["7.1","7.2","7.3","7.4","7.5","7.6"],
series: [
{
name: "收益",
data: [35,36,31,33,13,34]
},
{
name: "订单",
data: [18,27,21,24,6,28]
}
]
};
this.chartData = JSON.parse(JSON.stringify(res));
}, 500);
},
}
};
</script>
<style scoped>
.title {
font-size: 30rpx;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
font-weight: 700;
}
.charts-box {
margin: 0 auto;
width: 80%;
height: 300px;
}
</style>