update:对接个人训练难度页

This commit is contained in:
2026-05-26 09:33:28 +08:00
parent bae31add22
commit 2a53f6739e
4 changed files with 279 additions and 32 deletions

View File

@@ -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;
}

View File

@@ -1,5 +1,7 @@
<script setup>
defineProps({
import { computed } from "vue";
const props = defineProps({
title: {
type: String,
default: "",
@@ -9,6 +11,10 @@ defineProps({
default: () => [],
},
});
const previewLines = computed(() => {
return props.lines.map((line) => String(line || "").trim()).filter(Boolean);
});
</script>
<template>
@@ -21,8 +27,13 @@ defineProps({
<view class="difficulty-preview__content">
<text class="difficulty-preview__title">{{ title }}</text>
<view class="difficulty-preview__copy">
箭靶划分为3个区域需5次命中目标
100秒内完成所有射击
<text
v-for="(line, index) in previewLines"
:key="`${line}-${index}`"
class="difficulty-preview__line"
>
{{ line }}
</text>
</view>
</view>
</view>
@@ -67,5 +78,9 @@ defineProps({
text-align: center;
}
.difficulty-preview__line {
display: block;
}
</style>