mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 09:26:46 +08:00
--demand 面授课
This commit is contained in:
@@ -42,7 +42,7 @@ export const TASK_TYPES = {
|
||||
},
|
||||
path: {
|
||||
1: ({ courseId }) => window.open(window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL + courseId), //在线
|
||||
2: ({ courseId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${courseId}`, '_top'),
|
||||
2: ({ targetId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, '_top'),
|
||||
3: ({ courseId }) => window.open(window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL + courseId), //案例
|
||||
4: "/homeworkpage",
|
||||
5: ({ examType }) => examType === 2 ? '/externalexam' : (window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL), //考试
|
||||
|
||||
@@ -137,25 +137,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="isStudy == 'true'"
|
||||
class="goclass"
|
||||
:style="{
|
||||
background:
|
||||
el.statusName !== '已结束' &&
|
||||
(el.statusName || data.unlockMode === 1)
|
||||
? '#2478ff'
|
||||
: '#999',
|
||||
}"
|
||||
@click="toFinish(el)"
|
||||
>
|
||||
{{
|
||||
el.statusName ||
|
||||
(data.unlockMode === 1
|
||||
? TASK_TYPES.toName[el.type]
|
||||
: "未解锁")
|
||||
}}
|
||||
</div>
|
||||
<el-dropdown trigger="click" v-if="isStudy == 'true'">
|
||||
<div class="goclass"
|
||||
:style="{ background: el.statusName !== '已结束' && (el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }" @click="toFinish(el)">
|
||||
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
|
||||
</div>
|
||||
<template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,11 +233,11 @@ const types = ref({
|
||||
},
|
||||
path: {
|
||||
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
|
||||
2: ({ courseId }) =>
|
||||
2: ({ targetId }) =>
|
||||
window.open(
|
||||
`${location.protocol}//${location.host}${
|
||||
import.meta.env.VITE_BASE_API
|
||||
}/stu/project/redirectDetail?courseId=${courseId}`,
|
||||
}/stu/project/redirectDetail?courseId=${targetId}`,
|
||||
"_top"
|
||||
),
|
||||
3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
|
||||
@@ -316,12 +308,18 @@ function judgeTaskIsEnd(type, endTimes, status) {
|
||||
return isEnd;
|
||||
}
|
||||
function toFinish(d) {
|
||||
console.log(d);
|
||||
console.log(data.value.currentStageId, routerId);
|
||||
if (data.value.unlockMode !== 1 && !d.statusName) {
|
||||
ElMessage.warning("当前未解锁");
|
||||
return;
|
||||
}
|
||||
if (d.type === 2) {
|
||||
if(!d.targetId){
|
||||
return ElMessage.error("还未添加开课,请联系管理员!")
|
||||
}
|
||||
if(d.targetId.split(',').length>1){
|
||||
return
|
||||
}
|
||||
}
|
||||
if (
|
||||
data.value.endTime &&
|
||||
judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)
|
||||
@@ -504,6 +502,9 @@ function toFinish(d) {
|
||||
// // console.log("types.value.path[d.type](d)", d);
|
||||
// }
|
||||
}
|
||||
function toOffcoursePlanPage(id){
|
||||
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
|
||||
}
|
||||
function whiteTypes(type) {
|
||||
return import.meta.env.VITE_TASK_WHITE_TYPE.includes("-" + type + "-");
|
||||
}
|
||||
|
||||
@@ -159,24 +159,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="goclass"
|
||||
@click="toFinish(el, item.stageName, item.id)"
|
||||
:style="{
|
||||
background:
|
||||
el.statusName !== '已结束' &&
|
||||
(el.statusName || data.unlockMode === 1)
|
||||
? '#2478ff'
|
||||
: '#999',
|
||||
}"
|
||||
>
|
||||
{{
|
||||
el.statusName ||
|
||||
(data.unlockMode === 1
|
||||
? TASK_TYPES.toName[el.type]
|
||||
: "未解锁")
|
||||
}}
|
||||
</div>
|
||||
|
||||
<el-dropdown trigger="click" v-if="isStudy == 'true'">
|
||||
<div class="goclass" @click="toFinish(el, item.stageName, item.id)" :style="{ background: el.statusName !== '已结束' &&(el.statusName || data.unlockMode === 1) ? '#2478ff' : '#999' }">
|
||||
{{el.statusName || (data.unlockMode === 1 ? TASK_TYPES.toName[el.type] : "未解锁")}}
|
||||
</div>
|
||||
<template #dropdown v-if="el.type===2 && el.targetId?.split(',')?.length > 1">
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="(name,key) in el.targetName?.split(',')" :key="key" @click="toOffcoursePlanPage(el.targetId?.split(',')[key])">{{ name }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -332,13 +327,7 @@ const types = ref({
|
||||
},
|
||||
path: {
|
||||
1: window.location.protocol + import.meta.env.VITE_BOE_ONLINE_CLASS_URL, //在线
|
||||
2: ({ courseId }) =>
|
||||
window.open(
|
||||
`${location.protocol}//${location.host}${
|
||||
import.meta.env.VITE_BASE_API
|
||||
}/stu/project/redirectDetail?courseId=${courseId}`,
|
||||
"_top"
|
||||
),
|
||||
2: ({ targetId }) => window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${targetId}`, "_top"),
|
||||
3: window.location.protocol + import.meta.env.VITE_BOE_CASS_DETAIL_URL, //案例
|
||||
4: "/homeworkpage",
|
||||
5: window.location.protocol + import.meta.env.VITE_BOE_EXAM_DETAIL_URL, //考试
|
||||
@@ -419,8 +408,14 @@ function toFinish(d, sName, chapterOrStageId) {
|
||||
ElMessage.warning("当前未解锁");
|
||||
return;
|
||||
}
|
||||
console.log("dddddd", data, d, sName, chapterOrStageId);
|
||||
|
||||
if (d.type === 2) {
|
||||
if(!d.targetId){
|
||||
return ElMessage.error("还未添加开课,请联系管理员!")
|
||||
}
|
||||
if(d.targetId.split(',').length>1){
|
||||
return
|
||||
}
|
||||
}
|
||||
if (judgeTaskIsEnd(d.type, data.value.endTime, data.value.status)) {
|
||||
ElMessage.error("当前任务已结束");
|
||||
return;
|
||||
@@ -588,6 +583,11 @@ function toFinish(d, sName, chapterOrStageId) {
|
||||
// types.value.path[d.type](d);
|
||||
// }
|
||||
}
|
||||
|
||||
function toOffcoursePlanPage(id){
|
||||
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
|
||||
}
|
||||
|
||||
function whiteTypes(type) {
|
||||
return import.meta.env.VITE_TASK_WHITE_TYPE.includes("-" + type + "-");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user