From eafd2fdff819dd3f923dc04f1bfffebb8d038b62 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Tue, 9 Dec 2025 01:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=AF=BB=E5=8F=96=E5=BC=82=E5=B8=B8=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=8D=89=E5=88=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/app/t-sidebar.vue | 6 ++ src/components/pageBag/pb-materialItem.vue | 83 +++++++++++++++++++ src/pages/common/PageBagMaterial.vue | 38 +++++++++ src/plugins/Sqlite/index.ts | 4 +- src/plugins/Sqlite/modules/userBagMaterial.ts | 7 +- src/router/modules/main.ts | 10 ++- 6 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 src/components/pageBag/pb-materialItem.vue create mode 100644 src/pages/common/PageBagMaterial.vue diff --git a/src/components/app/t-sidebar.vue b/src/components/app/t-sidebar.vue index a8c9c82c..adc8ace5 100644 --- a/src/components/app/t-sidebar.vue +++ b/src/components/app/t-sidebar.vue @@ -37,6 +37,12 @@ achievementsIcon + + + + diff --git a/src/components/pageBag/pb-materialItem.vue b/src/components/pageBag/pb-materialItem.vue new file mode 100644 index 00000000..57b65a3e --- /dev/null +++ b/src/components/pageBag/pb-materialItem.vue @@ -0,0 +1,83 @@ + + + + diff --git a/src/pages/common/PageBagMaterial.vue b/src/pages/common/PageBagMaterial.vue new file mode 100644 index 00000000..0221124b --- /dev/null +++ b/src/pages/common/PageBagMaterial.vue @@ -0,0 +1,38 @@ + + + + diff --git a/src/plugins/Sqlite/index.ts b/src/plugins/Sqlite/index.ts index 4d4a7b8f..6e3fe0f3 100644 --- a/src/plugins/Sqlite/index.ts +++ b/src/plugins/Sqlite/index.ts @@ -1,6 +1,6 @@ /** * Sqlite 数据库操作类 - * @since Beta v0.8.4 + * @since Beta v0.9.0 */ import { app } from "@tauri-apps/api"; @@ -27,6 +27,8 @@ class Sqlite { "UserAccount", "UserCharacters", "UserRecord", + // TODO: v0.9.0 进行注释移除 + // "UserBagMaterial" ]; private db: Database | null = null; private static instance: Sqlite | null = null; diff --git a/src/plugins/Sqlite/modules/userBagMaterial.ts b/src/plugins/Sqlite/modules/userBagMaterial.ts index ad24a66e..bae01c86 100644 --- a/src/plugins/Sqlite/modules/userBagMaterial.ts +++ b/src/plugins/Sqlite/modules/userBagMaterial.ts @@ -95,14 +95,15 @@ async function getMaterial( ): Promise> { const db = await TGSqlite.getDB(); let res: Array; - if (id) { + // TODO: 排序 + if (id !== undefined) { res = await db.select>( - "SELECT * FROM UserBagMaterial WHERE uid = ? AND id = ?", + "SELECT * FROM UserBagMaterial WHERE uid = ? AND id = ?;", [uid, id], ); } else { res = await db.select>( - "SELECT * FROM UserBagMaterial WHERE uid =", + "SELECT * FROM UserBagMaterial WHERE uid =?;", [uid], ); } diff --git a/src/router/modules/main.ts b/src/router/modules/main.ts index e60899d4..90c78533 100644 --- a/src/router/modules/main.ts +++ b/src/router/modules/main.ts @@ -1,7 +1,6 @@ /** - * @file router/modules/main.ts - * @description 主路由模块 - * @since Beta v0.6.3 + * 主路由模块 + * @since Beta v0.9.0 */ import type { RouteRecordRaw } from "vue-router"; @@ -36,6 +35,11 @@ const mainRoutes = ([ name: "成就", component: async () => await import("@/pages/common/PageAchi.vue"), }, + { + path: "/bag/material", + name: "背包材料", + component: async () => await import("@/pages/common/PageBagMaterial.vue"), + }, { path: "/collection", name: "收藏",