mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-09 02:46:47 +08:00
Merge branch 'dongwu-master'
This commit is contained in:
@@ -256,45 +256,26 @@ 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);
|
const realIndex = data.value?.list.findIndex(e => e.id === showList.value[i].id);
|
||||||
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,realIndex+1) && !canStudy(props.routerInfo.studySetting,realIndex+1)){
|
||||||
let isStudy = false;
|
|
||||||
if (previewSetting == null) {
|
|
||||||
// 如果未设置预览 则只可以看当前关卡 其余关卡不让点击
|
|
||||||
if (current.value !== i) {
|
|
||||||
ElMessage.warning("当前关卡不可预览");
|
ElMessage.warning("当前关卡不可预览");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isStudy = true;
|
if(current.value !== i && canStudy(props.routerInfo.previewSetting,realIndex+1)){
|
||||||
} else {
|
isStudy = false
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
if(current.value !== i && canStudy(props.routerInfo.studySetting,realIndex+1)){
|
||||||
|
isStudy = true
|
||||||
}
|
}
|
||||||
router.push({
|
router.push({
|
||||||
path: "/pathmappage",
|
path: "/pathmappage",
|
||||||
@@ -330,7 +311,7 @@ function close() {
|
|||||||
// background-position: center;
|
// background-position: center;
|
||||||
// overflow-x: scroll;
|
// overflow-x: scroll;
|
||||||
margin: 30px;
|
margin: 30px;
|
||||||
margin-top: 100px;
|
margin-top: 200px;
|
||||||
.cha {
|
.cha {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
Reference in New Issue
Block a user