feat: 增加统计页面

This commit is contained in:
2026-08-27 17:28:22 +08:00
parent 4844121584
commit f5c4cdf93f
21 changed files with 12222 additions and 18 deletions

62
src/pages/stats/index.vue Normal file
View File

@@ -0,0 +1,62 @@
<template>
<view class="charts-box">
<qiun-data-charts
type="line"
:opts="opts"
:chartData="chartData"
/>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { onShow } from "@dcloudio/uni-app";
const chartData = ref({})
const opts = {
color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
padding: [15, 10, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true
},
yAxis: {
gridType: "dash",
dashLength: 2
},
extra: {
line: {
type: "straight",
width: 2,
activeType: "hollow"
}
}
}
onShow(() => {
getServerData()
})
function getServerData() {
setTimeout(() => {
const res = {
categories: ["2018","2019","2020","2021","2022","2023"],
series: [
{ name: "成交量A", data: [35, 8, 25, 37, 4, 20] },
{ name: "成交量B", data: [70, 40, 65, 100, 44, 68] },
{ name: "成交量C", data: [100, 80, 95, 150, 112, 132] }
]
}
chartData.value = res
}, 500)
}
</script>
<style scoped>
.charts-box {
width: 100%;
height: 300px;
}
</style>