Ver Fonte

feat: 更新荣誉详情页,添加数量和图片逻辑,优化展示信息

EvilDragon há 1 mês atrás
pai
commit
1202b17afb

+ 17 - 4
packages/app/src/pages/mine/honors/detail/index.vue

@@ -35,13 +35,25 @@ const { data: badges, run: setBadges } = useRequest(() => getBadges({}), {
 const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
   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 }) => {
   console.log(JSON.parse(query.data))
 
   if (query.type === '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>
@@ -66,7 +78,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
       ></wd-img>
     </div>
     <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="text-white text-[26px] font-normal font-['PingFang_SC'] uppercase">
         <!-- 东方研习营 -->
@@ -74,6 +86,7 @@ onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
       </div>
       <div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
         <!-- 参加东方艺术设计研学营 -->
+        {{ `参加${data.name}` }}
       </div>
       <div class="mt-6 flex items-center gap-4">
         <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>
       <div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
-        累计参与3
+        累计参与{{ data.quantity }}
       </div>
     </div>
     <wd-button custom-class="w-[161px] h-12 bg-[#0cbe7c]! rounded-[30px]">去分享</wd-button>

+ 1 - 1
packages/merchant/src/pages/home/index.vue

@@ -129,7 +129,7 @@ onShareAppMessage(() => ({}))
               <PageHelperEvo :request="getTodoPage" :query="todosQuery"></PageHelperEvo>
               <div
                 class="flex items-center justify-center b-t b-t-solid b-t-[#f6f6f6] pt-3.5"
-                @click="router.push('/pages/home/agent/todo/index')"
+                @click="router.push('/pages/agent/todo/index')"
               >
                 <div class="text-[#2357e9] text-xs font-normal font-['PingFang_SC'] leading-none">
                   全部待办