diff --git a/src/assets/styles/utils.scss b/src/assets/styles/utils.scss
new file mode 100644
index 00000000..a2a29d59
--- /dev/null
+++ b/src/assets/styles/utils.scss
@@ -0,0 +1,19 @@
+/**
+ * 一些功能集合
+ * @since Beta v0.9.0
+ */
+@use "sass:map";
+/** 根据传入星级返回颜色 */
+@function get-od-star-color($star:0) {
+ $star-color-map: (
+ 1:#abb2bfff,
+ 2:#98c379ff,
+ 3:#61afefff,
+ 4:#c678ddff,
+ 5:#d19a66ff
+ );
+ @if map.has-key($star-color-map, $star) {
+ @return map.get($star-color-map, $star);
+ }
+ @return #e06c75ff;
+}
diff --git a/src/components/pageBag/pb-materialItem.vue b/src/components/pageBag/pb-materialItem.vue
index 80d74207..9c78b2b1 100644
--- a/src/components/pageBag/pb-materialItem.vue
+++ b/src/components/pageBag/pb-materialItem.vue
@@ -63,6 +63,7 @@ $pb-mi-base: v-bind(idColor); /* stylelint-disable-line value-keyword-case */
display: flex;
overflow: hidden;
height: 48px;
+ box-sizing: border-box;
align-items: center;
justify-content: flex-start;
padding-right: 8px;
diff --git a/src/components/pageBag/pbo-convert-material.vue b/src/components/pageBag/pbo-convert-material.vue
new file mode 100644
index 00000000..00ffd27a
--- /dev/null
+++ b/src/components/pageBag/pbo-convert-material.vue
@@ -0,0 +1,135 @@
+
+
+
+
+
![bg]()
+
![icon]()
+
+
+ {{ props.material.name }}
+ x{{ props.material.count }}
+
+
+ {{ props.material.local }}
+
+
+
+
+
+
diff --git a/src/components/pageBag/pbo-convert.vue b/src/components/pageBag/pbo-convert.vue
new file mode 100644
index 00000000..14d2abd8
--- /dev/null
+++ b/src/components/pageBag/pbo-convert.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
diff --git a/src/components/pageBag/pbo-material.vue b/src/components/pageBag/pbo-material.vue
index 5b80c121..9d129612 100644
--- a/src/components/pageBag/pbo-material.vue
+++ b/src/components/pageBag/pbo-material.vue
@@ -11,10 +11,9 @@
![icon]()
-
{{ dbInfo.count }}
{{ props.data.info.name }}
- {{ props.data.info.type }}
+ 持有{{ dbInfo.count }}·{{ props.data.info.type }}
-
@@ -53,7 +53,6 @@
import TOverlay from "@comp/app/t-overlay.vue";
import showDialog from "@comp/func/dialog.js";
import showSnackbar from "@comp/func/snackbar.js";
-import TwoConvert from "@comp/pageWiki/two-convert.vue";
import TwoSource from "@comp/pageWiki/two-source.vue";
import TSUserBagMaterial from "@Sqlm/userBagMaterial.js";
import { getVersion } from "@tauri-apps/api/app";
@@ -61,9 +60,11 @@ import { generateShareImg } from "@utils/TGShare.js";
import { parseHtmlText, timestampToDate } from "@utils/toolFunc.js";
import { onMounted, ref, shallowRef, watch } from "vue";
+import PboConvert from "./pbo-convert.vue";
+
import type { MaterialInfo } from "@/pages/common/PageBagMaterial.vue";
-type PboMaterialProps = { data: MaterialInfo; uid: string };
+type PboMaterialProps = { data: MaterialInfo; uid: number };
type PboMaterialEmits = (e: "updateDB", v: MaterialInfo) => void;
const props = defineProps();
@@ -141,7 +142,7 @@ async function tryEdit(): Promise {
flex-direction: column;
padding: 10px;
border-radius: 10px;
- background: var(--box-bg-1);
+ background: var(--app-page-bg);
overflow-y: auto;
row-gap: 10px;
}
@@ -193,20 +194,6 @@ async function tryEdit(): Promise {
width: 56px;
height: 56px;
}
-
- .cnt {
- @include github-styles.github-tag-dark-gen(#ffcd0c);
-
- position: absolute;
- bottom: -4px;
- left: 40px;
- width: fit-content;
- padding: 0 4px;
- border-radius: 12px;
- backdrop-filter: blur(5px);
- font-size: 10px;
- text-align: center;
- }
}
.pbom-name {
@@ -234,8 +221,8 @@ async function tryEdit(): Promise {
.pbom-convert {
padding: 8px;
border-radius: 4px;
- background: var(--box-bg-2);
- color: var(--box-text-2);
+ background: var(--box-bg-1);
+ color: var(--box-text-1);
}
.pbom-desc {
@@ -268,7 +255,7 @@ async function tryEdit(): Promise {
justify-content: flex-start;
padding: 8px;
border-radius: 4px;
- background: var(--box-bg-2);
+ background: var(--box-bg-1);
row-gap: 8px;
}
diff --git a/src/pages/common/PageBagMaterial.vue b/src/pages/common/PageBagMaterial.vue
index d4862563..c9a6653f 100644
--- a/src/pages/common/PageBagMaterial.vue
+++ b/src/pages/common/PageBagMaterial.vue
@@ -84,7 +84,7 @@
v-if="curMaterial"
v-model="showOverlay"
:data="curMaterial"
- :uid="`${curUid}`"
+ :uid="curUid"
@updateDB="handleUpdate"
>
diff --git a/src/types/App/Material.d.ts b/src/types/App/Material.d.ts
index d148719f..a9dd9bd1 100644
--- a/src/types/App/Material.d.ts
+++ b/src/types/App/Material.d.ts
@@ -1,68 +1,68 @@
/**
- * @file types/App/Material.d.ts
- * @description 应用素材日历相关类型定义文件
- * @since Beta v0.4.2
+ * 应用素材日历相关类型定义文件
+ * @since Beta v0.9.0
*/
declare namespace TGApp.App.Material {
/**
- * @description wiki 页的信息
+ * WIKI信息
* @since Beta v0.4.2
- * @interface WikiItem
- * @property {number} id - 材料id
- * @property {string} name - 材料名称
- * @property {string} description - 材料简介
- * @property {string} type - 材料类型
- * @property {number} star - 材料星级
- * @property {Source[]} source - 材料来源
- * @property {Convert[]} convert - 材料转换
- * @return WikiItem
*/
- interface WikiItem {
+ type WikiItem = {
+ /** 材料ID */
id: number;
+ /** 材料名称 */
name: string;
+ /** 材料简介 */
description: string;
+ /** 材料类型 */
type: string;
+ /** 材料星级 */
star: number;
- source: Source[];
- convert: Convert[];
- }
+ /** 材料来源 */
+ source: Array;
+ /** 材料转换 */
+ convert: Array;
+ };
/**
- * @description 材料来源
+ * 材料来源
* @since Beta v0.4.4
- * @interface Source
- * @property {string} name - 来源名称
- * @property {string} type - 来源类型
- * @property {number[]} days - 来源日
- * @return Source
*/
- interface Source {
+ type Source = {
+ /** 来源名称 */
name: string;
+ /** 来源类型 */
type: string;
- days?: number[];
- }
+ /** 掉落日期 */
+ days?: Array;
+ };
/**
- * @description 材料转换
- * @since Beta v0.4.2
- * @interface Convert
- * @property {string} id 转换ID
- * @property {string} souce[].id 转换前材料ID
- * @property {string} souce[].name 转换前材料名称
- * @property {string} source[].type 转换前材料类型
- * @property {number} source[].star 转换前材料星级
- * @property {number} souce[].count 转换前材料数量
- * @return Convert
+ * 材料转换
+ * @since Beta v0.9.0
*/
- interface Convert {
+ type Convert = {
+ /** 合成ID */
id: string;
- source: Array<{
- id: string;
- name: string;
- type: string;
- star: number;
- count: number;
- }>;
- }
+ /** 合成材料 */
+ source: Array;
+ };
+
+ /**
+ * 转换来源
+ * @since Beta v0.9.0
+ */
+ type ConvertSrc = {
+ /** 材料ID */
+ id: number;
+ /** 材料名称 */
+ name: string;
+ /** 材料类型 */
+ type: string;
+ /** 材料星级 */
+ star: number;
+ /** 需要数量 */
+ count: number;
+ };
}