From 72ea0081d58e44fa45c94482154ebcfb1f27719d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Thu, 30 May 2024 20:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=85=BB=E6=88=90?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/model/calculator.js | 29 +++++++++++++++++++++------- plugins/genshin/model/mys/apiTool.js | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/plugins/genshin/model/calculator.js b/plugins/genshin/model/calculator.js index fc784ee..eb7902c 100644 --- a/plugins/genshin/model/calculator.js +++ b/plugins/genshin/model/calculator.js @@ -221,7 +221,7 @@ export default class Calculator extends base { skillList = skillList.filter((item) => item.max_level != 1) this.skillList = skillList - return body + return this.e.isSr ? body : { items: [body] } } async getSkillId (roleId) { @@ -244,22 +244,37 @@ export default class Calculator extends base { headers: this.headers }) 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) => { return num > 10000 ? (num / 10000).toFixed(1) + ' w' : num } if (this.e.isSr) delete computes.coin_id for (let i in computes) { - for (let j in computes[i]) { - computes[i][j].num = formart(computes[i][j].num) + 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]) { + computes[i][j].num = formart(computes[i][j].num) - if (computes[i][j][this.e.isSr ? 'item_name' : 'name'].includes('「')) { - computes[i][j].isTalent = true + if (computes[i][j].item_name.includes('「')) { + computes[i][j].isTalent = true + } + computeList[i].push(computes[i][j]) } } } - return computes + return computeList } } diff --git a/plugins/genshin/model/mys/apiTool.js b/plugins/genshin/model/mys/apiTool.js index b31ad21..cb1ee2a 100644 --- a/plugins/genshin/model/mys/apiTool.js +++ b/plugins/genshin/model/mys/apiTool.js @@ -94,7 +94,7 @@ export default class apiTool { }, /** 养成计算器 */ compute: { - url: `${host}event/e20200928calculate/v2/compute`, + url: `${host}event/e20200928calculate/v3/batch_compute`, body: data.body }, blueprintCompute: {