mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-11 09:08:14 +08:00
♻️ 帖子显示版块信息
This commit is contained in:
@@ -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<ToChannelProps>(), {
|
||||
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;
|
||||
|
||||
@@ -15,31 +15,32 @@
|
||||
</div>
|
||||
<div class="tp-post-meta">
|
||||
<div class="mpm-forum" v-if="postData.forum">
|
||||
<img :src="getGameIcon(postData.forum.game_id)" alt="gameIcon" />
|
||||
<img :src="postData.forum.icon" alt="forumIcon" />
|
||||
<span>{{ postData.forum.name }}</span>
|
||||
</div>
|
||||
<div class="mpm-item" :title="`浏览数:${postData.stat.view_num}`">
|
||||
<div class="mpm-item" :title="`浏览数:${postData?.stat?.view_num}`">
|
||||
<v-icon>mdi-eye</v-icon>
|
||||
<span>{{ postData.stat.view_num }}</span>
|
||||
<span>{{ postData?.stat?.view_num }}</span>
|
||||
</div>
|
||||
<div class="mpm-item" :title="`收藏数:${postData.stat.bookmark_num}`">
|
||||
<div class="mpm-item" :title="`收藏数:${postData?.stat?.bookmark_num}`">
|
||||
<v-icon>mdi-star</v-icon>
|
||||
<span>{{ postData.stat.bookmark_num }}</span>
|
||||
<span>{{ postData?.stat?.bookmark_num }}</span>
|
||||
</div>
|
||||
<div class="mpm-item" :title="`回复数:${postData.stat.reply_num}`">
|
||||
<div class="mpm-item" :title="`回复数:${postData?.stat?.reply_num}`">
|
||||
<v-icon>mdi-comment</v-icon>
|
||||
<span>{{ postData.stat.reply_num }}</span>
|
||||
<span>{{ postData?.stat?.reply_num }}</span>
|
||||
</div>
|
||||
<div class="mpm-item" :title="`点赞数:${postData.stat.like_num}`">
|
||||
<div class="mpm-item" :title="`点赞数:${postData?.stat?.like_num}`">
|
||||
<v-icon>mdi-thumb-up</v-icon>
|
||||
<span>{{ postData.stat.like_num }}</span>
|
||||
<span>{{ postData?.stat?.like_num }}</span>
|
||||
</div>
|
||||
<div class="mpm-item" :title="`转发数:${postData.stat.forward_num}`">
|
||||
<div class="mpm-item" :title="`转发数:${postData?.stat?.forward_num}`">
|
||||
<v-icon>mdi-share-variant</v-icon>
|
||||
<span>{{ postData.stat.forward_num }}</span>
|
||||
<span>{{ postData?.stat?.forward_num }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<TpAvatar :data="postData.user" position="right" />
|
||||
<TpAvatar :data="postData.user" position="right" v-if="postData.user" />
|
||||
</div>
|
||||
<div class="tp-post-title" @click="toPost()" title="点击查看评论">
|
||||
<span class="mpt-official" v-if="postData.post.post_status.is_official">官</span>
|
||||
@@ -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<boolean>(true);
|
||||
@@ -122,6 +124,12 @@ const shareTimeTimer = ref<any>();
|
||||
// 合集
|
||||
const showCollection = ref<boolean>(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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<ToChannelItem>}
|
||||
*/
|
||||
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",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user