Skip to content

Commit

Permalink
feat: sponsors amount
Browse files Browse the repository at this point in the history
  • Loading branch information
zly2006 committed Mar 16, 2024
1 parent 70c2afa commit d52c519
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/views/Sponsors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> = {
CNY: '¥',
USD: '$',
EUR: '',
JPY: 'JP¥',
KRW: '',
GBP: '£',
CAD: 'C$',
AUD: 'A$',
HKD: 'HK$',
}
const sponsors: Ref<Sponsor[]> = ref([]);
doFetchGet('/api/sponsors')
.then((res) => {
Expand Down Expand Up @@ -52,12 +65,13 @@ doFetchGet('/api/sponsors')
v-for="sponsor in sponsors"
:key="sponsor.name"
>
<!--suppress VueUnrecognizedDirective -->
<v-list-item :key="sponsor.name" v-ripple>
<v-list-item-title class="text-h6">{{
sponsor.name
}}</v-list-item-title>
<v-list-item-subtitle>{{
sponsor.detail || '¥' + sponsor.amount
sponsor.detail || unitDisplay[sponsor.unit] + sponsor.amount
}}</v-list-item-subtitle>
<v-list-item-action>
<v-img :src="sponsor.avatar" />
Expand Down

0 comments on commit d52c519

Please sign in to comment.