--demand 面授课

This commit is contained in:
yuping
2023-03-17 03:01:22 +08:00
parent c43b4fd723
commit 95200739de
4 changed files with 103 additions and 396 deletions

View File

@@ -33,8 +33,7 @@
<div v-if="projectStatus && projectEndTime">
<div
v-if="
projectStatus !== '3' &&
v-if=" projectStatus !== '3' &&
new Date(projectEndTime).getTime() > new Date().getTime()
"
style="display: flex"
@@ -42,19 +41,10 @@
<botton
class="titlebtn"
style="margin-right: 20px"
:style="{
background: isAllowSign
? data.signFlag
? '#999'
: 'rgb(57, 146, 249)'
: '#999',
}"
:style="{ background: isAllowSign && !data.signFlag ?'rgb(57, 146, 249)' : '#999' }"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
>{{ 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="{
@@ -69,7 +59,7 @@
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
>{{ data.isSurvery ? "已评估" : "评估" }}
</botton>
</div>
</div>
@@ -86,11 +76,8 @@
: '#999',
}"
@click="signClick"
>{{ data.signFlag ? "已签到" : "签到" }}
>{{ 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="{
@@ -105,28 +92,10 @@
}"
class="titlebtn"
@click="toSurvery"
>{{ data.isSurvery ? "已评估" : "评估" }}
>{{ 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">
@@ -140,14 +109,13 @@
<div class="box" style="width: 80px; right: 0px"></div>
</div>
<div class="teachermain">
<img class="teacherAvatar" :src="teacherInfo.avatar" />
<img class="teacherAvatar" :src="teacherInfo.avatar"/>
<div style="flex: 1; margin-left: 11px; margin-right: 13px">
<div class="teacherName">{{ data.planDto?.teacher }}</div>
<div class="teacherIntro">
{{ data.planDto?.bandDesc }}
</div>
</div>
<!-- <div class="teacherFollow">+ 关注</div> -->
</div>
</div>
</div>
@@ -212,11 +180,9 @@
el.name
? el.name
: el.slice(el.lastIndexOf("/") + 1, el.indexOf("-")) +
el.slice(el.lastIndexOf("."))
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
@@ -380,169 +346,71 @@
<script setup>
import TitleHead from "@/components/TitleHead.vue";
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, watch, onUnmounted } from "vue";
import {computed, onBeforeMount} 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 { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig } from "element-plus";
import {request, useRequest} from "@/api/request";
import {STU_OFFCOURSE_DETAIL, TASK_OFFCOURSE_NOTASK_SIGN,} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
import {ElMessage} from "element-plus";
import dayjs from "dayjs";
import isBetween from "dayjs/plugin/isBetween";
const router = useRouter();
onBeforeMount(() => dayjs.extend(isBetween));
const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId, projectStatus, projectEndTime },
} = useRoute();
onUnmounted(() => {
if (timer) {
clearInterval(timer);
}
});
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
console.log("datadatadatadatadatadatadata", data);
// console.log("项目状态字段传递", projectStatus, projectEndTime);
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
const isAllowSign = computed(() => dayjs().isBetween(dayjs(data.value.planDto?.beginTime).subtract(data.value.beforeStart || 0, "minute"), dayjs(data.value.afterStart ? data.value.planDto?.beginTime : data.value.planDto?.endTime).add(data.value.afterStart || 0, "minute")));
const state = reactive({
activeName: "first",
enclosure: "",
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const activeName = ref("first");
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
console.log(
"url2",
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url
);
window.open(
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
"_top"
);
};
const download = (url) => window.open(import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url, "_top");
const downloads = (url) => {
ElMessage.warning("未到开始时间,请耐心等待!");
};
function formateArr(strs) {
console.log("strs", strs);
let newArr = [];
let newArr;
try {
newArr = JSON.parse(strs);
} catch {
newArr = strs ? strs.split(",") : [];
}
console.log("112233", newArr);
return newArr;
}
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);
}
watch(data, () => {
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;
if (!isAllowSign.value) {
return ElMessage.warning("未在允许签到时间范围内");
}
data.value.signFlag = 1;
ElMessage.warning("签到成功");
if (taskId) {
request(TASK_OFFCOURSE_SIGN, { courseId: courseId, taskId, type });
} else {
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId });
}
request(TASK_OFFCOURSE_NOTASK_SIGN, { courseId: courseId,taskId:courseId,type:3 });
};
function toSurvery() {
if (data.value.isSurvery) {
// return;
}
if (
data.value.planDto.beginTime &&
dayjs().isBefore(data.value.planDto.beginTime)
) {
if (dayjs().isBefore(data.value.planDto.beginTime)) {
ElMessage.warning("课程未开始,请耐心等待!");
return;
}
if (data.value.planDto.evalFlag == 0) {
if (!data.value.planDto.evalFlag) {
ElMessage.warning("此课程无评估");
return;
}
@@ -561,13 +429,9 @@ function toSurvery() {
}
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;
}
if (dayjs().isBefore(data.value.planDto.beginTime)) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
router.push({
path: "/homeworkpage",
@@ -584,15 +448,10 @@ function toWork() {
}
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;
}
if (dayjs().isBefore(data.value.planDto.beginTime)) {
ElMessage.warning("未到开始时间,请耐心等待!");
return;
}
console.log("obj", obj);
if (obj.examType === 2) {
router.push({
path: "/externalexam",
@@ -601,30 +460,23 @@ function toExamItem(obj) {
type: 3,
},
});
} else {
window.open(
window.location.protocol +
import.meta.env.VITE_BOE_EXAM_DETAIL_URL +
obj.id,
"_top"
);
}
} else window.open(window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL + obj.id, "_top");
// router.push({ path: import.meta.env.VITE_BOE_EXAM_DETAIL_URL+ obj.examinationTestId });
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
.faceteach {
width: 100%;
padding-bottom: 20px;
.main {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
margin-top: -14.5px;
.title {
width: 90%;
height: 74px;
@@ -632,17 +484,20 @@ function toExamItem(obj) {
background-color: rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
.titlemain {
width: 90%;
display: flex;
justify-content: space-between;
align-items: center;
.timeposition {
.time {
display: flex;
align-items: center;
}
}
.titlebtn {
width: 83px;
height: 33px;
@@ -660,12 +515,14 @@ function toExamItem(obj) {
}
}
}
.teachertitle {
width: 90px;
position: relative;
display: flex;
align-items: center;
margin-top: 21px;
.talk {
font-size: 14px;
font-weight: bold;
@@ -673,6 +530,7 @@ function toExamItem(obj) {
line-height: 12px;
margin-left: 7.5px;
}
.box {
position: absolute;
width: 62.5px;
@@ -682,6 +540,7 @@ function toExamItem(obj) {
background: rgba(36, 120, 255, 0.15);
}
}
.teacher {
width: 90%;
padding-bottom: 15px;
@@ -696,18 +555,21 @@ function toExamItem(obj) {
margin-top: 24px;
display: flex;
justify-content: space-between;
.teacherAvatar {
width: 50px;
height: 50px;
border-radius: 25px;
margin-left: 4px;
}
.teacherName {
font-size: 14px;
font-weight: 600;
color: #394145;
line-height: 21px;
}
.teacherIntro {
font-size: 13px;
font-weight: 400;
@@ -715,6 +577,7 @@ function toExamItem(obj) {
line-height: 21px;
margin-top: 12px;
}
.teacherFollow {
width: 73px;
height: 28px;
@@ -732,6 +595,7 @@ function toExamItem(obj) {
}
}
}
.detail {
width: 90%;
padding-bottom: 25px;
@@ -741,6 +605,7 @@ function toExamItem(obj) {
display: flex;
flex-direction: column;
align-items: center;
.detailMain {
margin-top: 22px;
font-size: 13px;
@@ -749,6 +614,7 @@ function toExamItem(obj) {
line-height: 24px;
}
}
.course {
width: 90%;
// padding-bottom: 15px;
@@ -758,12 +624,14 @@ function toExamItem(obj) {
display: flex;
flex-direction: column;
align-items: center;
.el-tabs__nav {
width: 90%;
margin-left: 5%;
display: flex;
justify-content: space-between;
}
.el-tabs__item {
height: 50px;
padding: 0px;
@@ -772,12 +640,15 @@ function toExamItem(obj) {
line-height: 21px;
padding-top: 15px;
}
.el-tabs__nav-wrap::after {
background-color: rgba(56, 125, 247, 0.2);
}
.el-tabs__header {
margin: 0;
}
.enclosure {
width: 90%;
margin-left: 5%;
@@ -785,6 +656,7 @@ function toExamItem(obj) {
display: flex;
justify-content: space-between;
align-items: center;
.enclosureL {
display: flex;
align-items: center;
@@ -793,6 +665,7 @@ function toExamItem(obj) {
color: #677d86;
line-height: 19px;
}
.download {
display: flex;
align-items: center;
@@ -802,6 +675,7 @@ function toExamItem(obj) {
line-height: 19px;
}
}
.work {
// margin-left: 51px;
// margin-right: 40px;
@@ -813,6 +687,7 @@ function toExamItem(obj) {
justify-content: space-between;
margin-top: 17.5px;
}
.work .question {
font-size: 13px;
font-weight: 500;

View File

@@ -147,24 +147,15 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import {
computed,
reactive,
toRefs,
watch,
onUnmounted,
onMounted,
ref,
} from "vue";
import {computed, ref,} from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig, ElLoading } from "element-plus";
import {request, useRequest} from "@/api/request";
import {FACETEACH_SIGNUP, STU_OFFCOURSE_DETAIL} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
import {ElLoading, ElMessage} from "element-plus";
import dayjs from "dayjs";
import UploadPostImg from "@/components/img/UploadPostImg.vue";
import CommentReply from "@/components/CommentReply.vue";
const router = useRouter();
const returnclick = () => {
router.back();
@@ -184,36 +175,15 @@ openLoading();
const closeLoading = () => {
loading.value.close();
};
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => {
closeLoading();
});
console.log("获取信息", data);
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => closeLoading());
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
const state = reactive({
activeName: "first",
enclosure: "",
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
console.log(
"url2",
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url
);
window.open(
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
"_top"
);
};
const activeName = ref("first");
const download = (url) => window.open(import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url, "_top");
const downloads = (url) => {
ElMessage.warning("未在有效时间范围内,请耐心等待!");
};
let timer = null;
// 报名
function onLineSignUp() {
@@ -231,21 +201,8 @@ function formateArr(strs) {
return arrs;
}
// watch(data, () => {
// console.log("data.offcourseDto", data.value.offcourseDto);
// if (data.value.offcourseDto && data.value.offcourseDto.outline) {
// let obj = data.value.offcourseDto.outline;
// let regex = new RegExp("<img", "gi");
// let deleteStyle = /(?<=\" )style=\".*?\"/gi;
// obj = obj.replace(deleteStyle, "");
// obj = obj.replace(regex, '<img style="max-width: 100%;height:auto"');
// data.value.offcourseDto.outline = obj;
// console.log("data.offcourseDto.outline", data.value.offcourseDto.outline);
// }
// });
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
.faceteachnocommon {
width: 100%;

View File

@@ -153,20 +153,21 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import { computed, reactive, toRefs, watch, onUnmounted, ref } from "vue";
import {computed, ref} from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig, ElLoading } from "element-plus";
import {request, useRequest} from "@/api/request";
import {FACETEACH_SIGNUP, STU_OFFCOURSE_DETAIL} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
import {ElLoading, ElMessage} from "element-plus";
import dayjs from "dayjs";
const router = useRouter();
const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId },
query: { courseId },
} = useRoute();
const loading = ref(false); // loading
const openLoading = () => {
@@ -177,40 +178,20 @@ const openLoading = () => {
});
};
openLoading();
const closeLoading = () => {
loading.value.close();
};
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => {
closeLoading();
});
console.log("获取信息", data);
const closeLoading = () => loading.value.close();
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => closeLoading());
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
const activeName = ref("first");
const state = reactive({
activeName: "first",
enclosure: "",
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
console.log(
"url2",
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url
);
window.open(
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
"_top"
);
};
const download = (url) => window.open(import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url, "_top");
const downloads = (url) => {
ElMessage.warning("未在有效时间范围内,请耐心等待!");
};
let timer = null;
// 报名
function onLineSignUp() {
if (data.value.isSignUp) {
@@ -222,25 +203,11 @@ function onLineSignUp() {
}
function formateArr(strs) {
let arrs = strs.split(",");
console.log("112233", arrs);
return arrs;
return strs?.split(",");
}
// watch(data, () => {
// console.log("data.offcourseDto", data.value.offcourseDto);
// if (data.value.offcourseDto && data.value.offcourseDto.outline) {
// let obj = data.value.offcourseDto.outline;
// let regex = new RegExp("<img", "gi");
// let deleteStyle = /(?<=\" )style=\".*?\"/gi;
// obj = obj.replace(deleteStyle, "");
// obj = obj.replace(regex, '<img style="max-width: 100%;height:auto"');
// data.value.offcourseDto.outline = obj;
// console.log("data.offcourseDto.outline", data.value.offcourseDto.outline);
// }
// });
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
.faceteachnocourse {
width: 100%;

View File

@@ -183,30 +183,25 @@
<script setup>
import ReturnHead from "@/components/ReturnHead.vue";
import {
computed,
reactive,
toRefs,
watch,
onUnmounted,
onMounted,
ref,
} from "vue";
import {computed, onBeforeMount, ref,} from "vue";
import FileTypeImg from "@/components/FileTypeImg.vue";
import { request, useRequest } from "@/api/request";
import { STU_OFFCOURSE_DETAIL, FACETEACH_SIGNUP } from "@/api/api";
import { useRoute, useRouter } from "vue-router";
import { useUserInfo } from "@/api/utils";
import { ElMessage, messageConfig, ElLoading } from "element-plus";
import {request, useRequest} from "@/api/request";
import {FACETEACH_SIGNUP, STU_OFFCOURSE_DETAIL} from "@/api/api";
import {useRoute, useRouter} from "vue-router";
import {useUserInfo} from "@/api/utils";
import {ElLoading, ElMessage} from "element-plus";
import CommentReply from "@/components/CommentReply.vue";
import dayjs from "dayjs";
import isBetween from "dayjs/plugin/isBetween";
const router = useRouter();
const returnclick = () => {
router.back();
};
const {
query: { courseId, type, id: taskId },
query: { courseId },
} = useRoute();
onBeforeMount(() => dayjs.extend(isBetween));
const loading = ref(false); // loading
const openLoading = () => {
loading.value = ElLoading.service({
@@ -219,50 +214,18 @@ openLoading();
const closeLoading = () => {
loading.value.close();
};
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => {
closeLoading();
});
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => closeLoading());
const isAllowSign = computed(() => dayjs().isBetween(dayjs(data.value.planDto?.beginTime).subtract(data.value.beforeStart || 0, "minute"), dayjs(data.value.afterStart ? data.value.planDto?.beginTime : data.value.planDto?.endTime).add(data.value.afterStart || 0, "minute")));
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
const activeName = ref("first");
const state = reactive({
activeName: "first",
enclosure: "",
isAllowSign: false,
});
const { activeName, enclosure, isAllowSign } = toRefs(state);
const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
console.log(
"url2",
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url
);
window.open(
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
"_top"
);
};
//判断能否报名 (TODO-大于面授课截止时间就不能报名了,其余均可以)
function isSignClick() {
let endTime = new Date(data.value.planDto?.endTime).getTime();
let nowTime = new Date().getTime();
if (nowTime < endTime) {
state.isAllowSign = true;
} else {
state.isAllowSign = false;
}
console.log(state.isAllowSign);
}
watch(data, () => {
isSignClick();
});
const download = (url) => window.open(import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url, "_top");
// 报名
function onLineSignUp(isAgain) {
if (!state.isAllowSign) {
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
if (!isAllowSign.value) {
ElMessage.warning("未在允许报名时间范围内");
return;
}
@@ -271,72 +234,17 @@ function onLineSignUp(isAgain) {
}
request(FACETEACH_SIGNUP, { courseId });
data.value.isSignUp = true;
//重置按钮
data.value.isSignUpAgain = isAgain;
data.value.isRefused = false;
ElMessage.success(isAgain ? "重新报名成功" : "报名成功");
}
function formateArr(strs) {
let arrs = strs.split(",");
console.log("112233", arrs);
return arrs;
}
// watch(data, () => {
// console.log("data.offcourseDto", data, data.value.offcourseDto);
// if (data.value.offcourseDto && data.value.offcourseDto.outline) {
// let obj = data.value.offcourseDto.outline;
// let regex = new RegExp("<img", "gi");
// let deleteStyle = /(?<=\" )style=\".*?\"/gi;
// obj = obj.replace(deleteStyle, "");
// obj = obj.replace(regex, '<img style="max-width: 100%;height:auto"');
// data.value.offcourseDto.outline = obj;
// console.log("data.offcourseDto.outline", data.value.offcourseDto.outline);
// }
// });
// onMounted(() => {
// console.log("data.offcourseDto?.outline", data.value);
// // console.log("document", document.getElementById("face_img_id"));
// let imgs = document.getElementById("face_img_id").getElementsByTagName("img");
// console.log("imgs", imgs, imgs.length);
// let timer = setInterval(() => {
// if (imgs && imgs.length !== 0) {
// clearInterval(timer);
// for (let i = 0; i < imgs.length; i++) {
// console.log("11111", imgs[i], i);
// // console.log(
// // "document.body.clientWidth",
// // document.body.clientWidth,
// // imgs[i].width
// // );
// // if (document.body.clientWidth <= imgs[i].width) {
// // imgs[i].style.width = "100%";
// // }
// getImgInfo(imgs[i].src, i, imgs);
// }
// }
// }, 1000);
// });
function getImgInfo(url, i, imgs) {
console.log("url_i", url, i);
let image = new Image();
let w, h;
image.src = url;
console.log("dj", image.width);
image.onload = function () {
w = image.width;
console.log("image.width", image.width);
h = image.height;
console.log("document.body.clientWidth", document.body.clientWidth);
if (document.body.clientWidth <= w) {
imgs[i].style.width = "100%";
}
image.onload = null;
};
return strs?.split(",");
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
.faceteachsignup {
width: 100%;