mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-23 17:55:41 +08:00
feat:修改正则
This commit is contained in:
@@ -20,7 +20,10 @@
|
||||
<div class="alltalkcontainer">
|
||||
<div class="inne">
|
||||
<div class="takltitle">{{ disDetail?.title }}</div>
|
||||
<div class="taklcon" v-html="disDetail?.content"></div>
|
||||
<div
|
||||
class="taklcon discussdetail_img_class"
|
||||
v-html="disDetail?.content"
|
||||
></div>
|
||||
<div class="tt clearfix">
|
||||
<div class="ttin">
|
||||
{{ discussInfo ? discussInfo : "-" }}
|
||||
@@ -625,18 +628,18 @@ function send() {
|
||||
}
|
||||
}
|
||||
|
||||
watch(disDetail, () => {
|
||||
console.log(" disDetail.value.content", disDetail.value.content);
|
||||
if (disDetail.value.content) {
|
||||
let obj = disDetail.value.content;
|
||||
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"');
|
||||
disDetail.value.content = obj;
|
||||
console.log("disDetail.value.content", disDetail.value.content);
|
||||
}
|
||||
});
|
||||
// watch(disDetail, () => {
|
||||
// console.log(" disDetail.value.content", disDetail.value.content);
|
||||
// if (disDetail.value.content) {
|
||||
// let obj = disDetail.value.content;
|
||||
// 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"');
|
||||
// disDetail.value.content = obj;
|
||||
// console.log("disDetail.value.content", disDetail.value.content);
|
||||
// }
|
||||
// });
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
@@ -649,6 +652,9 @@ watch(disDetail, () => {
|
||||
}
|
||||
.discussdetail {
|
||||
width: 100%;
|
||||
.discussdetail_img_class img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.tithead {
|
||||
margin-top: 10px;
|
||||
height: 77px;
|
||||
@@ -759,6 +765,7 @@ watch(disDetail, () => {
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.tt {
|
||||
margin-top: 20px;
|
||||
background-color: #f0f3f6;
|
||||
|
||||
@@ -53,7 +53,10 @@
|
||||
<div class="coni" @click="goDetails(item)">
|
||||
<div class="conin">
|
||||
<div class="tit">{{ item.title }}</div>
|
||||
<div class="inn" v-html="item.content"></div>
|
||||
<div
|
||||
class="inn discusspage_img_class"
|
||||
v-html="item.content"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thinline"></div>
|
||||
@@ -274,18 +277,18 @@ function handleCurrentChange(e, k) {
|
||||
getPostList(state.info.discussDtoList[0].id);
|
||||
}
|
||||
|
||||
watch(state.postList, () => {
|
||||
console.log("state.postList", state.postList);
|
||||
// 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);
|
||||
// }
|
||||
});
|
||||
// watch(state.postList, () => {
|
||||
// console.log("state.postList", state.postList);
|
||||
// // 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 -->
|
||||
@@ -298,6 +301,9 @@ watch(state.postList, () => {
|
||||
}
|
||||
.discusspage {
|
||||
width: 100%;
|
||||
.discusspage_img_class img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.head {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
|
||||
@@ -73,9 +73,8 @@
|
||||
<div class="work">
|
||||
<div style="display: flex; align-items: center">
|
||||
<div
|
||||
id="faceteachnocommon_img_id"
|
||||
style="padding: 5px"
|
||||
class="content"
|
||||
class="content faceteachnocommon_img_class"
|
||||
v-html="data.offcourseDto?.outline"
|
||||
></div>
|
||||
</div>
|
||||
@@ -232,18 +231,18 @@ 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);
|
||||
}
|
||||
});
|
||||
// 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 -->
|
||||
@@ -251,6 +250,9 @@ watch(data, () => {
|
||||
.faceteachnocommon {
|
||||
width: 100%;
|
||||
padding-bottom: 20px;
|
||||
.faceteachnocommon_img_class img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.main {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<div style="display: flex; align-items: center">
|
||||
<div
|
||||
style="padding: 5px"
|
||||
class="content"
|
||||
class="content faceteachnocourse_img_class"
|
||||
v-html="data.offcourseDto?.outline"
|
||||
></div>
|
||||
</div>
|
||||
@@ -226,18 +226,18 @@ function formateArr(strs) {
|
||||
console.log("112233", arrs);
|
||||
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);
|
||||
}
|
||||
});
|
||||
// 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 -->
|
||||
@@ -245,6 +245,9 @@ watch(data, () => {
|
||||
.faceteachnocourse {
|
||||
width: 100%;
|
||||
padding-bottom: 20px;
|
||||
.faceteachnocourse_img_class img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.main {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
@@ -46,8 +46,13 @@
|
||||
v-if="data?.hasTask || data.planDto?.applyFlag"
|
||||
@click="onLineSignUp"
|
||||
:style="{
|
||||
background: data.isSignUp ? '#999' : 'rgb(57, 146, 249)',
|
||||
background: isAllowSign
|
||||
? data.isSignUp || data.isRefused
|
||||
? '#999'
|
||||
: 'rgb(57, 146, 249)'
|
||||
: '#999',
|
||||
}"
|
||||
,
|
||||
>{{
|
||||
data.isRefused
|
||||
? "审核拒绝"
|
||||
@@ -104,7 +109,7 @@
|
||||
<div
|
||||
id="face_img_id"
|
||||
style="padding: 10px"
|
||||
class="content"
|
||||
class="content faceteachsignup_img_class"
|
||||
v-html="data.offcourseDto?.outline"
|
||||
></div>
|
||||
</div>
|
||||
@@ -219,7 +224,6 @@ const closeLoading = () => {
|
||||
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId }, () => {
|
||||
closeLoading();
|
||||
});
|
||||
|
||||
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
|
||||
|
||||
const state = reactive({
|
||||
@@ -242,10 +246,28 @@ const download = (url) => {
|
||||
);
|
||||
};
|
||||
|
||||
let timer = null;
|
||||
//判断能否报名 (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();
|
||||
});
|
||||
// 报名
|
||||
function onLineSignUp() {
|
||||
if (!state.isAllowSign) {
|
||||
// console.log("data.signFlag", data.value.signFlag, isAllowSign);
|
||||
ElMessage.warning("未在允许报名时间范围内");
|
||||
return;
|
||||
}
|
||||
if (data.value.isSignUp && data.value.isSignUp) {
|
||||
return;
|
||||
}
|
||||
@@ -259,18 +281,18 @@ function formateArr(strs) {
|
||||
console.log("112233", arrs);
|
||||
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);
|
||||
}
|
||||
});
|
||||
// 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"));
|
||||
@@ -318,6 +340,9 @@ function getImgInfo(url, i, imgs) {
|
||||
.faceteachsignup {
|
||||
width: 100%;
|
||||
padding-bottom: 20px;
|
||||
.faceteachsignup_img_class img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.main {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
@@ -144,21 +144,24 @@ const state = reactive({
|
||||
const { hour, minute, seconds } = toRefs(state);
|
||||
|
||||
let timer = setInterval(() => {
|
||||
let endTime = parseInt(new Date(data.value.submitEndTime).getTime() / 1000);
|
||||
let nowTime = parseInt(new Date().getTime() / 1000);
|
||||
if (endTime > nowTime) {
|
||||
state.hour = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") / 60
|
||||
);
|
||||
state.minute = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") % 60
|
||||
);
|
||||
state.seconds = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "seconds") -
|
||||
(state.hour * 60 + state.minute) * 60
|
||||
);
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
console.log("endTime", data.value.submitEndTime);
|
||||
if (data && data.value.submitEndTime) {
|
||||
let endTime = parseInt(new Date(data.value.submitEndTime).getTime() / 1000);
|
||||
let nowTime = parseInt(new Date().getTime() / 1000);
|
||||
if (endTime > nowTime) {
|
||||
state.hour = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") / 60
|
||||
);
|
||||
state.minute = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "minute") % 60
|
||||
);
|
||||
state.seconds = parseInt(
|
||||
dayjs(data.value.submitEndTime).diff(dayjs(), "seconds") -
|
||||
(state.hour * 60 + state.minute) * 60
|
||||
);
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user