Browse Source

refactor(app): 优化首页加载逻辑

- 调整了首页数据加载的顺序和结构
- 移除了冗余的 console.log 语句
- 优化了荣誉展示的逻辑
- 删除了未使用的导入语句
EvilDragon 4 months ago
parent
commit
9c9b74db3a

+ 6 - 8
packages/app/src/pages/home/index.vue

@@ -121,12 +121,6 @@ onShow(async () => {
     reqs.push(setStudyTours())
   }
   await Promise.all(reqs)
-})
-onLoad(async () => {
-  await Promise.all([setIndexConfigsData()])
-  swiperData.value = indexConfigsData.value.list.map((it) => ({
-    data: it,
-  }))
   const { data: badgeData } = await getBadges({})
   const { data: certificates } = await getCertificates()
   console.log(certificates)
@@ -151,8 +145,6 @@ onLoad(async () => {
         image: it.certificateImage,
       })),
   ]
-  // console.log(honors)
-  // console.log(badges)
   if (honors.length) {
     const honor = honors[0]
     await show({
@@ -168,6 +160,12 @@ onLoad(async () => {
       },
     })
   }
+})
+onLoad(async () => {
+  await Promise.all([setIndexConfigsData()])
+  swiperData.value = indexConfigsData.value.list.map((it) => ({
+    data: it,
+  }))
   // await show({
   //   title: badges
   // })

+ 0 - 1
packages/merchant/src/pages/mine/agent/settings/index.vue

@@ -10,7 +10,6 @@
 import { useUserStore } from '../../../../store'
 import { storeToRefs } from 'pinia'
 
-import { rightArrowIcon } from '@designer-hub/assets/src/svgs'
 import { getBroker, getVendorAppInfo } from '../../../../core/libs/requests'
 import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
 import { messages } from '../../../../core/libs/messages'