|
@@ -35,13 +35,25 @@ const { data: badges, run: setBadges } = useRequest(() => getBadges({}), {
|
|
const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
|
|
const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
|
|
initialData: [],
|
|
initialData: [],
|
|
})
|
|
})
|
|
-const data = ref<{ name: string }>()
|
|
|
|
|
|
+const data = ref<{
|
|
|
|
+ name: string
|
|
|
|
+ quantity: number
|
|
|
|
+ // 已获取的图片和未获取的图片
|
|
|
|
+ image: string
|
|
|
|
+ activedImage: string
|
|
|
|
+}>()
|
|
|
|
+const image = computed(() => (data.value.quantity ? data.value.activedImage : data.value.image))
|
|
onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
|
|
onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
|
|
console.log(JSON.parse(query.data))
|
|
console.log(JSON.parse(query.data))
|
|
|
|
|
|
if (query.type === 'badge') {
|
|
if (query.type === 'badge') {
|
|
const badge = JSON.parse(query.data) as Badge
|
|
const badge = JSON.parse(query.data) as Badge
|
|
- data.value = { name: badge.badgeName }
|
|
|
|
|
|
+ data.value = {
|
|
|
|
+ name: badge.badgeName,
|
|
|
|
+ quantity: badge.quantity,
|
|
|
|
+ image: badge.badgeNotObtainedImage,
|
|
|
|
+ activedImage: badge.badgeYesObtainedImage,
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
@@ -66,7 +78,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
|
|
></wd-img>
|
|
></wd-img>
|
|
</div>
|
|
</div>
|
|
<NavbarEvo fixed dark transparent></NavbarEvo>
|
|
<NavbarEvo fixed dark transparent></NavbarEvo>
|
|
- <wd-img width="42%" mode="widthFix" :src="data.badgeYesObtainedImage"></wd-img>
|
|
|
|
|
|
+ <wd-img width="42%" mode="widthFix" :src="image"></wd-img>
|
|
<div class="flex flex-col items-center gap-1">
|
|
<div class="flex flex-col items-center gap-1">
|
|
<div class="text-white text-[26px] font-normal font-['PingFang_SC'] uppercase">
|
|
<div class="text-white text-[26px] font-normal font-['PingFang_SC'] uppercase">
|
|
<!-- 东方研习营 -->
|
|
<!-- 东方研习营 -->
|
|
@@ -74,6 +86,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
|
|
</div>
|
|
</div>
|
|
<div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
|
|
<div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
|
|
<!-- 参加东方艺术设计研学营 -->
|
|
<!-- 参加东方艺术设计研学营 -->
|
|
|
|
+ {{ `参加${data.name}` }}
|
|
</div>
|
|
</div>
|
|
<div class="mt-6 flex items-center gap-4">
|
|
<div class="mt-6 flex items-center gap-4">
|
|
<div class="w-4 h-0.25 bg-white"></div>
|
|
<div class="w-4 h-0.25 bg-white"></div>
|
|
@@ -83,7 +96,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
|
|
<div class="w-4 h-0.25 bg-white"></div>
|
|
<div class="w-4 h-0.25 bg-white"></div>
|
|
</div>
|
|
</div>
|
|
<div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
|
|
<div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
|
|
- 累计参与3次
|
|
|
|
|
|
+ 累计参与{{ data.quantity }}次
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<wd-button custom-class="w-[161px] h-12 bg-[#0cbe7c]! rounded-[30px]">去分享</wd-button>
|
|
<wd-button custom-class="w-[161px] h-12 bg-[#0cbe7c]! rounded-[30px]">去分享</wd-button>
|