feat: card

This commit is contained in:
bietiaop 2024-07-09 10:30:33 +08:00
parent cd0793655d
commit ce3c509cd9
43 changed files with 508 additions and 7 deletions

View file

@ -1,4 +1,5 @@
import { element } from '../lib/convert.js';
import { getSquareAvatar } from '../lib/download.js';
import { Equip, Weapon } from './equip.js';
import { Property } from './property.js';
import { Skill } from './skill.js';
@ -194,6 +195,10 @@ export class ZZZAvatarInfo {
this.element_str = element.IDToElement(element_type);
}
async get_assets() {
const result = await getSquareAvatar(this.id);
this.square_icon = result;
}
}
/**

View file

@ -1,3 +1,5 @@
import { getSquareBangboo } from '../lib/download.js';
/**
* @class
*/
@ -19,6 +21,11 @@ export class Buddy {
this.level = level;
this.star = star;
}
async get_assets() {
const result = await getSquareBangboo(this.id);
this.square_icon = result;
}
}
/**
@ -39,6 +46,11 @@ export class Item {
this.level = level;
this.star = star;
}
async get_assets() {
const result = await getSquareBangboo(this.id);
this.square_icon = result;
}
}
/**
@ -67,4 +79,10 @@ export class ZZZBangbooResp {
this.items = items;
this.bangboo_wiki = bangboo_wiki;
}
async get_assets() {
for (const item of this.items) {
await item.get_assets();
}
}
}

View file

@ -46,4 +46,13 @@ export class ZZZIndexResp {
this.cur_head_icon_url = cur_head_icon_url;
this.buddy_list = buddy_list.map(item => new Buddy(item));
}
async get_assets() {
for (const avatar of this.avatar_list) {
await avatar.get_assets();
}
for (const buddy of this.buddy_list) {
await buddy.get_assets();
}
}
}