hookehuyr

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

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