mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 09:27:34 +00:00
修复#圣遗物列表功能
This commit is contained in:
parent
12bd03330a
commit
9a8b17b9a4
@ -61,12 +61,12 @@ export async function profileArtisList(e, { render }) {
|
|||||||
|
|
||||||
let usefulMark;
|
let usefulMark;
|
||||||
|
|
||||||
let charCfg = Reliquaries2.getCharCfg(name);
|
let charCfg = Artifact.getCharCfg(name);
|
||||||
usefulMark = charCfg.titleWeight;
|
usefulMark = charCfg.titleWeight;
|
||||||
|
|
||||||
/* 处理圣遗物 */
|
/* 处理圣遗物 */
|
||||||
if (ds.artis) {
|
if (ds.artis) {
|
||||||
let newScore = Reliquaries2.getArtisMark(name, ds.artis);
|
let newScore = Artifact.getArtisMark(name, ds.artis);
|
||||||
|
|
||||||
lodash.forEach(ds.artis, (arti, idx) => {
|
lodash.forEach(ds.artis, (arti, idx) => {
|
||||||
if (!arti.name) {
|
if (!arti.name) {
|
||||||
@ -74,12 +74,12 @@ export async function profileArtisList(e, { render }) {
|
|||||||
}
|
}
|
||||||
idx = idx.replace("arti", "");
|
idx = idx.replace("arti", "");
|
||||||
let mark = newScore[idx];
|
let mark = newScore[idx];
|
||||||
let maxMark = Reliquaries.getMaxMark(name, arti.main[0] || "");
|
let maxMark = Artifact.getMaxMark(name, arti.main[0] || "");
|
||||||
arti.mark = Format.comma(mark, 1);
|
arti.mark = Format.comma(mark, 1);
|
||||||
arti._mark = mark;
|
arti._mark = mark;
|
||||||
arti.markClass = Reliquaries2.getMarkClass(mark);
|
arti.markClass = Artifact.getMarkClass(mark);
|
||||||
arti.main = Profile.formatArti(arti.main);
|
arti.main = Artifact.formatArti(arti.main);
|
||||||
arti.attrs = Profile.formatArti(arti.attrs);
|
arti.attrs = Artifact.formatArti(arti.attrs);
|
||||||
arti.usefulMark = usefulMark;
|
arti.usefulMark = usefulMark;
|
||||||
arti.avatar = name;
|
arti.avatar = name;
|
||||||
artis.push(arti);
|
artis.push(arti);
|
||||||
|
2
index.js
2
index.js
@ -39,7 +39,7 @@ let rule = {
|
|||||||
//reg: "noCheck",
|
//reg: "noCheck",
|
||||||
describe: "【#角色】角色详情",
|
describe: "【#角色】角色详情",
|
||||||
},
|
},
|
||||||
getArtis: {
|
profileArtisList: {
|
||||||
reg: "^#圣遗物列表\\s*(\\d{9})?$",
|
reg: "^#圣遗物列表\\s*(\\d{9})?$",
|
||||||
describe: "【#角色】圣遗物列表",
|
describe: "【#角色】圣遗物列表",
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
{{each artis ds}}
|
{{each artis ds}}
|
||||||
<div class="item arti">
|
<div class="item arti">
|
||||||
{{if ds && ds.name && ds.main && ds.main[0] && ds.main[0]!="undefined"}}
|
{{if ds && ds.name && ds.main && ds.main.title && ds.main.title!="undefined"}}
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img src="{{_res_path}}meta/character/{{ds.avatar}}/side.png" onerror="whenError(this)"/>
|
<img src="{{_res_path}}meta/character/{{ds.avatar}}/side.png" onerror="whenError(this)"/>
|
||||||
</div>
|
</div>
|
||||||
@ -23,12 +23,13 @@
|
|||||||
<strong>{{ds.name}}</strong>
|
<strong>{{ds.name}}</strong>
|
||||||
<span class="mark mark-{{ds.markClass}}"><span>{{ds.mark}}分</span> - {{ds.markClass}}</span>
|
<span class="mark mark-{{ds.markClass}}"><span>{{ds.mark}}分</span> - {{ds.markClass}}</span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="detail">
|
<ul class="detail attr">
|
||||||
<li class="arti-main"><span class="title">{{ds.main[0]}}</span><span class="val">+{{ds.main[1]}}</span></li>
|
<li class="arti-main"><span class="title">{{ds.main.title}}</span><span class="val">+{{ds.main.val}}</span></li>
|
||||||
{{each ds.attrs attr}}
|
{{each ds.attrs attr}}
|
||||||
{{if attr[0]}}
|
{{if attr.title}}
|
||||||
<li class="{{ds.usefulMark[attr[0]]*1 > 79.9 ?`great`:(ds.usefulMark[attr[0]]*1>0 ? `useful`:`nouse`)}}"><span class="title">{{attr[0]}}</span><span
|
<li class="{{ds.usefulMark[attr.title]*1 > 79.9 ?`great`:(ds.usefulMark[attr.title]*1>0 ? `useful`:`nouse`)}}">
|
||||||
class="val">+{{attr[1]}}</span></li>
|
<span class="title">{{attr.title}}</span><span
|
||||||
|
class="val">+{{attr.val}}</span></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user