mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-11 11:56:48 +08:00
feat:修改
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<script setup>
|
||||
import { computed, defineProps, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router/dist/vue-router";
|
||||
import { ElLoading } from "element-plus";
|
||||
import { ElLoading, ElMessage } from "element-plus";
|
||||
import { ROUTERTASK_LIST } from "@/api/api";
|
||||
import { usePage, useRequest } from "@/api/request";
|
||||
const listheight = document.body.clientHeight - 300 + "px";
|
||||
@@ -103,10 +103,26 @@ const { data } = useRequest(ROUTERTASK_LIST, { routerId: props.routerId });
|
||||
console.log("data", data);
|
||||
let current = ref(null);
|
||||
watch(data, () => {
|
||||
data.value.list.reverse();
|
||||
current.value = data.value.list.findIndex(
|
||||
(e) => e.id === data.value.currentChapterId
|
||||
);
|
||||
// console.log(
|
||||
// "import.meta.env.VITE_BOE_BASE_URL",
|
||||
// import.meta.env.VITE_BOE_BASE_URL
|
||||
// );
|
||||
if (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(() => {
|
||||
|
||||
Reference in New Issue
Block a user