mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
🎈 perf: zzz.tool.panel 渲染可选, 不渲染时资源静默下载
This commit is contained in:
parent
ca29580286
commit
98b536d9b8
2 changed files with 11 additions and 7 deletions
|
|
@ -147,6 +147,7 @@ export class Panel extends ZZZPlugin {
|
||||||
data = undefined,
|
data = undefined,
|
||||||
needSave = true,
|
needSave = true,
|
||||||
reply = true,
|
reply = true,
|
||||||
|
needImg = true
|
||||||
} = _data;
|
} = _data;
|
||||||
if (!uid) {
|
if (!uid) {
|
||||||
await this.reply('UID为空');
|
await this.reply('UID为空');
|
||||||
|
|
@ -160,8 +161,11 @@ export class Panel extends ZZZPlugin {
|
||||||
updatePanelData(uid, [data]);
|
updatePanelData(uid, [data]);
|
||||||
}
|
}
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
if (this?.reply) {
|
const msg = '查询成功,正在下载图片资源,请稍候。'
|
||||||
this.reply('查询成功,正在下载图片资源,请稍候。');
|
if (this?.reply && needImg) {
|
||||||
|
this.reply(msg);
|
||||||
|
} else {
|
||||||
|
logger.mark(msg)
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
const parsedData = formatPanelData(data);
|
const parsedData = formatPanelData(data);
|
||||||
|
|
@ -171,9 +175,9 @@ export class Panel extends ZZZPlugin {
|
||||||
uid,
|
uid,
|
||||||
charData: parsedData,
|
charData: parsedData,
|
||||||
};
|
};
|
||||||
const image = await this.render('panel/card.html', finalData, {
|
const image = needImg ? await this.render('panel/card.html', finalData, {
|
||||||
retType: 'base64',
|
retType: 'base64',
|
||||||
});
|
}) : needImg;
|
||||||
|
|
||||||
if (reply) {
|
if (reply) {
|
||||||
const res = await this.reply(image);
|
const res = await this.reply(image);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
"1321": {
|
"1321": {
|
||||||
"sprite_id": "37",
|
"sprite_id": "37",
|
||||||
"name": "伊芙琳",
|
"name": "伊芙琳",
|
||||||
"full_name": "伊芙琳 · 舒瓦利耶",
|
"full_name": "伊芙琳·舒瓦利耶",
|
||||||
"en_name": "Evelyn"
|
"en_name": "Evelyn"
|
||||||
},
|
},
|
||||||
"2011": {
|
"2011": {
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
"1361": {
|
"1361": {
|
||||||
"sprite_id": "39",
|
"sprite_id": "39",
|
||||||
"name": "「扳机」",
|
"name": "「扳机」",
|
||||||
"full_name": "...",
|
"full_name": "「扳机」",
|
||||||
"en_name": "Trigger"
|
"en_name": "Trigger"
|
||||||
},
|
},
|
||||||
"1121": {
|
"1121": {
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
"1351": {
|
"1351": {
|
||||||
"sprite_id": "38",
|
"sprite_id": "38",
|
||||||
"name": "波可娜",
|
"name": "波可娜",
|
||||||
"full_name": "...",
|
"full_name": "波可娜·费雷尼",
|
||||||
"en_name": "Pulchra"
|
"en_name": "Pulchra"
|
||||||
},
|
},
|
||||||
"1311": {
|
"1311": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue