feat:修改跳转

This commit is contained in:
lixg
2023-03-01 14:58:04 +08:00
parent 59de81a021
commit 4d4ec3f8e8
7 changed files with 56 additions and 44 deletions

View File

@@ -27,7 +27,7 @@ import { GET_USER_INFO } from "@/api/ThirdApi";
import { getCookie } from "@/api/utils";
import { USER_INFO } from "@/api/api";
console.log("版本1.2.11------------");
console.log("版本1.2.12------------");
const store = useStore();
const router = useRouter();

View File

@@ -1,5 +1,5 @@
<template>
<div class="pathDetail pathDetailback">
<div class="pathDetail pathDetailback" v-if="data?.list">
<div
v-for="(item, i) in data?.list"
:key="i"
@@ -99,30 +99,22 @@ const closeLoading = () => {
// },
// ]);
// closeLoading();
const { data } = useRequest(ROUTERTASK_LIST, { routerId: props.routerId });
const { data } = useRequest(
ROUTERTASK_LIST,
{ routerId: props.routerId },
() => {
closeLoading();
}
);
console.log("data", data);
let current = ref(null);
watch(data, () => {
// console.log(
// "import.meta.env.VITE_BOE_BASE_URL",
// import.meta.env.VITE_BOE_BASE_URL
// );
if (data && data.value && data.value.list) {
data.value.list.reverse();
current.value = data.value.list.findIndex(
(e) => e.id === data.value.currentChapterId
);
} else {
ElMessage.warning("您不是此学习路径的学员");
// router.push({
// path: import.meta.env.VITE_BOE_BASE_URL + "/mobile/pages/index/index",
// });
window.open(
import.meta.env.VITE_BOE_BASE_URL + "/mobile/pages/index/index",
"_self"
);
}
closeLoading();
});
// const current = computed(() => {
@@ -161,6 +153,9 @@ function toDetail(i) {
function close() {
visiable.value = false;
}
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}
</script>
<style lang="scss">
.pathDetailback {

View File

@@ -134,9 +134,6 @@
>
下载
</div>
<!-- <div style="margin-left: 5px;color:#999;" @click="download(el)">
下载
</div> -->
</div>
</div>
</div>
@@ -185,14 +182,11 @@ const handleClick = (tab, event) => {
const download = (url) => {
console.log(
"下载url",
import.meta.env.VITE_BOE_TEST_DETAIL_URL,
import.meta.env.VITE_BASE_FILE_PATH,
process.env.VITE_BASE_FILE_PATH,
import.meta.env.VITE_FILE_PATH,
process.env.VITE_FILE_PATH,
url
);
window.open(
window.location.protocol + import.meta.env.VITE_BASE_FILE_PATH + url
);
window.open(import.meta.env.VITE_FILE_PATH + url);
};
const downloads = (url) => {
ElMessage.warning("未在有效时间范围内,请耐心等待!");

View File

@@ -184,7 +184,7 @@ const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
window.open(url);
window.open(import.meta.env.VITE_FILE_PATH + url);
};
const downloads = (url) => {
ElMessage.warning("未在有效时间范围内,请耐心等待!");

View File

@@ -193,11 +193,9 @@ const handleClick = (tab, event) => {
console.log("附件", tab, event);
};
const download = (url) => {
window.open(url);
};
const downloads = (url) => {
ElMessage.warning("未在有效时间范围内,请耐心等待!");
window.open(import.meta.env.VITE_FILE_PATH + url);
};
let timer = null;
// 报名

View File

@@ -2,12 +2,12 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-19 14:59:34
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-28 14:46:55
* @LastEditTime: 2023-03-01 14:42:05
* @FilePath: /stu_h5/src/views/pathmap/LevelList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="pathdetails">
<div class="pathdetails" v-if="data">
<ReturnHead
text="路径详情"
:showfile="true"
@@ -35,6 +35,17 @@
</div>
<!-- 关卡列表 -->
</div>
<div v-else class="pathdetails">
<el-result
icon="success"
title="您不是此学习路径学员"
sub-title="请联系管理员"
>
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</div>
</template>
<script setup>
@@ -55,6 +66,9 @@ const {
} = useRoute();
const { data } = useRequest(ROUTER_PROCESS, { routerId: routerId });
console.log("获取路径图", data);
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}
</script>
<style lang="scss">

View File

@@ -1,5 +1,5 @@
<template>
<div class="projectdetails">
<div class="projectdetails" v-if="data?.projectId">
<ReturnHead
text="项目详情"
:showfile="true"
@@ -200,6 +200,13 @@
</div> -->
</div>
</div>
<div v-else>
<el-result icon="success" title="您不是此项目学员" sub-title="请联系管理员">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</div>
</template>
<script setup>
@@ -242,16 +249,17 @@ watch(
},
{ deep: true }
);
watch(data, () => {
console.log("data.value.projectId", data.value);
if (data && data.value && !data.value.projectId) {
ElMessage.warning("您不是此项目的学员");
window.open(
import.meta.env.VITE_BOE_BASE_URL + "/mobile/pages/index/index",
"_self"
);
}
});
// watch(data, () => {
// console.log("data.value.projectId", data.value);
// if (data && data.value && !data.value.projectId) {
// ElMessage.warning("您不是此项目的学员");
// console.log("您不是此项目的学员");
// // window.open(
// // import.meta.env.VITE_BOE_BASE_URL + "/mobile/pages/index/index",
// // "_self"
// // );
// }
// });
function getTaskStatus(d) {
if (data.value.status !== 3) {
@@ -576,6 +584,9 @@ const queryAllStatus = (data) => {
}
return true;
};
function toIndex() {
window.location.href = import.meta.env.VITE_BOE_API_URL;
}
</script>
<style lang="scss">