2 20.店铺和交易提示组件开发和交互
Last updated
Last updated
export function getStatistics2(){
return axios.get("/admin/statistics2")
}
src/components/IndexCard.vue
<template>
<el-card shadow="never">
<template #header>
<div class="flex justify-between">
<span class="text-sm">{{ title }}</span>
<el-tag
<!-- 分类组件 -->
<IndexNavs></IndexNavs>
<!-- 图表组件 -->
<el-row :gutter="20" class="mt-5">
<el-col :span="12" :offset="0">
<IndexChart></IndexChart>
</el-col>
<el-col :span="12" :offset="0">
<IndexCard title="店铺及商品提示" tip="店铺及商品提示" :btns="goods"></IndexCard>
<IndexCard title="交易提示" tip="需要立即处理的交易订单" :btns="order"></IndexCard>
</el-col>
</el-row>
<script setup>
import { getStatistics1,getStatistics2 } from '~/api/index';
import { ref } from 'vue';
import CountTo from '~/components/CountTo.vue';
import IndexNavs from '~/components/IndexNavs.vue';
import IndexChart from '~/components/IndexChart.vue';
import IndexCard from '~/components/IndexCard.vue';
const panels = ref([])
getStatistics1().then(res => {
console.log(res.panels)
panels.value = res.panels
})
const goods = ref([])
const order = ref([])
getStatistics2().then(res=>{
goods.value = res.goods
order.value = res.order
})
</script>