This commit is contained in:
2026-04-21 02:30:17 +08:00
parent c6c9f960da
commit 720a27cca3
13 changed files with 404 additions and 24 deletions
@@ -93,7 +93,7 @@
<div class="item-head" @click="hideSuit = !hideSuit">
套装信息{{ hideSuit ? ' (点击显示)' : '(点击隐藏)' }}
</div>
<div v-show="!hideSuit">
<template v-if="!hideSuit">
<div class="flex bg-#191918 items-center justify-center gap-2px p-5px">
<calc-button
:disabled="raritiyList.findIndex((rarity) => rarity === curSuitLv.rarity) <= 0"
@@ -135,40 +135,43 @@
<div class="flex-1 overflow-y-auto overflow-x-hidden bg-black w-240px">
<SuitInfo v-if="curSuitInfo" :suit="curSuitInfo" />
</div>
</div>
</template>
</div>
<div class="flex flex-col flex-1 overflow-hidden bg-black" v-if="curOathInfo">
<div class="item-head">誓约信息</div>
<div class="flex bg-#191918 items-center justify-center gap-2px p-5px">
<calc-button
:disabled="raritiyList.findIndex((rarity) => rarity === curSuitLv.rarity) <= 0"
:disabled="raritiyList.findIndex((rarity) => rarity === curOathSkillLv.rarity) <= 0"
icon="min-little"
@click="changeSuitLv('preRarity')"
@click="changeOathSkillLv('preRarity')"
></calc-button>
<calc-button
icon="reduce-little"
:disabled="
raritiyList.findIndex((rarity) => rarity === curSuitLv.rarity) <= 0 && curSuitLv.lv <= 1
raritiyList.findIndex((rarity) => rarity === curOathSkillLv.rarity) <= 0 &&
curOathSkillLv.lv <= 1
"
@click="changeSuitLv('preLv')"
@click="changeOathSkillLv('preLv')"
></calc-button>
<div class="flex px-20px gap-x-10px" :class="rarityClass(curSuitLv.rarity)">
<span>{{ curSuitLv.rarity }}</span>
<span>{{ formatLv(curSuitLv.lv, curSuitLv.rarity) }}</span>
<div class="flex px-20px gap-x-10px" :class="rarityClass(curOathSkillLv.rarity)">
<span>{{ curOathSkillLv.rarity }}</span>
<span>{{ formatLv(curOathSkillLv.lv, curOathSkillLv.rarity) }}</span>
</div>
<calc-button
:disabled="
raritiyList.findIndex((rarity) => rarity === curSuitLv.rarity) >= raritiyList.length - 1
raritiyList.findIndex((rarity) => rarity === curOathSkillLv.rarity) >=
raritiyList.length - 1
"
@click="changeSuitLv('nextLv')"
@click="changeOathSkillLv('nextLv')"
icon="increase-little"
></calc-button>
<calc-button
:disabled="
raritiyList.findIndex((rarity) => rarity === curSuitLv.rarity) >= raritiyList.length - 1
raritiyList.findIndex((rarity) => rarity === curOathSkillLv.rarity) >=
raritiyList.length - 1
"
@click="changeSuitLv('nextRarity')"
@click="changeOathSkillLv('nextRarity')"
icon="max-little"
></calc-button>
</div>
@@ -190,7 +193,7 @@
class="w-80% m-auto h-1px bg-gradient-to-r from-[rgba(52,43,27,0.05)] via-[rgba(52,43,27,1)] to-[rgba(52,43,27,0.05)]"
></div>
<div class="flex-1 overflow-y-auto overflow-x-hidden bg-black w-240px">
<SuitInfo v-if="curSuitInfo" :suit="curSuitInfo" />
<SuitInfo v-if="curOathSkillInfo" :suit="curOathSkillInfo" />
</div>
</div>
</div>
@@ -218,6 +221,10 @@ const curRarity = ref('')
const curSuit = ref(16203)
const curEquId = ref()
const curSuitLv = ref({
rarity: '太初',
lv: 1,
})
const curOathSkillLv = ref({
rarity: '史诗',
lv: 1,
})
@@ -270,6 +277,41 @@ const changeSuitLv = (
}
}
const changeOathSkillLv = (
type: 'preRarity' | 'nextRarity' | 'preLv' | 'nextLv',
resetLv: boolean = true,
) => {
if (type == 'preRarity') {
const index = raritiyList.findIndex((a) => a == curOathSkillLv.value.rarity)
if (index > 0) {
curOathSkillLv.value.rarity = raritiyList[index - 1]
curOathSkillLv.value.lv = resetLv ? 1 : 5
return
}
} else if (type == 'nextRarity') {
const index = raritiyList.findIndex((a) => a == curOathSkillLv.value.rarity)
if (index < raritiyList.length - 1) {
curOathSkillLv.value.rarity = raritiyList[index + 1]
curOathSkillLv.value.lv = 1
return
}
} else if (type == 'preLv') {
if (curOathSkillLv.value.lv > 1) {
curOathSkillLv.value.lv--
return
} else {
changeOathSkillLv('preRarity', false)
}
} else if (type == 'nextLv') {
if (curOathSkillLv.value.lv < 5) {
curOathSkillLv.value.lv++
return
} else {
changeOathSkillLv('nextRarity')
}
}
}
const choose_part = ref<string[]>([])
const curEquInfo = computed(() => {
@@ -299,6 +341,32 @@ const curOathInfo = computed(() => {
return infoStore.oathSkills?.[curEquInfo.value?.suit[0]]
})
const curOathSkillLvs = asyncComputed(async () => {
if (!curOathInfo.value || !curEquInfo.value?.suit[0]) {
return undefined
}
const res = await infoStore.getOathInfo(
curEquInfo.value?.suit[0],
oathSkillId.value,
curOathSkillLv.value.rarity,
)
return res
})
const curOathSkillInfo = computed(() => {
const res = curOathSkillLvs.value
if (!res) {
return undefined
}
console.log(curEquInfo.value?.suit[0])
return {
...res,
SkillAttack: parseFloat(res.SkillAttack.toString().split(',')[curOathSkillLv.value.lv - 1]),
Buffer: parseFloat(res.Buffer.toString().split(',')[curOathSkillLv.value.lv - 1]),
point: parseFloat(res.point.toString().split(',')[curOathSkillLv.value.lv - 1]),
}
})
const chooseCategory = (cat: string) => {
type.value = cat
if (type.value == 'oath' && curSuit.value == -1) {