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

@@ -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 {