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: "收藏",