♻️ 剔除武器JSON冗余数据,调整武器图鉴UI

This commit is contained in:
目棃
2024-12-31 11:30:40 +08:00
parent 3a33ca13c7
commit f0d48e866c
4 changed files with 213 additions and 1829 deletions

View File

@@ -147,7 +147,7 @@ function getBox(id: number): TItemBoxData {
height: "80px", height: "80px",
display: "inner", display: "inner",
clickable: true, clickable: true,
lt: wFind.weaponIcon, lt: `/icon/weapon/${wFind.weapon}.webp`,
ltSize: "20px", ltSize: "20px",
innerHeight: 20, innerHeight: 20,
innerText: wFind.name, innerText: wFind.name,

File diff suppressed because it is too large Load Diff

View File

@@ -45,9 +45,7 @@ const curItem = shallowRef<TGApp.App.Weapon.WikiBriefInfo>({
contentId: 0, contentId: 0,
name: "", name: "",
star: 0, star: 0,
bg: "", weapon: "",
weaponIcon: "",
icon: "",
}); });
onBeforeMount(() => { onBeforeMount(() => {
@@ -70,12 +68,9 @@ function switchW(item: TGApp.App.Weapon.WikiBriefInfo): void {
function handleSelectW(val: SelectedWValue) { function handleSelectW(val: SelectedWValue) {
showSelect.value = true; showSelect.value = true;
const reg = /\/icon\/weapon\/(.+?)\.webp/;
const filterW = AppWeaponData.filter((item) => { const filterW = AppWeaponData.filter((item) => {
if (!val.star.includes(item.star)) return false; if (!val.star.includes(item.star)) return false;
const match = item.weaponIcon.match(reg); return val.weapon.includes(item.weapon);
if (match === null) return false;
return val.weapon.includes(match[1]);
}); });
if (filterW.length === 0) { if (filterW.length === 0) {
showSnackbar.warn("未找到符合条件的武器"); showSnackbar.warn("未找到符合条件的武器");
@@ -134,7 +129,10 @@ async function toOuter(item?: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
} }
.ww-detail { .ww-detail {
position: relative;
height: calc(100vh - 40px);
max-height: 100%; max-height: 100%;
box-sizing: border-box;
flex: 1; flex: 1;
padding: 10px; padding: 10px;
border-radius: 10px; border-radius: 10px;

View File

@@ -1,21 +1,19 @@
/** /**
* @file types/App/Weapon.d.ts * @file types/App/Weapon.d.ts
* @description 本应用的武器类型定义文件 * @description 本应用的武器类型定义文件
* @since Beta v0.4.1 * @since Beta v0.6.7
*/ */
declare namespace TGApp.App.Weapon { declare namespace TGApp.App.Weapon {
/** /**
* @description Wiki页的武器简略信息 * @description Wiki页的武器简略信息
* @since Alpha v0.1.5 * @since Beta v0.6.7
* @interface WikiBriefInfo * @interface WikiBriefInfo
* @property {number} id - 武器 ID * @property {number} id - 武器 ID
* @property {number} contentId - 观测枢 id * @property {number} contentId - 观测枢 id
* @property {string} name - 武器名称 * @property {string} name - 武器名称
* @property {number} star - 武器星级 * @property {number} star - 武器星级
* @property {string} bg - 武器背景图 * @property {string} weapon - 武器类型图标
* @property {string} weaponIcon - 武器类型图标
* @property {string} icon - 武器图标
* @return WikiBriefInfo * @return WikiBriefInfo
*/ */
interface WikiBriefInfo { interface WikiBriefInfo {
@@ -23,9 +21,7 @@ declare namespace TGApp.App.Weapon {
contentId: number; contentId: number;
name: string; name: string;
star: number; star: number;
bg: string; weapon: string;
weaponIcon: string;
icon: string;
} }
/** /**