From 1c744f8234f833610cbc4e6202feda21c6303150 Mon Sep 17 00:00:00 2001 From: Kokomi <592981798@qq.com> Date: Thu, 4 Aug 2022 14:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=9E=81=E7=AB=AF?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B#=E5=96=B5=E5=96=B5=E6=B7=B1?= =?UTF-8?q?=E6=B8=8A=20=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/models/Abyss.js | 16 ++++++++++++---- resources/common/tpl/avatar-card.html | 5 +++-- resources/stat/abyss-summary.html | 5 +++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/components/models/Abyss.js b/components/models/Abyss.js index bab94561..02f32b49 100644 --- a/components/models/Abyss.js +++ b/components/models/Abyss.js @@ -67,19 +67,27 @@ export default class Abyss extends Base { getAvatars () { let ret = {} lodash.forEach(this.reveral, (ds) => { - ret[ds.id] = true + if(ds.id) { + ret[ds.id] = true + } }) lodash.forEach(this.stat, (ds) => { - ret[ds.id] = true + if(ds.id) { + ret[ds.id] = true + } }) lodash.forEach(this.floors, (floor) => { let levels = floor?.levels || {} lodash.forEach(levels, (level) => { lodash.forEach(level.up?.avatars || [], (id) => { - ret[id] = true + if(id){ + ret[id] = true + } }) lodash.forEach(level.down?.avatars || [], (id) => { - ret[id] = true + if(id){ + ret[id] = true + } }) }) }) diff --git a/resources/common/tpl/avatar-card.html b/resources/common/tpl/avatar-card.html index 00a941fb..8bfc7b96 100644 --- a/resources/common/tpl/avatar-card.html +++ b/resources/common/tpl/avatar-card.html @@ -1,10 +1,11 @@ -{{set avatar = $data[0] || {} }} +{{set avatar = $data[0] || false }} {{set {_res_path} = $data[1]}} {{set weapon = avatar.weapon || {} }} {{set talentMap = ['a','e','q'] }}
+ {{if avatar}}
@@ -40,7 +41,7 @@
- + {{/if}}
diff --git a/resources/stat/abyss-summary.html b/resources/stat/abyss-summary.html index 8b6add9d..6d0e4a11 100644 --- a/resources/stat/abyss-summary.html +++ b/resources/stat/abyss-summary.html @@ -24,10 +24,11 @@
{{title}} - {{st[key]?.value}} + {{st[key]?.value || 0}}
+ {{if st[key]}} <% include(_tpl_path+'/avatar-card.html', [avatars[st[key]?.id],{_res_path}]) %> - + {{/if}}
{{/each}}