+
{{ item.raw.text }}
@@ -116,8 +125,7 @@ import { useRoute } from "vue-router";
import TGLogger from "@/utils/TGLogger.js";
import { createPost } from "@/utils/TGWindow.js";
-import { getGameName } from "@/utils/toolFunc.js";
-import { CHANNEL_LIST } from "@/web/constant/bbs.js";
+import { getGameIcon, getGameName } from "@/utils/toolFunc.js";
import ApiHubReq from "@/web/request/apiHubReq.js";
type SortSelect = { text: string; value: number; icon: string };
@@ -187,10 +195,9 @@ async function loadForums(): Promise
{
const allForums = await ApiHubReq.forum();
const gameList: Array = [];
for (const gameForum of allForums) {
- const miniFind = CHANNEL_LIST.find((i) => i.gid === gameForum.game_id.toString())?.mini;
const gameItem: SortSelectGame = {
gid: gameForum.game_id,
- icon: miniFind ? `/platforms/mhy/${miniFind}.webp` : undefined,
+ icon: getGameIcon(gameForum.game_id),
forum: gameForum.forums
.sort((a, b) => a.order - b.order)
.map((i) => ({ text: i.name, value: i.id, icon: i.icon_pure })),
@@ -388,9 +395,12 @@ function searchPost(): void {
font-size: 16px;
&:hover {
- border-radius: 5px;
background: var(--common-shadow-2);
}
+
+ &.selected:not(:hover) {
+ background: var(--common-shadow-1);
+ }
}
.icon {
diff --git a/src/pages/common/PostTopic.vue b/src/pages/common/PostTopic.vue
index 0e3b20bd..67baa49a 100644
--- a/src/pages/common/PostTopic.vue
+++ b/src/pages/common/PostTopic.vue
@@ -21,7 +21,32 @@
:item-value="(item) => item"
variant="outlined"
label="分区"
- />
+ >
+
+
+
![]()
+
{{ item.raw.name }}
+
+
+
+
+
![]()
+
{{ item.raw.name }}
+
+
+
diff --git a/src/utils/toolFunc.ts b/src/utils/toolFunc.ts
index 1cee35bc..53d7d6d6 100644
--- a/src/utils/toolFunc.ts
+++ b/src/utils/toolFunc.ts
@@ -295,6 +295,17 @@ export function getGameId(mini: string): string {
return game ? game.gid : "0";
}
+/**
+ * @description 根据id获取游戏图标
+ * @since Beta v0.6.8
+ * @param {number|string} gid
+ * @returns {string|undefined}
+ */
+export function getGameIcon(gid: number | string): string | undefined {
+ const game = TGConstant.BBS.CHANNELS.find((item) => item.gid === gid.toString());
+ return game ? game.icon : undefined;
+}
+
/**
* @description 根据id获取对应角色/武器数据
* @since Beta v0.6.8