|
@@ -10,7 +10,7 @@
|
|
|
import NavbarEvo from '@/components/navbar-evo.vue'
|
|
|
import Card from '@/components/card.vue'
|
|
|
import SectionHeading from '@/components/section-heading.vue'
|
|
|
-import { getBadges, getCertificates } from '../../../core/libs/requests'
|
|
|
+import { getBadges, getCertificates, getHonorStatistics } from '../../../core/libs/requests'
|
|
|
import { useRouter } from '../../../core/utils/router'
|
|
|
import arcBottom from '@designer-hub/assets/src/libs/assets/arcBottom'
|
|
|
import { NetImages } from '../../../core/libs/net-images'
|
|
@@ -22,32 +22,15 @@ const tabs = ref([
|
|
|
{ label: '徽章', value: 'badge' },
|
|
|
{ label: '证书', value: 'certificate' },
|
|
|
])
|
|
|
-// 游学徽章,活动徽章,积分徽章,典藏勋章,传播徽章,打卡徽章,课程徽章
|
|
|
-const badgeTypes = ref([
|
|
|
- { label: '游学徽章', value: '游学徽章' },
|
|
|
- { label: '活动徽章', value: '活动徽章' },
|
|
|
- { label: '积分徽章', value: '积分徽章' },
|
|
|
- { label: '典藏勋章', value: '典藏勋章' },
|
|
|
- { label: '传播徽章', value: '传播徽章' },
|
|
|
- { label: '打卡徽章', value: '打卡徽章' },
|
|
|
- { label: '课程徽章', value: '课程徽章' },
|
|
|
-])
|
|
|
-const { data: badges, run: setBadges } = useRequest(
|
|
|
- () =>
|
|
|
- // Promise.all(badgeTypes.value.map((it) => getBadges({}))).then((res) => ({
|
|
|
- // data: res,
|
|
|
- // code: 0,
|
|
|
- // msg: 'ok',
|
|
|
- // })),
|
|
|
- getBadges({}),
|
|
|
- {
|
|
|
- initialData: {},
|
|
|
- },
|
|
|
-)
|
|
|
+const { data: statistics, run: setStatistics } = useRequest(() => getHonorStatistics())
|
|
|
+const { data: badges, run: setBadges } = useRequest(() => getBadges({}), {
|
|
|
+ initialData: {},
|
|
|
+})
|
|
|
const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
|
|
|
initialData: [],
|
|
|
})
|
|
|
onMounted(async () => {
|
|
|
+ await setStatistics()
|
|
|
await setBadges()
|
|
|
await setCertificates()
|
|
|
console.log(badges.value)
|
|
@@ -72,8 +55,8 @@ onMounted(async () => {
|
|
|
<div class="mt-4 flex justify-between">
|
|
|
<template
|
|
|
v-for="(it, i) in [
|
|
|
- { label: '获得徽章', value: 10, unit: '枚' },
|
|
|
- { label: '获得证书', value: 10, unit: '个' },
|
|
|
+ { label: '获得徽章', value: statistics?.badgeCount, unit: '枚' },
|
|
|
+ { label: '获得证书', value: statistics?.certCount, unit: '个' },
|
|
|
]"
|
|
|
:key="i"
|
|
|
>
|