123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import { getCourseScheduleDetail_gyt } from "@/api/curriculum.api"
- import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
- import { httpAjaxErrMsg } from "@/plugin/httpAjax"
- import useDialogConfirm from "@/hooks/useDialogConfirm"
- import { format } from "@/libs/tools"
- /* 管乐迷 开始上课 */
- export function handleStartClass_gym(id: string) {
- httpAjaxErrMsg(getRecentCourseSchedule_gym, id).then(res => {
- if (res.code === 200) {
- const { signInStatusEnum, isCallNames, coursewareDetailId, startClassTime, endClassTime } = res.data
- if (signInStatusEnum === 3) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts2.png"),
- text: `您当前${format(startClassTime, "hh:ii")}-${format(endClassTime, "hh:ii")}的课程暂未签到,为避免考勤异常,请到APP进行签到。`,
- btnShow: [true]
- })
- return
- }
- if (!isCallNames) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts1.png"),
- text: `您当前${format(startClassTime, "hh:ii")}-${format(endClassTime, "hh:ii")}的课程暂未点名,请到APP进行点名。`,
- btnShow: [true]
- })
- return
- }
- if (!coursewareDetailId) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts3.png"),
- text: `该课程未配置课件,请配置课件。`,
- btnShow: [true]
- })
- return
- }
- alert("开始上课")
- }
- })
- }
- // 管乐迷是否为线上课
- export function isONLINE_gym(teachMode: string) {
- if (teachMode === "ONLINE") {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts4.png"),
- text: `线上课请在管乐迷老师端完成教学。`,
- btnShow: [true]
- })
- return true
- }
- return false
- }
- /* 管乐团 开始上课 */
- export function handleStartClass_gyt(id: string) {
- httpAjaxErrMsg(getCourseScheduleDetail_gyt, id).then(res => {
- if (res.code === 200) {
- const { signIn, rollCall, lessonCoursewareId, startTime, endTime } = res.data
- if (!signIn) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts2.png"),
- text: `您当前${format(startTime, "hh:ii")}-${format(endTime, "hh:ii")}的课程暂未签到,为避免考勤异常,请到APP进行签到。`,
- btnShow: [true]
- })
- return
- }
- if (!rollCall) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts1.png"),
- text: `您当前${format(startTime, "hh:ii")}-${format(endTime, "hh:ii")}的课程暂未点名,请到APP进行点名。`,
- btnShow: [true]
- })
- return
- }
- if (!lessonCoursewareId) {
- useDialogConfirm({
- headImg: require("@/img/curriculum/ts3.png"),
- text: `该课程未配置课件,请配置课件。`,
- btnShow: [true]
- })
- return
- }
- alert("开始上课")
- }
- })
- }
|