修复 养成计算

This commit is contained in:
🌌 2024-05-30 20:45:15 +08:00
parent ff5a711390
commit 72ea0081d5
2 changed files with 23 additions and 8 deletions

View File

@ -221,7 +221,7 @@ export default class Calculator extends base {
skillList = skillList.filter((item) => item.max_level != 1) skillList = skillList.filter((item) => item.max_level != 1)
this.skillList = skillList this.skillList = skillList
return body return this.e.isSr ? body : { items: [body] }
} }
async getSkillId (roleId) { async getSkillId (roleId) {
@ -244,22 +244,37 @@ export default class Calculator extends base {
headers: this.headers headers: this.headers
}) })
if (!computes || computes.retcode !== 0) return false if (!computes || computes.retcode !== 0) return false
computes = computes.data computes = this.e.isSr ? computes.data : computes.data.overall_material_consume
let computeList = {}
let formart = (num) => { let formart = (num) => {
return num > 10000 ? (num / 10000).toFixed(1) + ' w' : num return num > 10000 ? (num / 10000).toFixed(1) + ' w' : num
} }
if (this.e.isSr) delete computes.coin_id if (this.e.isSr) delete computes.coin_id
for (let i in computes) { for (let i in computes) {
computeList[i] = []
if (!this.e.isSr) {
computes[i].forEach(({ consume }) => {
consume.forEach(val => {
computeList[i].push(val)
val.num = formart(val.num)
if (val.name.includes('「')) {
val.isTalent = true
}
})
})
} else {
for (let j in computes[i]) { for (let j in computes[i]) {
computes[i][j].num = formart(computes[i][j].num) computes[i][j].num = formart(computes[i][j].num)
if (computes[i][j][this.e.isSr ? 'item_name' : 'name'].includes('「')) { if (computes[i][j].item_name.includes('「')) {
computes[i][j].isTalent = true computes[i][j].isTalent = true
} }
computeList[i].push(computes[i][j])
}
} }
} }
return computes return computeList
} }
} }

View File

@ -94,7 +94,7 @@ export default class apiTool {
}, },
/** 养成计算器 */ /** 养成计算器 */
compute: { compute: {
url: `${host}event/e20200928calculate/v2/compute`, url: `${host}event/e20200928calculate/v3/batch_compute`,
body: data.body body: data.body
}, },
blueprintCompute: { blueprintCompute: {