hookehuyr

feat(CourseCard): 添加已购课程标识

在课程卡片上添加已购标识,当课程已被购买时显示
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-09-24 22:59:47 4 + * @LastEditTime: 2025-09-30 13:49:35
5 * @FilePath: /mlaj/src/components/ui/CourseCard.vue 5 * @FilePath: /mlaj/src/components/ui/CourseCard.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 <router-link :to="linkTo || `/courses/${course.id}`" class="flex bg-white rounded-lg overflow-hidden shadow-sm"> 9 <router-link :to="linkTo || `/courses/${course.id}`" class="flex bg-white rounded-lg overflow-hidden shadow-sm">
10 - <div class="w-1/3 h-28"> 10 + <div class="w-1/3 h-28 relative">
11 <img 11 <img
12 :src="course.cover || 'https://cdn.ipadbiz.cn/mlaj/images/default_block.png'" 12 :src="course.cover || 'https://cdn.ipadbiz.cn/mlaj/images/default_block.png'"
13 :alt="course.title" 13 :alt="course.title"
14 class="w-full h-full object-cover" 14 class="w-full h-full object-cover"
15 /> 15 />
16 + <!-- 已购标识 -->
17 + <div
18 + v-if="course.is_buy"
19 + class="absolute top-0 left-0 bg-orange-500 text-white text-xs px-2 py-1 rounded-br-lg font-medium"
20 + style="background-color: rgba(249, 115, 22, 0.85)"
21 + >
22 + 已购
23 + </div>
16 </div> 24 </div>
17 <div class="flex-1 p-3 flex flex-col justify-between"> 25 <div class="flex-1 p-3 flex flex-col justify-between">
18 <div> 26 <div>
......