refactor(views): 将MyCoursesPage和MyFavoritesPage封装到AppLayout中
为了提高代码的可维护性和一致性,将MyCoursesPage和MyFavoritesPage的页面内容封装到AppLayout组件中。这样可以统一页面的布局结构,减少重复代码。
Showing
2 changed files
with
7 additions
and
1 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-21 12:17:03 | 2 | * @Date: 2025-03-21 12:17:03 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-04-18 17:30:15 | 4 | + * @LastEditTime: 2025-05-12 09:30:50 |
| 5 | * @FilePath: /mlaj/src/views/courses/MyCoursesPage.vue | 5 | * @FilePath: /mlaj/src/views/courses/MyCoursesPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | + <AppLayout> | ||
| 9 | <div class="bg-gradient-to-b from-green-50/70 to-white/90 min-h-screen pb-20"> | 10 | <div class="bg-gradient-to-b from-green-50/70 to-white/90 min-h-screen pb-20"> |
| 10 | <!-- Course List --> | 11 | <!-- Course List --> |
| 11 | <van-list | 12 | <van-list |
| ... | @@ -26,6 +27,7 @@ | ... | @@ -26,6 +27,7 @@ |
| 26 | <p class="mt-4 text-gray-500">暂无课程记录</p> | 27 | <p class="mt-4 text-gray-500">暂无课程记录</p> |
| 27 | </div> | 28 | </div> |
| 28 | </div> | 29 | </div> |
| 30 | + </AppLayout> | ||
| 29 | </template> | 31 | </template> |
| 30 | 32 | ||
| 31 | <script setup> | 33 | <script setup> |
| ... | @@ -33,6 +35,7 @@ import { ref } from 'vue'; | ... | @@ -33,6 +35,7 @@ import { ref } from 'vue'; |
| 33 | import { useRoute, useRouter } from 'vue-router'; | 35 | import { useRoute, useRouter } from 'vue-router'; |
| 34 | import CourseCard from '@/components/ui/CourseCard.vue'; | 36 | import CourseCard from '@/components/ui/CourseCard.vue'; |
| 35 | import { useTitle } from '@vueuse/core'; | 37 | import { useTitle } from '@vueuse/core'; |
| 38 | +import AppLayout from "@/components/layout/AppLayout.vue"; | ||
| 36 | 39 | ||
| 37 | // 导入接口 | 40 | // 导入接口 |
| 38 | import { getOrderListAPI } from '@/api/order' | 41 | import { getOrderListAPI } from '@/api/order' | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | + <AppLayout> | ||
| 2 | <div class="bg-gradient-to-b from-green-50/70 to-white/90 min-h-screen pb-20"> | 3 | <div class="bg-gradient-to-b from-green-50/70 to-white/90 min-h-screen pb-20"> |
| 3 | <!-- 分类切换 --> | 4 | <!-- 分类切换 --> |
| 4 | <div class="px-4 py-3"> | 5 | <div class="px-4 py-3"> |
| ... | @@ -45,6 +46,7 @@ | ... | @@ -45,6 +46,7 @@ |
| 45 | </van-tabs> | 46 | </van-tabs> |
| 46 | </div> | 47 | </div> |
| 47 | </div> | 48 | </div> |
| 49 | + </AppLayout> | ||
| 48 | </template> | 50 | </template> |
| 49 | 51 | ||
| 50 | <script setup> | 52 | <script setup> |
| ... | @@ -54,6 +56,7 @@ import CourseCard from '@/components/ui/CourseCard.vue'; | ... | @@ -54,6 +56,7 @@ import CourseCard from '@/components/ui/CourseCard.vue'; |
| 54 | import ActivityCard from '@/components/ui/ActivityCard.vue'; | 56 | import ActivityCard from '@/components/ui/ActivityCard.vue'; |
| 55 | import { courses as mockCourses, activities as mockActivities } from '@/utils/mockData'; | 57 | import { courses as mockCourses, activities as mockActivities } from '@/utils/mockData'; |
| 56 | import { useTitle } from '@vueuse/core'; | 58 | import { useTitle } from '@vueuse/core'; |
| 59 | +import AppLayout from "@/components/layout/AppLayout.vue"; | ||
| 57 | 60 | ||
| 58 | // 导入接口 | 61 | // 导入接口 |
| 59 | import { getGroupFavoriteListAPI } from '@/api/favorite'; | 62 | import { getGroupFavoriteListAPI } from '@/api/favorite'; | ... | ... |
-
Please register or login to post a comment