mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-11 03:46:47 +08:00
feat:修改关卡
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="pathDetail pathDetailback">
|
||||
<div
|
||||
v-for="(item, i) in data"
|
||||
v-for="(item, i) in data?.list"
|
||||
:key="i"
|
||||
class="cha"
|
||||
:style="{
|
||||
top: `${imgAttr.positions[i]?.top - (current === i ? 5 : 0)}px`,
|
||||
left: `${imgAttr.positions[i]?.left - (current === i ? 10 : 0)}px`,
|
||||
top: `${imgAttr.positions[i]?.top - (current === i ? 1 : 0)}px`,
|
||||
left: `${imgAttr.positions[i]?.left - (current === i ? 11 : 0)}px`,
|
||||
}"
|
||||
>
|
||||
<div
|
||||
@@ -31,7 +31,7 @@ import { computed, defineProps, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router/dist/vue-router";
|
||||
import { ElLoading } from "element-plus";
|
||||
import { ROUTERTASK_LIST } from "@/api/api";
|
||||
import { usePage } from "@/api/request";
|
||||
import { usePage, useRequest } from "@/api/request";
|
||||
const listheight = document.body.clientHeight - 300 + "px";
|
||||
console.log("listheight", listheight);
|
||||
const props = defineProps({
|
||||
@@ -99,15 +99,20 @@ const closeLoading = () => {
|
||||
// },
|
||||
// ]);
|
||||
// closeLoading();
|
||||
const { data } = usePage(ROUTERTASK_LIST, { routerId: props.routerId }, (e) => {
|
||||
console.log("我请求成功了吗", e);
|
||||
e.data.rows.reverse();
|
||||
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
|
||||
);
|
||||
closeLoading();
|
||||
});
|
||||
const current = computed(() =>
|
||||
data.value.findIndex((e) => e.chapterId === props.currentStageId)
|
||||
);
|
||||
console.log("data", data);
|
||||
// const current = computed(() => {
|
||||
// data.value.list.findIndex((e) => e.id === data.value.currentChapterId);
|
||||
// });
|
||||
console.log("current", current);
|
||||
|
||||
function show() {
|
||||
visiable.value = true;
|
||||
@@ -115,9 +120,10 @@ function show() {
|
||||
|
||||
function toDetail(i) {
|
||||
// console.log("import.meta.env.MODE", import.meta.env.MODE);
|
||||
// if (current.value !== i) {
|
||||
// return;
|
||||
// }
|
||||
console.log("current.value !== i", current, i);
|
||||
if (current.value !== i) {
|
||||
return;
|
||||
}
|
||||
import.meta.env.MODE === "development" || import.meta.env.MODE === "test"
|
||||
? router.push({
|
||||
path: "/pathmappage",
|
||||
|
||||
Reference in New Issue
Block a user