BIN
public/WIKI/nameCard/bg/伊安珊·不懈.webp
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
public/WIKI/nameCard/bg/成就·寂宁.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/WIKI/nameCard/bg/瓦雷莎·力源.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
public/WIKI/nameCard/bg/纪行·荣花.webp
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
public/WIKI/nameCard/bg/纳塔·眬瞳.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
public/WIKI/nameCard/icon/伊安珊·不懈.webp
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
public/WIKI/nameCard/icon/成就·寂宁.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
public/WIKI/nameCard/icon/瓦雷莎·力源.webp
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
public/WIKI/nameCard/icon/纪行·荣花.webp
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
public/WIKI/nameCard/icon/纳塔·眬瞳.webp
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
public/WIKI/nameCard/profile/伊安珊·不懈.webp
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
public/WIKI/nameCard/profile/成就·寂宁.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/WIKI/nameCard/profile/瓦雷莎·力源.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
public/WIKI/nameCard/profile/纪行·荣花.webp
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
public/WIKI/nameCard/profile/纳塔·眬瞳.webp
Normal file
|
After Width: | Height: | Size: 35 KiB |
@@ -14,7 +14,7 @@
|
||||
<span>{{ parseNameCard(props.data.desc) }}</span>
|
||||
<span>获取途径:{{ props.data.source }}</span>
|
||||
</div>
|
||||
<div class="ton-type">{{ getType }}</div>
|
||||
<div class="ton-type">{{ props.data.type }}</div>
|
||||
<v-btn
|
||||
class="ton-share"
|
||||
@click="shareNameCard"
|
||||
@@ -32,7 +32,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import showSnackbar from "@comp/func/snackbar.js";
|
||||
import { computed, ref } from "vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
import TOverlay from "./t-overlay.vue";
|
||||
|
||||
@@ -42,20 +42,7 @@ type ToNameCardProps = { data?: TGApp.App.NameCard.Item };
|
||||
|
||||
const props = defineProps<ToNameCardProps>();
|
||||
const visible = defineModel<boolean>();
|
||||
const typeMap: Record<number, string> = {
|
||||
0: "其他",
|
||||
1: "成就",
|
||||
2: "角色",
|
||||
3: "纪行",
|
||||
4: "活动",
|
||||
5: "未知",
|
||||
};
|
||||
const loading = ref<boolean>(false);
|
||||
const getType = computed<string>(() => {
|
||||
if (!props.data) return typeMap[0];
|
||||
if (!(props.data.type in typeMap)) return typeMap[5];
|
||||
return typeMap[props.data.type];
|
||||
});
|
||||
|
||||
function parseNameCard(desc: string): string {
|
||||
let array = [];
|
||||
@@ -89,7 +76,7 @@ function parseNameCard(desc: string): string {
|
||||
function parseDesc(desc: string, inQuote: boolean = false): string[] {
|
||||
let res = desc.replace(/。/g, "。\n");
|
||||
res = res.replace(/;/g, ";\n");
|
||||
if (props?.data?.index !== 187) {
|
||||
if (props?.data?.id !== 210187) {
|
||||
res = res.replace(/:/g, ":\n");
|
||||
res = res.replace(/?/g, "?\n");
|
||||
} else {
|
||||
@@ -118,7 +105,7 @@ async function shareNameCard(): Promise<void> {
|
||||
showSnackbar.error("未找到名片内容");
|
||||
return;
|
||||
}
|
||||
const fileName = `【${getType.value}名片】-${props.data?.name}`;
|
||||
const fileName = `【${props.data?.type}名片】-${props.data?.name}`;
|
||||
loading.value = true;
|
||||
await generateShareImg(fileName, nameCardBox);
|
||||
loading.value = false;
|
||||
|
||||
@@ -48,7 +48,7 @@ const sortNameCardsData = shallowRef<Array<TGApp.App.NameCard.Item>>([]);
|
||||
onMounted(() => sortData(AppNameCardsData));
|
||||
|
||||
function sortData(data: TGApp.App.NameCard.Item[]): void {
|
||||
sortNameCardsData.value = data.sort((a, b) => a.type - b.type || a.index - b.index);
|
||||
sortNameCardsData.value = data.sort((a, b) => a.type.localeCompare(b.type) || a.id - b.id);
|
||||
curIndex.value = 0;
|
||||
total.value = sortNameCardsData.value.length;
|
||||
curNameCard.value = sortNameCardsData.value[curIndex.value];
|
||||
|
||||
17
src/types/App/NameCard.d.ts
vendored
@@ -1,21 +1,20 @@
|
||||
/**
|
||||
* @file types/App/NameCard.d.ts
|
||||
* @description 本应用的名片类型定义
|
||||
* @since Beta v0.6.7
|
||||
* @since Beta v0.7.2
|
||||
*/
|
||||
|
||||
declare namespace TGApp.App.NameCard {
|
||||
/**
|
||||
* @description 名片数据
|
||||
* @since Beta v0.6.7
|
||||
* @since Beta v0.7.2
|
||||
* @interface Item
|
||||
* @property {string} name - 名片名称
|
||||
* @property {number} index - 名片索引
|
||||
* @property {string} desc - 名片描述
|
||||
* @description 0: 其他,1: 成就,2:角色,3:纪行,4:活动
|
||||
* @property {number} type - 名片类型
|
||||
* @property {string} source - 名片来源
|
||||
* @property {number} id 编号
|
||||
* @property {string} name 名称
|
||||
* @property {string} type 类型
|
||||
* @property {string} desc 描述
|
||||
* @property {string} source 来源
|
||||
* @return Item
|
||||
*/
|
||||
type Item = { name: string; index: number; desc: string; type: number; source: string };
|
||||
type Item = { id: number; name: string; type: string; desc: string; source: string };
|
||||
}
|
||||
|
||||