hookehuyr

refactor(ui): 移除冗余字段并优化显示逻辑

- 移除CourseCard、HomePage、StudyCoursePage和CourseDetailPage中的冗余字段和默认值
- 优化课程信息的显示逻辑,直接使用后端返回的数据
- 更新组件类型声明文件,移除未使用的组件
...@@ -16,7 +16,6 @@ declare module 'vue' { ...@@ -16,7 +16,6 @@ declare module 'vue' {
16 ConfirmDialog: typeof import('./components/ui/ConfirmDialog.vue')['default'] 16 ConfirmDialog: typeof import('./components/ui/ConfirmDialog.vue')['default']
17 CourseCard: typeof import('./components/ui/CourseCard.vue')['default'] 17 CourseCard: typeof import('./components/ui/CourseCard.vue')['default']
18 CourseList: typeof import('./components/courses/CourseList.vue')['default'] 18 CourseList: typeof import('./components/courses/CourseList.vue')['default']
19 - CreateReviewPopup: typeof import('./components/ui/CreateReviewPopup.vue')['default']
20 FrostedGlass: typeof import('./components/ui/FrostedGlass.vue')['default'] 19 FrostedGlass: typeof import('./components/ui/FrostedGlass.vue')['default']
21 GradientHeader: typeof import('./components/ui/GradientHeader.vue')['default'] 20 GradientHeader: typeof import('./components/ui/GradientHeader.vue')['default']
22 LiveStreamCard: typeof import('./components/ui/LiveStreamCard.vue')['default'] 21 LiveStreamCard: typeof import('./components/ui/LiveStreamCard.vue')['default']
...@@ -48,7 +47,6 @@ declare module 'vue' { ...@@ -48,7 +47,6 @@ declare module 'vue' {
48 VanRate: typeof import('vant/es')['Rate'] 47 VanRate: typeof import('vant/es')['Rate']
49 VanTab: typeof import('vant/es')['Tab'] 48 VanTab: typeof import('vant/es')['Tab']
50 VanTabs: typeof import('vant/es')['Tabs'] 49 VanTabs: typeof import('vant/es')['Tabs']
51 - VanToast: typeof import('vant/es')['Toast']
52 VanUploader: typeof import('vant/es')['Uploader'] 50 VanUploader: typeof import('vant/es')['Uploader']
53 VideoPlayer: typeof import('./components/ui/VideoPlayer.vue')['default'] 51 VideoPlayer: typeof import('./components/ui/VideoPlayer.vue')['default']
54 } 52 }
......
1 <!-- 1 <!--
2 * @Date: 2025-03-20 20:36:36 2 * @Date: 2025-03-20 20:36:36
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-04-22 10:17:33 4 + * @LastEditTime: 2025-04-29 14:12:16
5 * @FilePath: /mlaj/src/components/ui/CourseCard.vue 5 * @FilePath: /mlaj/src/components/ui/CourseCard.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
17 <div class="flex-1 p-3 flex flex-col justify-between"> 17 <div class="flex-1 p-3 flex flex-col justify-between">
18 <div> 18 <div>
19 <h3 class="font-medium text-sm mb-1 line-clamp-2">{{ course.title }}</h3> 19 <h3 class="font-medium text-sm mb-1 line-clamp-2">{{ course.title }}</h3>
20 - <div class="text-gray-500 text-xs">{{ course.subtitle || 'N/A' }}</div> 20 + <div class="text-gray-500 text-xs">{{ course.subtitle }}</div>
21 </div> 21 </div>
22 <div class="flex justify-between items-end mt-1"> 22 <div class="flex justify-between items-end mt-1">
23 - <div class="text-orange-500 font-semibold">¥{{ course.price || 'N/A' }}</div> 23 + <div class="text-orange-500 font-semibold">¥{{ course.price }}</div>
24 <div class="text-gray-400 text-xs"> 24 <div class="text-gray-400 text-xs">
25 {{ course.buy_count }}人订阅 25 {{ course.buy_count }}人订阅
26 </div> 26 </div>
......
1 <!-- 1 <!--
2 * @Date: 2025-03-20 19:55:21 2 * @Date: 2025-03-20 19:55:21
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-04-15 13:52:20 4 + * @LastEditTime: 2025-04-29 14:31:56
5 * @FilePath: /mlaj/src/views/HomePage.vue 5 * @FilePath: /mlaj/src/views/HomePage.vue
6 * @Description: 亲子学院首页组件 6 * @Description: 亲子学院首页组件
7 * 7 *
...@@ -314,14 +314,12 @@ ...@@ -314,14 +314,12 @@
314 /> 314 />
315 </div> 315 </div>
316 <h4 class="font-medium text-sm mb-1 line-clamp-1">{{ item.title }}</h4> 316 <h4 class="font-medium text-sm mb-1 line-clamp-1">{{ item.title }}</h4>
317 - <p class="text-xs text-gray-500 flex items-center mt-auto"> 317 + <!--<p class="text-xs text-gray-500 flex items-center mt-auto">
318 <svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> 318 <svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
319 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /> 319 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
320 </svg> 320 </svg>
321 - <!-- TODO: 后台没字段 --> 321 + <!~~ {{ item.duration }} ~~>
322 - <!-- {{ item.duration }} --> 322 + </p>-->
323 - 后台没字段
324 - </p>
325 </div> 323 </div>
326 </FrostedGlass> 324 </FrostedGlass>
327 </div> 325 </div>
......
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
4 <!-- Course Header --> 4 <!-- Course Header -->
5 <div class="px-4"> 5 <div class="px-4">
6 <div class="bg-gradient-to-b from-red-500 to-red-600 p-4 mb-4 rounded-b-3xl shadow-lg"> 6 <div class="bg-gradient-to-b from-red-500 to-red-600 p-4 mb-4 rounded-b-3xl shadow-lg">
7 - <div class="bg-white/10 backdrop-blur-sm rounded-lg p-3 mb-3 inline-block"> 7 + <div v-if="course?.group_type_title" class="bg-white/10 backdrop-blur-sm rounded-lg p-3 mb-3 inline-block">
8 - <div class="text-white font-semibold">{{ course?.subtitle?.split(' ')[0] || '没有字段' }}</div> 8 + <div class="text-white font-semibold">{{ course?.group_type_title }}</div>
9 </div> 9 </div>
10 <h1 class="text-2xl text-white font-bold mb-1">{{ course?.title }}</h1> 10 <h1 class="text-2xl text-white font-bold mb-1">{{ course?.title }}</h1>
11 - <h2 class="text-lg text-white/90">{{ course?.subtitle || '没有字段' }}</h2> 11 + <h2 class="text-lg text-white/90">{{ course?.subtitle }}</h2>
12 <div class="mt-4 flex justify-between items-center"> 12 <div class="mt-4 flex justify-between items-center">
13 - <div class="text-orange-300 font-bold text-2xl">¥{{ course?.price || 'N/A' }}</div> 13 + <div class="text-orange-300 font-bold text-2xl">¥{{ course?.price }}</div>
14 <div class="bg-orange-500/30 text-orange-100 text-xs px-3 py-1 rounded-full"> 14 <div class="bg-orange-500/30 text-orange-100 text-xs px-3 py-1 rounded-full">
15 限时优惠 15 限时优惠
16 </div> 16 </div>
17 </div> 17 </div>
18 <div class="flex justify-between text-xs text-white/80 mt-3"> 18 <div class="flex justify-between text-xs text-white/80 mt-3">
19 - <div>已更新{{ course?.count || 'N/A' }}期</div> 19 + <div>已更新{{ course?.count }}期</div>
20 <div>{{ course?.buy_count }}人订阅</div> 20 <div>{{ course?.buy_count }}人订阅</div>
21 </div> 21 </div>
22 <div v-if="course?.expireDate" class="text-xs text-white/80 mt-1"> 22 <div v-if="course?.expireDate" class="text-xs text-white/80 mt-1">
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
30 <!-- Course Details --> 30 <!-- Course Details -->
31 <FrostedGlass class="mb-4 p-4 rounded-xl"> 31 <FrostedGlass class="mb-4 p-4 rounded-xl">
32 <h3 class="text-lg font-bold text-gray-800 mb-3">本课程介绍</h3> 32 <h3 class="text-lg font-bold text-gray-800 mb-3">本课程介绍</h3>
33 - <p class="text-gray-700 whitespace-pre-line"> 33 + <p v-html="course?.introduce" class="text-gray-700 whitespace-pre-line"></p>
34 - {{ course?.description || '没有字段' }}
35 - </p>
36 </FrostedGlass> 34 </FrostedGlass>
37 35
38 <!-- Course Image --> 36 <!-- Course Image -->
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
12 <div class="p-4"> 12 <div class="p-4">
13 <h1 class="text-black text-xl font-bold mb-2">{{ course?.title }}</h1> 13 <h1 class="text-black text-xl font-bold mb-2">{{ course?.title }}</h1>
14 <div class="flex items-center text-gray-500 text-sm"> 14 <div class="flex items-center text-gray-500 text-sm">
15 - <span>已更新 没有字段 期</span> 15 + <span>已更新 {{ course?.count }} 期</span>
16 <span class="mx-2">|</span> 16 <span class="mx-2">|</span>
17 - <span>没有字段 人订阅</span> 17 + <span>没有字段=> 人订阅</span>
18 </div> 18 </div>
19 </div> 19 </div>
20 20
...@@ -77,15 +77,15 @@ ...@@ -77,15 +77,15 @@
77 class="bg-white p-4 cursor-pointer hover:bg-gray-50 transition-colors border-b border-gray-200 relative"> 77 class="bg-white p-4 cursor-pointer hover:bg-gray-50 transition-colors border-b border-gray-200 relative">
78 <div v-if="lesson.progress > 0 && lesson.progress < 100" 78 <div v-if="lesson.progress > 0 && lesson.progress < 100"
79 class="absolute top-2 right-2 px-2 py-1 bg-green-100 text-green-600 text-xs rounded"> 79 class="absolute top-2 right-2 px-2 py-1 bg-green-100 text-green-600 text-xs rounded">
80 - 没有字段上次看到</div> 80 + 没有字段=>上次看到</div>
81 <div class="text-black text-base font-medium mb-2">{{ lesson.title }}</div> 81 <div class="text-black text-base font-medium mb-2">{{ lesson.title }}</div>
82 <div class="flex items-center text-sm text-gray-500"> 82 <div class="flex items-center text-sm text-gray-500">
83 <span>{{ course_type_maps[lesson.course_type] }}</span>&nbsp; 83 <span>{{ course_type_maps[lesson.course_type] }}</span>&nbsp;
84 <span>{{ dayjs(course.schedule_time).format('YYYY-MM-DD') }}</span> 84 <span>{{ dayjs(course.schedule_time).format('YYYY-MM-DD') }}</span>
85 <span class="mx-2">|</span> 85 <span class="mx-2">|</span>
86 - <span>没有字段 次学习</span> 86 + <span>没有字段=> 次学习</span>
87 <span class="mx-2">|</span> 87 <span class="mx-2">|</span>
88 - <span>没有字段 已学习{{ lesson?.progress }}%</span> 88 + <span>没有字段=> 已学习{{ lesson?.progress }}%</span>
89 </div> 89 </div>
90 </div> 90 </div>
91 </div> 91 </div>
......