👽️ 适配月谕圣牌模式

This commit is contained in:
BTMuli
2025-10-01 10:37:46 +08:00
parent 145438373b
commit 3ece987c80
8 changed files with 57 additions and 25 deletions

View File

@@ -29,13 +29,7 @@
<!-- 处理真境剧诗 -->
<template v-else-if="props.pos.type === ActCalendarTypeEnum.RoleCombat">
<div class="combat-append" @click="toCombat()" title="点击前往剧诗页面">
<template v-if="!props.pos.role_combat_detail.is_unlock">
<span>未解锁</span>
</template>
<template v-else-if="!props.pos.role_combat_detail.has_data">
<span>尚未挑战</span>
</template>
<span v-else>{{ props.pos.role_combat_detail.max_round_id }}</span>
<span>{{ getCombatStat(props.pos.role_combat_detail) }}</span>
</div>
</template>
<!-- 处理深境螺旋 -->
@@ -129,6 +123,10 @@ onMounted(() => {
timer = setInterval(handlePosition, 1000);
});
onUnmounted(() => {
if (timer !== null) clearInterval(timer);
});
function handlePosition(): void {
if (restTs.value < 1) {
if (timer !== null) clearInterval(timer);
@@ -155,9 +153,12 @@ function showMaterial(reward: TGApp.Game.ActCalendar.ActReward): void {
emits("clickM", reward);
}
onUnmounted(() => {
if (timer !== null) clearInterval(timer);
});
function getCombatStat(detail: TGApp.Game.ActCalendar.ActRoleCombat): string {
if (!detail.is_unlock) return "未解锁";
if (!detail.has_data) return "尚未挑战";
if (detail.difficulty_id < 5) return `${detail.max_round_id}`;
return `月谕模式·第${detail.max_round_id}幕·圣牌${detail.tarot_finished_cnt}`;
}
</script>
<style lang="scss" scoped>
.ph-pos-user-card {

View File

@@ -1,8 +1,8 @@
<template>
<div class="tuco-box">
<TucTile title="最佳记录" :val="props.data.max_round_id" />
<TucTile title="最佳记录" :val="getBestVal()" />
<TucTile :title="`获得星章-${props.data.medal_num}`" :val="props.data.get_medal_round_list" />
<TucTile :title="getTitle()" :val="`第${props.data.max_round_id}幕`" />
<TucTile :title="getRoundTitle()" :val="getRoundVal()" />
<TucTile title="消耗幻剧之花" :val="props.data.coin_num" />
<TucFight label="最快完成演出" :data="props.fights.shortest_avatar_list" />
<TucTile title="总耗时" :val="getTime()" />
@@ -21,7 +21,7 @@ type TucOverviewProps = { data: TGApp.Game.Combat.Stat; fights: TGApp.Game.Comba
const props = defineProps<TucOverviewProps>();
function getTitle(): string {
function getRoundTitle(): string {
switch (props.data.difficulty_id) {
case 0:
return "未选择";
@@ -33,11 +33,23 @@ function getTitle(): string {
return "困难模式";
case 4:
return "卓越模式";
case 5:
return "月谕模式";
default:
return `未知模式${props.data.difficulty_id}`;
}
}
function getBestVal(): string {
if (props.data.difficulty_id < 5) return `${props.data.max_round_id}`;
return `${props.data.max_round_id}幕·圣牌${props.data.tarot_finished_cnt}`;
}
function getRoundVal(): string {
if (props.data.difficulty_id < 5) return `${props.data.max_round_id}`;
return `${props.data.tarot_finished_cnt + props.data.max_round_id}`;
}
function getTime(): string {
const sec = props.fights.total_use_time % 60;
const min = (props.fights.total_use_time - sec) / 60;
@@ -48,7 +60,7 @@ function getTime(): string {
.tuco-box {
display: grid;
width: 100%;
grid-gap: 8px;
gap: 8px;
grid-template-columns: repeat(3, 1fr);
}
</style>

View File

@@ -2,7 +2,10 @@
<div class="tucr-box">
<div class="tucr-title">
<img :src="`/icon/star/combat${modelValue.is_get_medal ? 1 : 0}.webp`" alt="combat" />
<span class="main">{{ modelValue.round_id }}</span>
<span class="main" v-if="modelValue.is_tarot">
圣牌挑战·{{ modelValue.tarot_serial_no }}
</span>
<span class="main" v-else>{{ modelValue.round_id }}</span>
<span class="sub">{{ timestampToDate(Number(modelValue.finish_time) * 1000) }}</span>
</div>
<div class="tucr-content">

View File

@@ -1,3 +1,4 @@
<!-- TODO: 链接处理重构 -->
<template>
<div class="tp-image-box" v-if="localUrl !== undefined">
<img :src="localUrl" @click="showOverlay = true" :alt="oriUrl" :title="getImageTitle()" />
@@ -118,9 +119,7 @@ function getImageTitle(): string {
}
function getImageExt(): string {
if (props.data.attributes) {
if (props.data.attributes.ext) return props.data.attributes.ext;
}
if (props.data.attributes && props.data.attributes.ext) return props.data.attributes.ext;
if (typeof props.data.insert.image === "string") {
const arr = props.data.insert.image.split(".");
return arr[arr.length - 1];