feat:修改

This commit is contained in:
lixg
2023-02-28 10:54:46 +08:00
parent c06b8768e2
commit a4eb626a18
9 changed files with 44 additions and 16 deletions

View File

@@ -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(() => {