From a1e73095282f1e4c9c7f625aab353add69312fc0 Mon Sep 17 00:00:00 2001 From: Kunagisa <1549184870@qq.com> Date: Mon, 9 Jun 2025 22:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E5=90=8E=E6=89=8D=E8=83=BD?= =?UTF-8?q?=E8=AF=84=E5=88=86=EF=BC=8C=E8=80=8C=E4=B8=94=E8=A6=81=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=90=8E=E6=89=8D=E8=83=BD=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index/MapDetail.vue | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/views/index/MapDetail.vue b/src/views/index/MapDetail.vue index 6603f16..67df520 100644 --- a/src/views/index/MapDetail.vue +++ b/src/views/index/MapDetail.vue @@ -43,8 +43,8 @@
@@ -107,6 +107,7 @@ import { ref, onMounted } from 'vue' import { useRoute, useRouter } from 'vue-router' import { getMapDetail } from '../../api/maps.js' +import { hasValidToken } from '../../utils/jwt' const route = useRoute() const router = useRouter() @@ -118,6 +119,31 @@ const mapScore = ref(0) const authorScore = ref(0) const mapComment = ref('') const authorComment = ref('') +const hasDownloaded = ref(false) + +// 处理下载点击 +const handleDownload = () => { + hasDownloaded.value = true +} + +// 处理评分点击 +const handleScoreClick = () => { + if (!hasValidToken()) { + alert('请先登录后再进行评分') + router.push({ + path: '/backend/login', + query: { redirect: route.fullPath } + }) + return + } + + if (!hasDownloaded.value) { + alert('请先下载地图后再进行评分') + return + } + + showScoreDialog.value = true +} const fetchMapDetail = async () => { try {