refactor: 移除未使用的组件和注释代码,优化导航点击处理
移除首页和学习详情页中未使用的标签导航和直播卡片组件 将社区导航改为显示提示而非跳转 修复视频播放器的可选链访问问题
Showing
4 changed files
with
10 additions
and
8 deletions
| 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-03-21 10:20:44 | 4 | + * @LastEditTime: 2025-06-10 15:27:23 |
| 5 | * @FilePath: /mlaj/src/components/layout/BottomNav.vue | 5 | * @FilePath: /mlaj/src/components/layout/BottomNav.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -40,6 +40,7 @@ | ... | @@ -40,6 +40,7 @@ |
| 40 | import { computed } from 'vue' | 40 | import { computed } from 'vue' |
| 41 | import { useRoute, useRouter } from 'vue-router' | 41 | import { useRoute, useRouter } from 'vue-router' |
| 42 | import { useAuth } from '@/contexts/auth' | 42 | import { useAuth } from '@/contexts/auth' |
| 43 | +import { showToast } from 'vant' | ||
| 43 | 44 | ||
| 44 | const route = useRoute() | 45 | const route = useRoute() |
| 45 | const router = useRouter() | 46 | const router = useRouter() |
| ... | @@ -74,7 +75,8 @@ const isActive = (path) => { | ... | @@ -74,7 +75,8 @@ const isActive = (path) => { |
| 74 | 75 | ||
| 75 | const handleNavClick = (item) => { | 76 | const handleNavClick = (item) => { |
| 76 | if (item.path === '/community') { | 77 | if (item.path === '/community') { |
| 77 | - window.open('https://community.mlaj.com', '_blank') | 78 | + showToast('功能暂未开放') |
| 79 | + // window.open('https://community.mlaj.com', '_blank') | ||
| 78 | return | 80 | return |
| 79 | } | 81 | } |
| 80 | if (item.path === '/profile' && !currentUser.value) { | 82 | if (item.path === '/profile' && !currentUser.value) { | ... | ... |
| ... | @@ -249,7 +249,7 @@ | ... | @@ -249,7 +249,7 @@ |
| 249 | </div> | 249 | </div> |
| 250 | 250 | ||
| 251 | <!-- Custom Tab Navigation --> | 251 | <!-- Custom Tab Navigation --> |
| 252 | - <div class="sticky top-0 bg-white/70 backdrop-blur-lg" style="z-index: 9;"> | 252 | + <!-- <div class="sticky top-0 bg-white/70 backdrop-blur-lg" style="z-index: 9;"> |
| 253 | <div class="px-4 border-b border-gray-200"> | 253 | <div class="px-4 border-b border-gray-200"> |
| 254 | <div class="flex space-x-6"> | 254 | <div class="flex space-x-6"> |
| 255 | <button | 255 | <button |
| ... | @@ -273,7 +273,7 @@ | ... | @@ -273,7 +273,7 @@ |
| 273 | </button> | 273 | </button> |
| 274 | </div> | 274 | </div> |
| 275 | </div> | 275 | </div> |
| 276 | - </div> | 276 | + </div> --> |
| 277 | 277 | ||
| 278 | <!-- Content Based on Active Tab --> | 278 | <!-- Content Based on Active Tab --> |
| 279 | <div class="px-4 mt-5" ref="contentRef"> | 279 | <div class="px-4 mt-5" ref="contentRef"> | ... | ... |
| ... | @@ -24,7 +24,7 @@ | ... | @@ -24,7 +24,7 @@ |
| 24 | </div> | 24 | </div> |
| 25 | 25 | ||
| 26 | <!-- Today's Live --> | 26 | <!-- Today's Live --> |
| 27 | - <div class="px-4 mb-4"> | 27 | + <!--<div class="px-4 mb-4"> |
| 28 | <div class="flex items-center mb-2"> | 28 | <div class="flex items-center mb-2"> |
| 29 | <h2 class="font-medium">今日直播</h2> | 29 | <h2 class="font-medium">今日直播</h2> |
| 30 | <div | 30 | <div |
| ... | @@ -38,7 +38,7 @@ | ... | @@ -38,7 +38,7 @@ |
| 38 | </div> | 38 | </div> |
| 39 | </div> | 39 | </div> |
| 40 | 40 | ||
| 41 | - <!-- Live Stream Cards --> | 41 | + <!~~ Live Stream Cards ~~> |
| 42 | <div class="grid grid-cols-2 gap-4"> | 42 | <div class="grid grid-cols-2 gap-4"> |
| 43 | <LiveStreamCard | 43 | <LiveStreamCard |
| 44 | v-for="stream in liveStreams" | 44 | v-for="stream in liveStreams" |
| ... | @@ -46,7 +46,7 @@ | ... | @@ -46,7 +46,7 @@ |
| 46 | :stream="stream" | 46 | :stream="stream" |
| 47 | /> | 47 | /> |
| 48 | </div> | 48 | </div> |
| 49 | - </div> | 49 | + </div>--> |
| 50 | 50 | ||
| 51 | <!-- Value Online Courses --> | 51 | <!-- Value Online Courses --> |
| 52 | <div class="px-4 mb-4"> | 52 | <div class="px-4 mb-4"> | ... | ... |
| ... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
| 23 | </div> | 23 | </div> |
| 24 | <!-- 视频播放器 --> | 24 | <!-- 视频播放器 --> |
| 25 | <VideoPlayer v-show="isPlaying" ref="videoPlayerRef" | 25 | <VideoPlayer v-show="isPlaying" ref="videoPlayerRef" |
| 26 | - :video-url="courseFile.list.length ? courseFile['list'][0]['url'] : ''" :autoplay="false" | 26 | + :video-url="courseFile?.list?.length ? courseFile['list'][0]['url'] : ''" :autoplay="false" |
| 27 | @onPlay="handleVideoPlay" @onPause="handleVideoPause" /> | 27 | @onPlay="handleVideoPlay" @onPause="handleVideoPause" /> |
| 28 | </div> | 28 | </div> |
| 29 | <div v-if="course.course_type === 'audio'" class="w-full relative" | 29 | <div v-if="course.course_type === 'audio'" class="w-full relative" | ... | ... |
-
Please register or login to post a comment