mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-10 03:16:46 +08:00
--fix bug 路径图列表
This commit is contained in:
@@ -256,45 +256,22 @@ console.log("data", data, props.routerInfo);
|
|||||||
function show() {
|
function show() {
|
||||||
visiable.value = true;
|
visiable.value = true;
|
||||||
}
|
}
|
||||||
|
function canStudy(setting,current){
|
||||||
|
const arr = setting?.split(',')
|
||||||
|
if (arr && arr.length===2){
|
||||||
|
return current >= arr[0] && current <= arr[1]
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
function toDetail(item, i) {
|
function toDetail(item, i) {
|
||||||
// console.log("import.meta.env.MODE", import.meta.env.MODE);
|
|
||||||
console.log("current.value !== i", current, i, item);
|
|
||||||
|
|
||||||
// 预览和学习设置
|
// 预览和学习设置
|
||||||
let previewSetting = props.routerInfo.previewSetting;
|
let isStudy = true;
|
||||||
let studySetting = props.routerInfo.studySetting;
|
if(current.value !== i && !canStudy(props.routerInfo.previewSetting,i+1) && !canStudy(props.routerInfo.studySetting,i+1)){
|
||||||
let isStudy = false;
|
ElMessage.warning("当前关卡不可预览");
|
||||||
if (previewSetting == null) {
|
return;
|
||||||
// 如果未设置预览 则只可以看当前关卡 其余关卡不让点击
|
}
|
||||||
if (current.value !== i) {
|
if(current.value !== i && canStudy(props.routerInfo.previewSetting,i+1)){
|
||||||
ElMessage.warning("当前关卡不可预览");
|
isStudy = false
|
||||||
return;
|
|
||||||
}
|
|
||||||
isStudy = true;
|
|
||||||
} else {
|
|
||||||
if (current.value !== i) {
|
|
||||||
let lookArr = [];
|
|
||||||
lookArr = previewSetting.split(",");
|
|
||||||
if (i + 1 >= lookArr[0] && i + 1 <= lookArr[1]) {
|
|
||||||
if (studySetting !== null) {
|
|
||||||
let studyArr = [];
|
|
||||||
studyArr = studySetting.split(",");
|
|
||||||
if (i + 1 >= studyArr[0] && i + 1 <= studyArr[1]) {
|
|
||||||
isStudy = true;
|
|
||||||
} else {
|
|
||||||
isStudy = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
isStudy = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ElMessage.warning("当前关卡不可预览");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
isStudy = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
router.push({
|
router.push({
|
||||||
path: "/pathmappage",
|
path: "/pathmappage",
|
||||||
|
|||||||
Reference in New Issue
Block a user