Переглянути джерело

refactor(merchant): 优化跳转到个人主页功能并调整相关组件

- 在 toHomePage 函数中添加日志输出和错误处理
- 修复设计师详情页面中个人主页跳转的 id 传递问题
- 在个人主页的 onLoad 钩子中添加查询参数日志输出
- 优化列表助手组件中的 slot 属性传递- 调整 construction-dashed 样式的应用方式
EvilDragon 4 місяців тому
батько
коміт
0553c84c83

+ 1 - 0
packages/app/src/pages/mine/homepage/index.vue

@@ -131,6 +131,7 @@ const handleUnbundle = async () => {
   })
 }
 onLoad(async (query: { id: string; isShared?: string }) => {
+  console.log(query)
   if (query.id) {
     id.value = query.id
   } else {

+ 10 - 6
packages/merchant/src/components/list-helper-evo.vue

@@ -58,7 +58,11 @@ defineExpose({
 <template>
   <div class="flex-grow flex flex-col relative">
     <template v-for="(it, index) in data" :key="index">
-      <slot :item="it as UnwrapRef<T>" :index="index" :isLast="index == data.length - 1"></slot>
+      <slot
+        :item="it as UnwrapRef<T>"
+        :index="index"
+        :isLast="index == (data?.length ?? 0) - 1"
+      ></slot>
     </template>
     <div
       class="construction-dashed absolute top-0 right-0 left-0 bottom-0 bg-red/20 flex items-center justify-center pointer-events-none"
@@ -69,12 +73,12 @@ defineExpose({
 </template>
 
 <style scoped lang="scss">
-@layer utilities {
-  .construction-dashed {
-    @apply relative border-4 border-black/50 border-dashed; /* 基础虚线样式 */
-    animation: dashed-move 2s linear infinite; /* 虚线移动动画 */
-  }
+//@layer utilities {
+.construction-dashed {
+  @apply border-4 border-black/50 border-dashed; /* 基础虚线样式 */
+  animation: dashed-move 2s linear infinite; /* 虚线移动动画 */
 }
+//}
 @keyframes dashed-move {
   from {
     border-spacing: 0;

+ 8 - 5
packages/merchant/src/core/libs/actions.ts

@@ -27,9 +27,12 @@ export const handleUpvoteClick = async (
 }
 
 export const toHomePage = (id: string) => {
-  uni.navigateToMiniProgram({
-    appId: 'wx4d95c9addba81089',
-    envVersion: 'trial',
-    path: '/pages/mine/homepage/index' + '?id=' + id,
-  })
+  console.log(id)
+  uni
+    .navigateToMiniProgram({
+      appId: 'wx4d95c9addba81089',
+      envVersion: 'trial',
+      path: '/pages/mine/homepage/index' + '?id=' + id,
+    })
+    .then()
 }

+ 1 - 1
packages/merchant/src/pages/agent/designer/detail.vue

@@ -91,7 +91,7 @@ onLoad((query) => {
               </div>
               <div
                 class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-snug flex items-center"
-                @click="toHomePage(id.value)"
+                @click="toHomePage(id)"
               >
                 <div>个人主页</div>
                 <wd-img width="13" height="13" :src="rightArrowIcon"></wd-img>