From ce05d584bd9b8e2d36a24853f06692f906981350 Mon Sep 17 00:00:00 2001 From: ChicorSun <125846596+ChicorSun@users.noreply.github.com> Date: Thu, 1 Jun 2023 21:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=9F=E9=93=81=E4=BD=93?= =?UTF-8?q?=E5=8A=9B=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A2=84=E8=AE=A1=E4=BD=93=E5=8A=9B=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=97=B6=E5=88=BB=20(#155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/model/note.js | 14 ++++++++++++++ .../StarRail/html/dailyNote/dailyNote.html | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/model/note.js b/plugins/genshin/model/note.js index 33e4696..3664249 100644 --- a/plugins/genshin/model/note.js +++ b/plugins/genshin/model/note.js @@ -69,6 +69,20 @@ export default class Note extends base { } else if (seconds > 0) { resinMaxTime = seconds + '秒' } + if ((day > 0) || (hours > 0) || (seconds > 0)) { + let total_seconds = 3600*hours + 60*minutes + seconds + const now = new Date() + const dateTimes = now.getTime() + total_seconds * 1000 + const date = new Date(dateTimes) + const dayDiff = date.getDate() - now.getDate() + const str = dayDiff === 0 ? '今日' : '明日' + const timeStr = `${date.getHours().toString().padStart(2, '0')}:${date + .getMinutes() + .toString() + .padStart(2, '0')}` + let recoverTimeStr = ` | [${str}]${timeStr}` + resinMaxTime += recoverTimeStr + } } data.bfStamina = data.current_stamina / data.max_stamina * 100 + '%' /** 派遣 */ diff --git a/plugins/genshin/resources/StarRail/html/dailyNote/dailyNote.html b/plugins/genshin/resources/StarRail/html/dailyNote/dailyNote.html index 2450081..20b87b7 100644 --- a/plugins/genshin/resources/StarRail/html/dailyNote/dailyNote.html +++ b/plugins/genshin/resources/StarRail/html/dailyNote/dailyNote.html @@ -31,7 +31,7 @@
{{if stamina_recover_time>0}} - 剩余恢复时间:{{resinMaxTime}} + 剩余:{{resinMaxTime}} {{else}} 开拓力已完全恢复 {{/if}} @@ -69,4 +69,4 @@
- \ No newline at end of file +