diff --git a/src/components/overlay/to-channel.vue b/src/components/overlay/to-channel.vue index 60414e2b..80995c6e 100644 --- a/src/components/overlay/to-channel.vue +++ b/src/components/overlay/to-channel.vue @@ -30,6 +30,8 @@ import { computed } from "vue"; import { useRouter } from "vue-router"; import { useAppStore } from "../../store/modules/app.js"; +import { ToChannelItem } from "../../web/constant/bbs.js"; +import TGConstant from "../../web/constant/TGConstant.js"; import showSnackbar from "../func/snackbar.js"; import TOverlay from "../main/t-overlay.vue"; @@ -41,12 +43,6 @@ interface ToChannelProps { type ToChannelEmits = (e: "update:modelValue", value: boolean) => void; -interface ToChannelItem { - title: string; - icon: string; - gid: string; -} - const props = withDefaults(defineProps(), { modelValue: false, }); @@ -60,44 +56,7 @@ const visible = computed({ }); const router = useRouter(); const appStore = useAppStore(); - -const channelList: ToChannelItem[] = [ - { - title: "原神", - icon: "/platforms/mhy/ys.webp", - gid: "2", - }, - { - title: "崩坏:星穹铁道", - icon: "/platforms/mhy/sr.webp", - gid: "6", - }, - { - title: "绝区零", - icon: "/platforms/mhy/zzz.webp", - gid: "8", - }, - { - title: "崩坏3", - icon: "/platforms/mhy/bh3.webp", - gid: "1", - }, - { - title: "崩坏2", - icon: "/platforms/mhy/bh2.webp", - gid: "3", - }, - { - title: "未定事件簿", - icon: "/platforms/mhy/wd.webp", - gid: "4", - }, - { - title: "大别野", - icon: "/platforms/mhy/dby.webp", - gid: "5", - }, -]; +const channelList = TGConstant.BBS.CHANNELS; function onCancel(): void { visible.value = false; diff --git a/src/views/t-post.vue b/src/views/t-post.vue index daf4ced6..d93a01a5 100644 --- a/src/views/t-post.vue +++ b/src/views/t-post.vue @@ -15,31 +15,32 @@
+ gameIcon forumIcon {{ postData.forum.name }}
-
+
mdi-eye - {{ postData.stat.view_num }} + {{ postData?.stat?.view_num }}
-
+
mdi-star - {{ postData.stat.bookmark_num }} + {{ postData?.stat?.bookmark_num }}
-
+
mdi-comment - {{ postData.stat.reply_num }} + {{ postData?.stat?.reply_num }}
-
+
mdi-thumb-up - {{ postData.stat.like_num }} + {{ postData?.stat?.like_num }}
-
+
mdi-share-variant - {{ postData.stat.forward_num }} + {{ postData?.stat?.forward_num }}
- +
@@ -98,6 +99,7 @@ import { useAppStore } from "../store/modules/app.js"; import TGClient from "../utils/TGClient.js"; import TGLogger from "../utils/TGLogger.js"; import { createTGWindow } from "../utils/TGWindow.js"; +import TGConstant from "../web/constant/TGConstant.js"; // loading const loading = ref(true); @@ -122,6 +124,12 @@ const shareTimeTimer = ref(); // 合集 const showCollection = ref(false); +function getGameIcon(gameId: number): string { + const find = TGConstant.BBS.CHANNELS.find((item) => item.gid === gameId.toString()); + if (find) return find.icon; + return "/platforms/mhy/mys.webp"; +} + onMounted(async () => { appVersion.value = await app.getVersion(); // 检查数据 @@ -357,6 +365,11 @@ onUnmounted(() => { object-fit: cover; } +.mpm-forum img:first-child { + border-radius: 5px; + margin-right: 5px; +} + .mpm-forum span { overflow: hidden; text-overflow: ellipsis; diff --git a/src/web/constant/TGConstant.ts b/src/web/constant/TGConstant.ts index 7f2a6abe..c9e8e31c 100644 --- a/src/web/constant/TGConstant.ts +++ b/src/web/constant/TGConstant.ts @@ -1,10 +1,17 @@ /** * @file web/constant/TGConstant.ts * @description 常量 - * @since Beta v0.3.6 + * @since Beta v0.5.1 */ -import { BBS_APP_ID, BBS_SALT, BBS_UA_MOBILE, BBS_UA_PC, BBS_VERSION } from "./bbs.js"; +import { + BBS_APP_ID, + BBS_SALT, + BBS_UA_MOBILE, + BBS_UA_PC, + BBS_VERSION, + CHANNEL_LIST, +} from "./bbs.js"; import SERVER from "./server.js"; import { GAME_BIZ } from "./utils.js"; @@ -14,6 +21,7 @@ const TGConstant = { UA_PC: BBS_UA_PC, UA_MOBILE: BBS_UA_MOBILE, APP_ID: BBS_APP_ID, + CHANNELS: CHANNEL_LIST, }, Salt: BBS_SALT, Server: SERVER, diff --git a/src/web/constant/bbs.ts b/src/web/constant/bbs.ts index ff6564a9..fc0a1690 100644 --- a/src/web/constant/bbs.ts +++ b/src/web/constant/bbs.ts @@ -1,7 +1,7 @@ /** * @file web/constant/bbs.ts * @description 常量-应用数据 - * @since Beta v0.5.0 + * @since Beta v0.5.1 */ export const BBS_VERSION = "2.72.2"; @@ -21,3 +21,63 @@ export const BBS_SALT = { X6: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v", PROD: "t0qEgfub6cvueAPgR5m9aQWWVciEer7v", }; + +/** + * @description 频道列表 + * @version 2.72.2 + * @since Beta v0.5.1 + * @interface ToChannelItem + * @property {string} title - 频道名称 + * @property {string} icon - 频道图标 + * @property {string} gid - 频道 gid + * @return ToChannelItem + */ +export interface ToChannelItem { + title: string; + icon: string; + gid: string; +} + +/** + * @description 渠道列表 + * @version 2.72.2 + * @since Beta v0.5.1 + * @type {Array} + */ +export const CHANNEL_LIST: ToChannelItem[] = [ + { + title: "原神", + icon: "/platforms/mhy/ys.webp", + gid: "2", + }, + { + title: "崩坏:星穹铁道", + icon: "/platforms/mhy/sr.webp", + gid: "6", + }, + { + title: "绝区零", + icon: "/platforms/mhy/zzz.webp", + gid: "8", + }, + { + title: "崩坏3", + icon: "/platforms/mhy/bh3.webp", + gid: "1", + }, + { + title: "崩坏2", + icon: "/platforms/mhy/bh2.webp", + gid: "3", + }, + { + title: "未定事件簿", + icon: "/platforms/mhy/wd.webp", + gid: "4", + }, + { + title: "大别野", + icon: "/platforms/mhy/dby.webp", + gid: "5", + }, +];