diff --git a/src/oj/achievement/index.vue b/src/oj/achievement/index.vue index 2451931..c90a68d 100644 --- a/src/oj/achievement/index.vue +++ b/src/oj/achievement/index.vue @@ -48,17 +48,6 @@ const rarities = computed(() => (a, b) => RARITY_RANK[a.rarity] - RARITY_RANK[b.rarity], ), ) - -// 数据是异步来的,卡片挂上去时百分比就是终值,CSS 过渡不会触发。 -// 先按 0 渲染一帧,下一帧再填真值,圆环和进度条才有"长出来"的动画 -const grown = ref(false) -const percent = computed(() => - grown.value ? (summary.value?.percent ?? 0) : 0, -) -function rarityPercent(r: { unlocked: number; total: number }) { - if (!grown.value || !r.total) return 0 - return (r.unlocked / r.total) * 100 -} const badges = ref([]) const { isDesktop } = useBreakpoints() const tab = ref("all") @@ -74,7 +63,6 @@ const filtered = computed(() => { async function load() { loading.value = true - grown.value = false try { const [list, sum, badgeRes] = await Promise.all([ getAchievements(name.value), @@ -88,9 +76,6 @@ async function load() { } finally { loading.value = false } - // 等卡片以 0 渲染完这一帧,再切到真值 - await nextTick() - requestAnimationFrame(() => requestAnimationFrame(() => (grown.value = true))) } onMounted(load) @@ -104,17 +89,10 @@ watch(name, load) - - % - + {{ summary.percent }}% 已获得 {{ summary.unlocked }} / {{ summary.total }} @@ -134,9 +112,8 @@ watch(name, load)