diff --git a/src/views/Sponsors.vue b/src/views/Sponsors.vue index 17a67a9..c676629 100644 --- a/src/views/Sponsors.vue +++ b/src/views/Sponsors.vue @@ -5,12 +5,25 @@ import { toast } from 'vuetify-sonner'; type Sponsor = { name: string; - detail: string; + detail?: string; avatar: string; amount: number; - message: string; + unit: string; + message?: string; }; +const unitDisplay: Record = { + CNY: '¥', + USD: '$', + EUR: '€', + JPY: 'JP¥', + KRW: '₩', + GBP: '£', + CAD: 'C$', + AUD: 'A$', + HKD: 'HK$', +} + const sponsors: Ref = ref([]); doFetchGet('/api/sponsors') .then((res) => { @@ -52,12 +65,13 @@ doFetchGet('/api/sponsors') v-for="sponsor in sponsors" :key="sponsor.name" > + {{ sponsor.name }} {{ - sponsor.detail || '¥' + sponsor.amount + sponsor.detail || unitDisplay[sponsor.unit] + sponsor.amount }}