@@ -27,8 +27,8 @@ export default defineRequest((request) => {
|
||||
const res = await request.post(`/skillTree/`, { code })
|
||||
return res.data
|
||||
},
|
||||
async getOathInfo(suitId: string, skillId: string, rarity: string) {
|
||||
const res = await request.get(`/info/oath/${suitId}/${skillId}`, { params: { rarity } })
|
||||
async getOathInfo(suitId: string, skillId: string, rarity: string, lv: number) {
|
||||
const res = await request.get(`/info/oath/${suitId}/${skillId}`, { params: { rarity, lv } })
|
||||
return res.data
|
||||
},
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ const curOathInfo = computed(() => {
|
||||
return infoStore.oathSkills?.[curEquInfo.value?.suit[0]]
|
||||
})
|
||||
|
||||
const curOathSkillLvs = asyncComputed(async () => {
|
||||
const curOathSkillInfo = asyncComputed(async () => {
|
||||
if (!curOathInfo.value || !curEquInfo.value?.suit[0]) {
|
||||
return undefined
|
||||
}
|
||||
@@ -349,23 +349,24 @@ const curOathSkillLvs = asyncComputed(async () => {
|
||||
curEquInfo.value?.suit[0],
|
||||
oathSkillId.value,
|
||||
curOathSkillLv.value.rarity,
|
||||
curOathSkillLv.value.lv,
|
||||
)
|
||||
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 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
|
||||
|
||||
@@ -13,6 +13,7 @@ export const useInfoStore = defineStore('infoStore', () => {
|
||||
suitId: string
|
||||
skillId: string
|
||||
rarity: string
|
||||
lv: number
|
||||
data: ISuit
|
||||
}[]
|
||||
>([])
|
||||
@@ -54,17 +55,17 @@ export const useInfoStore = defineStore('infoStore', () => {
|
||||
return result
|
||||
})
|
||||
|
||||
const getOathInfo = async (suitId: string, skillId: string, rarity: string) => {
|
||||
const getOathInfo = async (suitId: string, skillId: string, rarity: string, lv: number) => {
|
||||
const res = oathCache.value.find(
|
||||
(o) => o.suitId === suitId && o.skillId === skillId && o.rarity === rarity,
|
||||
(o) => o.suitId === suitId && o.skillId === skillId && o.rarity === rarity && o.lv === lv,
|
||||
)
|
||||
if (res) {
|
||||
return {
|
||||
...res.data,
|
||||
}
|
||||
}
|
||||
const data: ISuit = await api.getOathInfo(suitId, skillId, rarity)
|
||||
oathCache.value.push({ suitId, skillId, rarity, data })
|
||||
const data: ISuit = await api.getOathInfo(suitId, skillId, rarity, lv)
|
||||
oathCache.value.push({ suitId, skillId, rarity, lv, data })
|
||||
return {
|
||||
...data,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user