|
@@ -3,11 +3,20 @@ import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
|
|
|
import { httpAjaxErrMsg } from "@/plugin/httpAjax"
|
|
|
import useDialogConfirm from "@/hooks/useDialogConfirm"
|
|
|
import { format } from "@/libs/tools"
|
|
|
+import router from "@/router"
|
|
|
|
|
|
/* 管乐迷 开始上课 */
|
|
|
export function handleStartClass_gym(id: string) {
|
|
|
httpAjaxErrMsg(getRecentCourseSchedule_gym, id).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
+ if (!res.data) {
|
|
|
+ useDialogConfirm({
|
|
|
+ headImg: require("@/img/curriculum/ts4.png"),
|
|
|
+ text: `该课程已结束`,
|
|
|
+ btnShow: [true]
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
const { signInStatusEnum, isCallNames, coursewareDetailId, startClassTime, endClassTime } = res.data
|
|
|
if (signInStatusEnum === 3) {
|
|
|
useDialogConfirm({
|
|
@@ -33,7 +42,7 @@ export function handleStartClass_gym(id: string) {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- alert("开始上课")
|
|
|
+ handlePaly(coursewareDetailId)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -53,7 +62,15 @@ export function isONLINE_gym(teachMode: string) {
|
|
|
export function handleStartClass_gyt(id: string) {
|
|
|
httpAjaxErrMsg(getCourseScheduleDetail_gyt, id).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- const { signIn, rollCall, lessonCoursewareId, startTime, endTime } = res.data
|
|
|
+ const { signIn, rollCall, lessonCoursewareId, startTime, endTime, status } = res.data
|
|
|
+ if (status === "COMPLETE") {
|
|
|
+ useDialogConfirm({
|
|
|
+ headImg: require("@/img/curriculum/ts4.png"),
|
|
|
+ text: `该课程已结束`,
|
|
|
+ btnShow: [true]
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!signIn) {
|
|
|
useDialogConfirm({
|
|
|
headImg: require("@/img/curriculum/ts2.png"),
|
|
@@ -78,7 +95,18 @@ export function handleStartClass_gyt(id: string) {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- alert("开始上课")
|
|
|
+ handlePaly(lessonCoursewareId)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+function handlePaly(id: string) {
|
|
|
+ const url = router.resolve({
|
|
|
+ name: "coursewarePlay",
|
|
|
+ params: { id },
|
|
|
+ query: {
|
|
|
+ mode: "class"
|
|
|
+ }
|
|
|
+ }).href
|
|
|
+ window.open(url, "_blank")
|
|
|
+}
|