From 2a53f6739ebe4e1ff4d5958fb3a57df2cfb1a0fe Mon Sep 17 00:00:00 2001 From: zhangyibo95 <690096405@qq.com> Date: Tue, 26 May 2026 09:33:28 +0800 Subject: [PATCH] =?UTF-8?q?update:=E5=AF=B9=E6=8E=A5=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E9=9A=BE=E5=BA=A6=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis.js | 5 + .../training/TrainingDifficultyBadge.vue | 18 +- .../TrainingDifficultyPreviewCard.vue | 21 +- src/pages/training/difficulty.vue | 267 ++++++++++++++++-- 4 files changed, 279 insertions(+), 32 deletions(-) diff --git a/src/apis.js b/src/apis.js index 06a474f..8431626 100644 --- a/src/apis.js +++ b/src/apis.js @@ -411,6 +411,11 @@ export const getPersonalTrainingAPI = async () => { return request("GET", "/personal/training"); }; +export const getTrainingDifficultyListAPI = async (type) => { + const query = type ? `?type=${encodeURIComponent(type)}` : ""; + return request("GET", `/training/difficulty/list${query}`); +}; + export const getBattleDataAPI = async () => { return request("GET", "/user/fight/statistics"); }; diff --git a/src/components/training/TrainingDifficultyBadge.vue b/src/components/training/TrainingDifficultyBadge.vue index 29c0f3e..01ee967 100644 --- a/src/components/training/TrainingDifficultyBadge.vue +++ b/src/components/training/TrainingDifficultyBadge.vue @@ -62,8 +62,8 @@ const badgeStateStyle = computed(() => { }; }); -const isCompleted = computed(() => { - return !props.active && !props.locked && progressValue.value > 0; +const showProgress = computed(() => { + return !props.locked; }); const badgeFillSrc = computed(() => { @@ -80,7 +80,7 @@ const handleClick = () => { class="difficulty-badge" :class="{ 'difficulty-badge--active': active, - 'difficulty-badge--completed': isCompleted, + 'difficulty-badge--progress': showProgress, 'difficulty-badge--locked': locked, }" :style="[badgeStyle, badgeStateStyle]" @@ -134,7 +134,7 @@ const handleClick = () => { content: ""; position: absolute; inset: calc(var(--badge-orbit-offset) * -1); - border: 4rpx solid #ffffff; + border: 4rpx solid transparent; border-radius: 50%; pointer-events: none; box-sizing: border-box; @@ -236,8 +236,8 @@ const handleClick = () => { content: none; } -.difficulty-badge--completed .difficulty-badge__fill::before, -.difficulty-badge--completed .difficulty-badge__fill::after { +.difficulty-badge--progress .difficulty-badge__fill::before, +.difficulty-badge--progress .difficulty-badge__fill::after { content: ""; position: absolute; inset: -12rpx; @@ -251,11 +251,11 @@ const handleClick = () => { pointer-events: none; } -.difficulty-badge--completed .difficulty-badge__fill::before { +.difficulty-badge--progress .difficulty-badge__fill::before { background: rgba(255, 255, 255, 0.35); } -.difficulty-badge--completed .difficulty-badge__fill::after { +.difficulty-badge--progress .difficulty-badge__fill::after { background: conic-gradient( from -90deg, rgba(254, 208, 152, 1) 0, @@ -265,7 +265,7 @@ const handleClick = () => { } .difficulty-badge--active .difficulty-badge__label, -.difficulty-badge--completed .difficulty-badge__label { +.difficulty-badge--progress .difficulty-badge__label { color: #333333; } diff --git a/src/components/training/TrainingDifficultyPreviewCard.vue b/src/components/training/TrainingDifficultyPreviewCard.vue index 3269ac6..d8fa3a8 100644 --- a/src/components/training/TrainingDifficultyPreviewCard.vue +++ b/src/components/training/TrainingDifficultyPreviewCard.vue @@ -1,5 +1,7 @@