feat:修改讨论发表及显示

This commit is contained in:
lixg
2023-02-22 19:38:14 +08:00
parent 211e046bd7
commit 1766e110d2
6 changed files with 285 additions and 1402 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-16 17:26:39
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-20 11:56:39
* @LastEditTime: 2023-02-22 19:32:18
* @FilePath: /stu_h5/src/components/ReturnHead.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -80,6 +80,10 @@ export default {
type: Function,
default: null,
},
id: {
type: Number,
default: null,
},
},
setup(props, ctx) {
const router = useRouter();
@@ -108,6 +112,8 @@ export default {
path: "/discussupload",
query: {
discussId: props.discussId,
type: props.type,
id: props.id,
},
});
};

View File

@@ -4,6 +4,8 @@
text="讨论详情"
:ispublish="true"
:discussId="discussId"
:id="id"
:type="type"
></ReturnHead>
<div class="head clearfix">
<div class="title">
@@ -398,10 +400,16 @@ function handleCurrentChange(e, k) {
}
.inn {
margin-bottom: 20px;
margin-top: 11px;
color: #6e7b84;
font-size: 13px;
line-height: 24px;
max-height: 103px;
overflow: hidden;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
}
}
}

View File

@@ -80,7 +80,7 @@ import store from "@/store";
import { ElMessage } from "element-plus";
const router = useRouter();
const {
query: { discussId },
query: { discussId, id, type },
} = useRoute();
const state = reactive({
text: "",
@@ -171,6 +171,8 @@ const postAdd = () => {
ctime: "",
discussId: discussId,
id: 0,
type: type,
taskId: id,
mtime: "",
praiseNum: 0,
status: 0,

View File

@@ -1,9 +1,17 @@
<template>
<div class="faceteachnocommon">
<ReturnHead text="课程详情"></ReturnHead>
<TitleHead :text="'【面授课】' + data.planDto?.name"></TitleHead>
<div class="main">
<div class="title">
<div class="faceteachimgname">
<img
style="width: 129.5px; height: 73px"
:src="data.offcourseDto?.picUrl"
alt=""
/>
<div class="faceteachname">{{ data.planDto?.name }}</div>
</div>
<div class="titlemain">
<div class="timeposition">
<div class="time">
@@ -29,104 +37,6 @@
</div>
</div>
</div>
<!-- <div class="titlebtn">评估</div> -->
<div v-if="projectStatus && projectEndTime">
<div
v-if="
projectStatus !== '3' &&
new Date(projectEndTime).getTime() > new Date().getTime()
"
style="display: flex"
>
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<div v-else>
<div style="display: flex">
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<!-- <button
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>
{{ data.isSurvery ? "已评估" : "评估" }}
</button> -->
</div>
</div>
<div class="teacher">
@@ -147,229 +57,73 @@
{{ data.planDto?.bandDesc }}
</div>
</div>
<!-- <div class="teacherFollow">+ 关注</div> -->
</div>
</div>
</div>
<div class="detail">
<div style="width: 90%">
<div class="teachertitle">
<img
style="width: 17px; height: 17px"
src="../../assets/image/faceteach/livelecturer.png"
/>
<div class="talk">课程详情</div>
<div class="box"></div>
</div>
<div class="detailMain">
{{ data.planDto?.description }}
</div>
</div>
</div>
<div class="course">
<div style="width: 100%">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程附件" name="first">
<el-tabs v-model:activeName="activeName" @tab-click="handleClick">
<el-tab-pane label="课程简介" name="first">
<div class="notice" style="padding: 10px; font-size: 14px">
{{ data.offcourseDto?.intro || "暂无课程介绍" }}
</div>
</el-tab-pane>
<el-tab-pane label="课程大纲" name="second">
<div class="work">
<div style="display: flex; align-items: center">
<div
style="padding: 5px"
class="content"
v-html="data.offcourseDto?.outline"
></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程评论" name="fourth"> </el-tab-pane>
<el-tab-pane label="材料下载" name="third">
<div
v-if="data.planDto?.attach === ''"
v-if="!data.offcourseDto?.attach"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-top: 10px;
"
>
此课程无附件
</div>
<div v-else>
<div
v-for="(el, index) in formateArr(data.planDto?.attach)"
v-for="(el, index) in formateArr(data.offcourseDto.attach)"
:key="index"
class="enclosure"
:style="{
borderBottom: '1px solid rgba(56, 125, 247, 0.2)',
}"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"
>
<div class="enclosureL">
<FileTypeImg
:v-model="
el.name
? el.name
: el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
"
:style="{
width: '19.5px',
width: '19px',
height: '22px',
marginLeft: '10px',
}"
></FileTypeImg>
<div style="margin-left: 15px">
<div style="margin-left: 10px">
{{
el.name
? el.name
: el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
}}
</div>
<!-- <img style="width: 19.5px; height: 22px" :src="el.img" />
<div style="margin-left: 15px">{{ el.name }}</div> -->
</div>
<div>
<div
v-if="
new Date(data.planDto.beginTime).getTime() >
new Date().getTime()
"
class="download"
>
<img
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px; color: #999"
@click="downloads(el)"
>
下载
</div>
</div>
<div v-else class="download">
<img
style="width: 16px; height: 15px; color: #2478ff"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px"
@click="download(el.name ? el.response.data : el)"
>
下载
</div>
</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程作业" name="second">
<div class="work">
<div v-if="data.workDto">
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="display: flex; justify-content: space-between">
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
v-if="data.workDto?.workFlag"
style="margin: 0px 10px 10px 0px"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
作业
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toWork"
>
交作业
</div>
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无作业
</div>
</div>
</el-tab-pane>
<el-tab-pane
label="课程考试"
name="third"
:disabed="dayjs().isBefore(dayjs(data.planDto?.beginTime))"
>
<div class="work" v-if="data.examinationDto?.examinationTestName">
<div class="question">
{{ data.examinationDto?.examinationName }}
</div>
<div style="display: flex; justify-content: space-between">
<div>
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
style="margin: 0px 10px 10px 0px"
v-if="data.examinationDto?.examinationFlag"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
考试
</div>
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toExamItem(data.examinationDto)"
>
去考试
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
"
>
此课程无考试
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -378,17 +132,11 @@
</template>
<script setup>
import TitleHead from "@/components/TitleHead.vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import {
STU_OFFCOURSE_DETAIL,
TASK_OFFCOURSE_NOTASK_SIGN,
TASK_OFFCOURSE_SIGN,
TASK_BROADCAST_SIGN,
} from "@/api/api";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig } from "element-plus";
@@ -398,12 +146,11 @@ const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId, projectStatus, projectEndTime },
query: { courseId, type, id: taskId },
} = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
// console.log("项目状态字段传递", projectStatus, projectEndTime);
console.log("获取信息", data);
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
@@ -413,7 +160,6 @@ const state = reactive({
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
@@ -421,180 +167,25 @@ const download = (url) => {
window.open(url);
};
const downloads = (url) => {
ElMessage.warning("未到开始时间,请耐心等待!");
ElMessage.warning("未在有效时间范围内,请耐心等待!");
};
let timer = null;
// 报名
function onLineSignUp() {
if (data.value.isSignUp) {
return;
}
request(FACETEACH_SIGNUP, { courseId });
data.value.isSignUp = true;
ElMessage.success("报名成功");
}
function formateArr(strs) {
console.log("strs", strs);
let newArr = [];
try {
newArr = JSON.parse(strs);
} catch {
newArr = strs ? strs.split(",") : [];
}
console.log("112233", newArr);
return newArr;
let arrs = strs.split(",");
console.log("112233", arrs);
return arrs;
}
let timer = null;
//判断能否签到
function isSignClick() {
timer = setInterval(() => {
let beginTime = new Date(data.value.planDto?.beginTime).getTime();
let endTime = !data.value.planDto?.afterStart
? new Date(data.value.planDto?.endTime).getTime()
: new Date(data.value.planDto?.beginTime).getTime();
let nowTime = new Date().getTime();
if (data.value.planDto?.beforeStart && data.value.planDto?.afterStart) {
//有开始前有开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111");
} else if (
data.value.planDto?.beforeStart &&
!data.value.planDto?.afterStart
) {
//只有开始前无开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
console.log("11112222");
} else if (
!data.value.planDto?.beforeStart &&
data.value.planDto?.afterStart
) {
//无开始前有开始后
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111333");
}
if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
// console.log(
// "isAllowSign",
// state.isAllowSign,
// nowTime,
// endTime,
// beginTime,
// nowTime < endTime,
// nowTime > beginTime
// );
}, 1000);
}
isSignClick();
//签到
const signClick = () => {
if (data.value.signFlag) {
return;
}
// console.log(
// "data.signFlag",
// data.value.signFlag,
// state.isAllowSign,
// !state.isAllowSign
// );
//if (data.value.planDto.beginTime) {
// let date1 = new Date(data.value.planDto.beginTime).getTime()
// let date2 = new Date().getTime()
// if (date1 > date2) {
// ElMessage.info("未到开始时间,请耐心等待!");
// return;
// }
//}
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
ElMessage.warning("未在允许签到时间范围内");
return;
}
data.value.signFlag = 1;
ElMessage.warning("签到成功");
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
};
function toSurvery() {
if (data.value.isSurvery) {
// return;
}
if (
data.value.planDto.beginTime &&
dayjs().isBefore(data.value.planDto.beginTime)
) {
ElMessage.warning("课程未开始,请耐心等待!");
return;
}
if (data.value.planDto.evalFlag == 0) {
ElMessage.warning("此课程无评估");
return;
}
router.push({
path: "/investigatpage",
query: {
id: taskId,
courseId: data.value.planDto.evaluateId,
pName: "面授课",
infoId: data.value.planDto.offcoursePlanId,
chapterOrStageId: 0,
sName: data.value.planDto.name,
type,
},
});
}
function toWork() {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
router.push({
path: "/homeworkpage",
query: {
courseId: data.value.workDto.workId,
id: taskId,
infoId: data.value.offcourseDto.offcourseId,
chapterOrStageId: 0,
type,
pName: "面授课",
sName: data.value.planDto.name,
},
});
}
function toExamItem(obj) {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
console.log("obj", obj.examinationTestId);
window.open(
window.location.protocol +
import.meta.env.VITE_BOE_EXAM_DETAIL_URL +
"/mobile/pages/exam/exam?id=" +
obj.examinationTestId,
"_top"
); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
onUnmounted(() => {
if (timer) {
clearInterval(timer);
}
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -607,14 +198,29 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
margin-top: -14.5px;
margin-top: 10px;
.title {
width: 90%;
height: 74px;
min-height: 167px;
border-radius: 4px;
background-color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.faceteachimgname {
display: flex;
align-items: center;
width: 90%;
margin-top: 17px;
margin-bottom: 20px;
}
.faceteachname {
margin-left: 15px;
font-size: 14px;
font-weight: normal;
color: #394145;
}
.titlemain {
width: 90%;
display: flex;

View File

@@ -1,9 +1,17 @@
<template>
<div class="faceteachnocourse">
<ReturnHead text="课程详情"></ReturnHead>
<TitleHead :text="'【面授课】' + data.planDto?.name"></TitleHead>
<div class="main">
<div class="title">
<div class="faceteachimgname">
<img
style="width: 129.5px; height: 73px"
:src="data.offcourseDto?.picUrl"
alt=""
/>
<div class="faceteachname">{{ data.planDto?.name }}</div>
</div>
<div class="titlemain">
<div class="timeposition">
<div class="time">
@@ -28,105 +36,12 @@
{{ data.planDto?.address }}
</div>
</div>
</div>
<!-- <div class="titlebtn">评估</div> -->
<div v-if="projectStatus && projectEndTime">
<div
v-if="
projectStatus !== '3' &&
new Date(projectEndTime).getTime() > new Date().getTime()
"
style="display: flex"
>
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
<div class="time" style="margin-top: 16px">
<botton class="btn" :style="{ background: '#999' }"
>当前任务暂未开放请联系管理员</botton
>
</div>
</div>
<div v-else>
<div style="display: flex">
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<!-- <button
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>
{{ data.isSurvery ? "已评估" : "评估" }}
</button> -->
</div>
</div>
<div class="teacher">
@@ -147,229 +62,73 @@
{{ data.planDto?.bandDesc }}
</div>
</div>
<!-- <div class="teacherFollow">+ 关注</div> -->
</div>
</div>
</div>
<div class="detail">
<div style="width: 90%">
<div class="teachertitle">
<img
style="width: 17px; height: 17px"
src="../../assets/image/faceteach/livelecturer.png"
/>
<div class="talk">课程详情</div>
<div class="box"></div>
</div>
<div class="detailMain">
{{ data.planDto?.description }}
</div>
</div>
</div>
<div class="course">
<div style="width: 100%">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程附件" name="first">
<el-tabs v-model:activeName="activeName" @tab-click="handleClick">
<el-tab-pane label="课程简介" name="first">
<div class="notice" style="padding: 10px; font-size: 14px">
{{ data.offcourseDto?.intro || "暂无课程介绍" }}
</div>
</el-tab-pane>
<el-tab-pane label="课程大纲" name="second">
<div class="work">
<div style="display: flex; align-items: center">
<div
style="padding: 5px"
class="content"
v-html="data.offcourseDto?.outline"
></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程评论" name="fourth"> </el-tab-pane>
<el-tab-pane label="材料下载" name="third">
<div
v-if="data.planDto?.attach === ''"
v-if="!data.offcourseDto?.attach"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-top: 10px;
"
>
此课程无附件
</div>
<div v-else>
<div
v-for="(el, index) in formateArr(data.planDto?.attach)"
v-for="(el, index) in formateArr(data.offcourseDto.attach)"
:key="index"
class="enclosure"
:style="{
borderBottom: '1px solid rgba(56, 125, 247, 0.2)',
}"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"
>
<div class="enclosureL">
<FileTypeImg
:v-model="
el.name
? el.name
: el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
"
:style="{
width: '19.5px',
height: '22px',
width: '22px',
height: '26px',
marginLeft: '10px',
}"
></FileTypeImg>
<div style="margin-left: 15px">
<div style="margin-left: 10px">
{{
el.name
? el.name
: el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
}}
</div>
<!-- <img style="width: 19.5px; height: 22px" :src="el.img" />
<div style="margin-left: 15px">{{ el.name }}</div> -->
</div>
<div>
<div
v-if="
new Date(data.planDto.beginTime).getTime() >
new Date().getTime()
"
class="download"
>
<img
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px; color: #999"
@click="downloads(el)"
>
下载
</div>
</div>
<div v-else class="download">
<img
style="width: 16px; height: 15px; color: #2478ff"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px"
@click="download(el.name ? el.response.data : el)"
>
下载
</div>
</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程作业" name="second">
<div class="work">
<div v-if="data.workDto">
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="display: flex; justify-content: space-between">
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
v-if="data.workDto?.workFlag"
style="margin: 0px 10px 10px 0px"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
作业
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toWork"
>
交作业
</div>
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无作业
</div>
</div>
</el-tab-pane>
<el-tab-pane
label="课程考试"
name="third"
:disabed="dayjs().isBefore(dayjs(data.planDto?.beginTime))"
>
<div class="work" v-if="data.examinationDto?.examinationTestName">
<div class="question">
{{ data.examinationDto?.examinationName }}
</div>
<div style="display: flex; justify-content: space-between">
<div>
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
style="margin: 0px 10px 10px 0px"
v-if="data.examinationDto?.examinationFlag"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
考试
</div>
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toExamItem(data.examinationDto)"
>
去考试
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
"
>
此课程无考试
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -378,17 +137,11 @@
</template>
<script setup>
import TitleHead from "@/components/TitleHead.vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import {
STU_OFFCOURSE_DETAIL,
TASK_OFFCOURSE_NOTASK_SIGN,
TASK_OFFCOURSE_SIGN,
TASK_BROADCAST_SIGN,
} from "@/api/api";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig } from "element-plus";
@@ -398,12 +151,11 @@ const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId, projectStatus, projectEndTime },
query: { courseId, type, id: taskId },
} = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
// console.log("项目状态字段传递", projectStatus, projectEndTime);
console.log("获取信息", data);
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
@@ -413,7 +165,6 @@ const state = reactive({
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
@@ -421,180 +172,25 @@ const download = (url) => {
window.open(url);
};
const downloads = (url) => {
ElMessage.warning("未到开始时间,请耐心等待!");
ElMessage.warning("未在有效时间范围内,请耐心等待!");
};
let timer = null;
// 报名
function onLineSignUp() {
if (data.value.isSignUp) {
return;
}
request(FACETEACH_SIGNUP, { courseId });
data.value.isSignUp = true;
ElMessage.success("报名成功");
}
function formateArr(strs) {
console.log("strs", strs);
let newArr = [];
try {
newArr = JSON.parse(strs);
} catch {
newArr = strs ? strs.split(",") : [];
}
console.log("112233", newArr);
return newArr;
let arrs = strs.split(",");
console.log("112233", arrs);
return arrs;
}
let timer = null;
//判断能否签到
function isSignClick() {
timer = setInterval(() => {
let beginTime = new Date(data.value.planDto?.beginTime).getTime();
let endTime = !data.value.planDto?.afterStart
? new Date(data.value.planDto?.endTime).getTime()
: new Date(data.value.planDto?.beginTime).getTime();
let nowTime = new Date().getTime();
if (data.value.planDto?.beforeStart && data.value.planDto?.afterStart) {
//有开始前有开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111");
} else if (
data.value.planDto?.beforeStart &&
!data.value.planDto?.afterStart
) {
//只有开始前无开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
console.log("11112222");
} else if (
!data.value.planDto?.beforeStart &&
data.value.planDto?.afterStart
) {
//无开始前有开始后
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111333");
}
if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
// console.log(
// "isAllowSign",
// state.isAllowSign,
// nowTime,
// endTime,
// beginTime,
// nowTime < endTime,
// nowTime > beginTime
// );
}, 1000);
}
isSignClick();
//签到
const signClick = () => {
if (data.value.signFlag) {
return;
}
// console.log(
// "data.signFlag",
// data.value.signFlag,
// state.isAllowSign,
// !state.isAllowSign
// );
//if (data.value.planDto.beginTime) {
// let date1 = new Date(data.value.planDto.beginTime).getTime()
// let date2 = new Date().getTime()
// if (date1 > date2) {
// ElMessage.info("未到开始时间,请耐心等待!");
// return;
// }
//}
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
ElMessage.warning("未在允许签到时间范围内");
return;
}
data.value.signFlag = 1;
ElMessage.warning("签到成功");
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
};
function toSurvery() {
if (data.value.isSurvery) {
// return;
}
if (
data.value.planDto.beginTime &&
dayjs().isBefore(data.value.planDto.beginTime)
) {
ElMessage.warning("课程未开始,请耐心等待!");
return;
}
if (data.value.planDto.evalFlag == 0) {
ElMessage.warning("此课程无评估");
return;
}
router.push({
path: "/investigatpage",
query: {
id: taskId,
courseId: data.value.planDto.evaluateId,
pName: "面授课",
infoId: data.value.planDto.offcoursePlanId,
chapterOrStageId: 0,
sName: data.value.planDto.name,
type,
},
});
}
function toWork() {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
router.push({
path: "/homeworkpage",
query: {
courseId: data.value.workDto.workId,
id: taskId,
infoId: data.value.offcourseDto.offcourseId,
chapterOrStageId: 0,
type,
pName: "面授课",
sName: data.value.planDto.name,
},
});
}
function toExamItem(obj) {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
console.log("obj", obj.examinationTestId);
window.open(
window.location.protocol +
import.meta.env.VITE_BOE_EXAM_DETAIL_URL +
"/mobile/pages/exam/exam?id=" +
obj.examinationTestId,
"_top"
); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
onUnmounted(() => {
if (timer) {
clearInterval(timer);
}
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -607,14 +203,29 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
margin-top: -14.5px;
margin-top: 10px;
.title {
width: 90%;
height: 74px;
min-height: 167px;
border-radius: 4px;
background-color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.faceteachimgname {
display: flex;
align-items: center;
width: 90%;
margin-top: 17px;
margin-bottom: 20px;
}
.faceteachname {
margin-left: 15px;
font-size: 14px;
font-weight: normal;
color: #394145;
}
.titlemain {
width: 90%;
display: flex;
@@ -625,6 +236,24 @@ onUnmounted(() => {
display: flex;
align-items: center;
}
.btn {
margin-right: 20px;
width: 260px;
height: 46px;
background: #2478ff;
border-radius: 4px;
box-shadow: 0px 1px 8px 0px rgba(56, 125, 247, 0.7);
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
font-weight: 800;
line-height: 24px;
cursor: pointer;
margin-right: 96px;
margin-bottom: 20px;
}
}
.titlebtn {
width: 83px;

View File

@@ -1,9 +1,17 @@
<template>
<div class="faceteachsignup">
<ReturnHead text="课程详情"></ReturnHead>
<TitleHead :text="'【面授课】' + data.planDto?.name"></TitleHead>
<div class="main">
<div class="title">
<div class="faceteachimgname">
<img
style="width: 129.5px; height: 73px"
:src="data.offcourseDto?.picUrl"
alt=""
/>
<div class="faceteachname">{{ data.planDto?.name }}</div>
</div>
<div class="titlemain">
<div class="timeposition">
<div class="time">
@@ -31,102 +39,19 @@
</div>
<!-- <div class="titlebtn">评估</div> -->
<div v-if="projectStatus && projectEndTime">
<div
v-if="
projectStatus !== '3' &&
new Date(projectEndTime).getTime() > new Date().getTime()
"
style="display: flex"
>
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
<div v-else>
<div>
<div style="display: flex">
<botton
class="titlebtn"
style="margin-right: 20px"
v-if="data?.hasTask || data.planDto?.applyFlag"
@click="onLineSignUp"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
background: data.isSignUp ? '#999' : 'rgb(57, 146, 249)',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
</botton>
<!-- <botton style="background: #999" class="btn" @click="toSurvery" v-if="data.planDto?.evalFlag == 0">
评估
</botton> -->
<botton
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
>{{ data.isSignUp ? "已报名" : "立即报名" }}
</botton>
</div>
</div>
<!-- <button
v-if="data.planDto?.evalFlag !== 0"
:style="{
background: `${
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: data.isSurvery
? '#999'
: 'rgb(57, 146, 249)'
}`,
}"
class="titlebtn"
@click="toSurvery"
>
{{ data.isSurvery ? "已评估" : "评估" }}
</button> -->
</div>
</div>
<div class="teacher">
@@ -147,229 +72,85 @@
{{ data.planDto?.bandDesc }}
</div>
</div>
<!-- <div class="teacherFollow">+ 关注</div> -->
</div>
</div>
</div>
<div class="detail">
<div style="width: 90%">
<div class="teachertitle">
<img
style="width: 17px; height: 17px"
src="../../assets/image/faceteach/livelecturer.png"
/>
<div class="talk">课程详情</div>
<div class="box"></div>
</div>
<div class="detailMain">
{{ data.planDto?.description }}
</div>
</div>
</div>
<div class="course">
<div style="width: 100%">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="课程附件" name="first">
<el-tabs v-model:activeName="activeName" @tab-click="handleClick">
<el-tab-pane label="课程简介" name="first">
<div class="notice" style="padding: 10px; font-size: 14px">
{{ data.offcourseDto?.intro || "暂无课程介绍" }}
</div>
</el-tab-pane>
<el-tab-pane label="课程大纲" name="second">
<div class="work">
<div style="display: flex; align-items: center">
<div
style="padding: 10px"
class="content"
v-html="data.offcourseDto?.outline"
></div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程评论" name="fourth"> </el-tab-pane>
<el-tab-pane label="材料下载" name="third">
<div
v-if="data.planDto?.attach === ''"
v-if="!data.offcourseDto?.attach"
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-top: 10px;
"
>
此课程无附件
</div>
<div v-else>
<div
v-for="(el, index) in formateArr(data.planDto?.attach)"
v-for="(el, index) in formateArr(data.offcourseDto.attach)"
:key="index"
class="enclosure"
:style="{
borderBottom: '1px solid rgba(56, 125, 247, 0.2)',
}"
:style="{ borderBottom: '1px solid rgba(56, 125, 247, 0.2)' }"
>
<div class="enclosureL">
<FileTypeImg
:v-model="
el.name
? el.name
: el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
el.slice(el.lastIndexOf('/') + 1, el.indexOf('-')) +
el.slice(el.lastIndexOf('.'))
"
:style="{
width: '19.5px',
height: '22px',
width: '22px',
height: '26px',
marginLeft: '10px',
}"
></FileTypeImg>
<div style="margin-left: 15px">
<div style="margin-left: 10px">
{{
el.name
? el.name
: el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
}}
</div>
<!-- <img style="width: 19.5px; height: 22px" :src="el.img" />
<div style="margin-left: 15px">{{ el.name }}</div> -->
</div>
<div>
<div
v-if="
new Date(data.planDto.beginTime).getTime() >
new Date().getTime()
"
class="download"
>
<img
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px; color: #999"
@click="downloads(el)"
>
下载
</div>
</div>
<div v-else class="download">
<img
style="width: 16px; height: 15px; color: #2478ff"
src="../../assets/image/download.png"
/>
<div
style="margin-left: 5px"
@click="download(el.name ? el.response.data : el)"
>
下载
</div>
<div class="download">
<img
style="width: 16px; height: 15px"
src="../../assets/image/download.png"
/>
<div style="margin-left: 5px; color: rgba(36, 120, 255, 1)">
下载
</div>
<!-- <div style="margin-left: 5px;color:#999;" @click="download(el)">
下载
</div> -->
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程作业" name="second">
<div class="work">
<div v-if="data.workDto">
<div>
<div class="question">{{ data.workDto?.workName }}</div>
<div style="display: flex; justify-content: space-between">
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
v-if="data.workDto?.workFlag"
style="margin: 0px 10px 10px 0px"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
作业
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toWork"
>
交作业
</div>
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
"
>
此课程无作业
</div>
</div>
</el-tab-pane>
<el-tab-pane
label="课程考试"
name="third"
:disabed="dayjs().isBefore(dayjs(data.planDto?.beginTime))"
>
<div class="work" v-if="data.examinationDto?.examinationTestName">
<div class="question">
{{ data.examinationDto?.examinationName }}
</div>
<div style="display: flex; justify-content: space-between">
<div>
<div
style="
margin-top: 16px;
flex: 1;
display: flex;
flex-wrap: wrap;
"
>
<div
class="tag1"
style="margin: 0px 10px 10px 0px"
v-if="data.examinationDto?.examinationFlag"
>
必修
</div>
<div class="tag3" style="margin: 0px 10px 10px 0px">
考试
</div>
</div>
</div>
<div
:style="{
background:
new Date(data.planDto?.beginTime).getTime() >
new Date().getTime()
? '#999'
: '',
}"
class="submit"
@click="toExamItem(data.examinationDto)"
>
去考试
</div>
</div>
</div>
<div
v-else
style="
font-size: 14px;
font-weight: 400;
line-height: 24px;
cursor: pointer;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
"
>
此课程无考试
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -378,17 +159,11 @@
</template>
<script setup>
import TitleHead from "@/components/TitleHead.vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import {
STU_OFFCOURSE_DETAIL,
TASK_OFFCOURSE_NOTASK_SIGN,
TASK_OFFCOURSE_SIGN,
TASK_BROADCAST_SIGN,
} from "@/api/api";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig } from "element-plus";
@@ -398,12 +173,10 @@ const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId, projectStatus, projectEndTime },
query: { courseId, type, id: taskId },
} = useRoute();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
// console.log("项目状态字段传递", projectStatus, projectEndTime);
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
@@ -413,7 +186,6 @@ const state = reactive({
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
@@ -421,180 +193,25 @@ const download = (url) => {
window.open(url);
};
const downloads = (url) => {
ElMessage.warning("未到开始时间,请耐心等待!");
ElMessage.warning("未在有效时间范围内,请耐心等待!");
};
let timer = null;
// 报名
function onLineSignUp() {
if (data.value.isSignUp) {
return;
}
request(FACETEACH_SIGNUP, { courseId });
data.value.isSignUp = true;
ElMessage.success("报名成功");
}
function formateArr(strs) {
console.log("strs", strs);
let newArr = [];
try {
newArr = JSON.parse(strs);
} catch {
newArr = strs ? strs.split(",") : [];
}
console.log("112233", newArr);
return newArr;
let arrs = strs.split(",");
console.log("112233", arrs);
return arrs;
}
let timer = null;
//判断能否签到
function isSignClick() {
timer = setInterval(() => {
let beginTime = new Date(data.value.planDto?.beginTime).getTime();
let endTime = !data.value.planDto?.afterStart
? new Date(data.value.planDto?.endTime).getTime()
: new Date(data.value.planDto?.beginTime).getTime();
let nowTime = new Date().getTime();
if (data.value.planDto?.beforeStart && data.value.planDto?.afterStart) {
//有开始前有开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111");
} else if (
data.value.planDto?.beforeStart &&
!data.value.planDto?.afterStart
) {
//只有开始前无开始后
beginTime = beginTime - data.value.planDto?.beforeStart * 60 * 1000;
console.log("11112222");
} else if (
!data.value.planDto?.beforeStart &&
data.value.planDto?.afterStart
) {
//无开始前有开始后
endTime = endTime + data.value.planDto?.afterStart * 60 * 1000;
console.log("1111333");
}
if (nowTime < endTime && nowTime > beginTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
// console.log(
// "isAllowSign",
// state.isAllowSign,
// nowTime,
// endTime,
// beginTime,
// nowTime < endTime,
// nowTime > beginTime
// );
}, 1000);
}
isSignClick();
//签到
const signClick = () => {
if (data.value.signFlag) {
return;
}
// console.log(
// "data.signFlag",
// data.value.signFlag,
// state.isAllowSign,
// !state.isAllowSign
// );
//if (data.value.planDto.beginTime) {
// let date1 = new Date(data.value.planDto.beginTime).getTime()
// let date2 = new Date().getTime()
// if (date1 > date2) {
// ElMessage.info("未到开始时间,请耐心等待!");
// return;
// }
//}
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
ElMessage.warning("未在允许签到时间范围内");
return;
}
data.value.signFlag = 1;
ElMessage.warning("签到成功");
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
};
function toSurvery() {
if (data.value.isSurvery) {
// return;
}
if (
data.value.planDto.beginTime &&
dayjs().isBefore(data.value.planDto.beginTime)
) {
ElMessage.warning("课程未开始,请耐心等待!");
return;
}
if (data.value.planDto.evalFlag == 0) {
ElMessage.warning("此课程无评估");
return;
}
router.push({
path: "/investigatpage",
query: {
id: taskId,
courseId: data.value.planDto.evaluateId,
pName: "面授课",
infoId: data.value.planDto.offcoursePlanId,
chapterOrStageId: 0,
sName: data.value.planDto.name,
type,
},
});
}
function toWork() {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
router.push({
path: "/homeworkpage",
query: {
courseId: data.value.workDto.workId,
id: taskId,
infoId: data.value.offcourseDto.offcourseId,
chapterOrStageId: 0,
type,
pName: "面授课",
sName: data.value.planDto.name,
},
});
}
function toExamItem(obj) {
if (data.value.planDto.beginTime) {
let date1 = new Date(data.value.planDto.beginTime).getTime();
let date2 = new Date().getTime();
if (date1 > date2) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
}
console.log("obj", obj.examinationTestId);
window.open(
window.location.protocol +
import.meta.env.VITE_BOE_EXAM_DETAIL_URL +
"/mobile/pages/exam/exam?id=" +
obj.examinationTestId,
"_top"
); //测评
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
onUnmounted(() => {
if (timer) {
clearInterval(timer);
}
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -607,14 +224,29 @@ onUnmounted(() => {
display: flex;
flex-direction: column;
align-items: center;
margin-top: -14.5px;
margin-top: 10px;
.title {
width: 90%;
height: 74px;
min-height: 167px;
border-radius: 4px;
background-color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.faceteachimgname {
display: flex;
align-items: center;
width: 90%;
margin-top: 17px;
margin-bottom: 20px;
}
.faceteachname {
margin-left: 15px;
font-size: 14px;
font-weight: normal;
color: #394145;
}
.titlemain {
width: 90%;
display: flex;