Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-29 18:17:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
38be84c9091b8027b4d0e5c2b39045705b941d28
38be84c9
1 parent
c5b82f93
fix(课程详情页): 添加课程时间检查并提示用户
在跳转学习详情前检查课程是否在开课时间内,若不在则显示提示对话框
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
src/views/courses/CourseDetailPage.vue
src/views/courses/CourseDetailPage.vue
View file @
38be84c
...
...
@@ -334,7 +334,7 @@ import { useRoute, useRouter } from 'vue-router'
import { useCart } from '@/contexts/cart'
import { useAuth } from '@/contexts/auth'
import { useTitle } from '@vueuse/core';
import { showToast } from 'vant';
import { showToast
, showDialog
} from 'vant';
import { formatDate } from '@/utils/tools'
import AppLayout from '@/components/layout/AppLayout.vue'
...
...
@@ -593,6 +593,16 @@ const goToStudyDetail = (item) => {
showToast('购买的课程正在审核中,请稍后再试');
return;
}
// 检查课程是否在开课时间内, course_start_time 开课时间, course_end_time 停课时间
if (!course.value.is_in_course_time) {
showDialog({
title: '温馨提示',
message: `请在指定课程时间: ${course.value.course_start_time} - ${course.value.course_end_time}内操作!`,
confirmButtonText: '知道了',
confirmButtonColor: '#4caf50',
})
return;
}
// 跳转详情
router.push(`/studyDetail/${item.id}`)
}
...
...
Please
register
or
login
to post a comment