diff --git a/src/components/home/t-pool.vue b/src/components/home/t-pool.vue index 3220b9d3..d030f176 100644 --- a/src/components/home/t-pool.vue +++ b/src/components/home/t-pool.vue @@ -86,7 +86,7 @@ interface TPoolEmits { const emits = defineEmits(); -function poolLastInterval(postId: number): TGApp.Plugins.Mys.Gacha.RenderCard { +function poolLastInterval(postId: number): TGApp.Plugins.Mys.Gacha.RenderCard | undefined { const pool = poolCards.value.find((pool) => pool.postId === postId); if (!pool) return; if (poolTimeGet.value[postId] === "未开始") { @@ -162,7 +162,7 @@ function checkCover(data: TGApp.Plugins.Mys.Gacha.Data[]): boolean { return false; } const cover = homeStore.poolCover; - if (cover === undefined) return false; + if (cover.value === undefined) return false; let checkList = data.length; Object.entries(cover).forEach(([key, value]: [string, unknown]) => { const pool = data.find((item: TGApp.Plugins.Mys.Gacha.Data) => item.id.toString() === key); diff --git a/src/components/main/t-gamenav.vue b/src/components/main/t-gamenav.vue index 4804ffe9..8bdc2526 100644 --- a/src/components/main/t-gamenav.vue +++ b/src/components/main/t-gamenav.vue @@ -51,7 +51,7 @@ watch( ); async function loadNav(): Promise { - nav.value = await Mys.Posts.nav(props.modelValue); + nav.value = await Mys.ApiHub.homeNew(props.modelValue); } async function tryGetCode(): Promise { diff --git a/src/components/post/to-postSearch.vue b/src/components/post/to-postSearch.vue index f70e2da0..4bb5069a 100644 --- a/src/components/post/to-postSearch.vue +++ b/src/components/post/to-postSearch.vue @@ -134,7 +134,7 @@ async function searchPosts() { load.value = false; return; } - const res = await Mys.Posts.search(game.value, search.value, lastId.value); + const res = await Mys.Post.searchPosts(game.value, search.value, lastId.value); if (lastId.value === "") { results.value = res.posts; } else { diff --git a/src/components/post/tp-vote.vue b/src/components/post/tp-vote.vue index 4a205d9c..4a24a26d 100644 --- a/src/components/post/tp-vote.vue +++ b/src/components/post/tp-vote.vue @@ -55,8 +55,8 @@ const votes = ref(); onMounted(async () => { const vote = props.data.insert.vote; - const voteInfo = await Mys.Vote.get(vote.id, vote.uid); - const voteResult = await Mys.Vote.result(vote.id, vote.uid); + const voteInfo = await Mys.ApiHub.getVotes(vote.id, vote.uid); + const voteResult = await Mys.ApiHub.getVoteResult(vote.id, vote.uid); votes.value = { title: voteInfo.title, count: voteResult.user_cnt, diff --git a/src/components/post/tpo-collection.vue b/src/components/post/tpo-collection.vue index 7174e6b0..edd01150 100644 --- a/src/components/post/tpo-collection.vue +++ b/src/components/post/tpo-collection.vue @@ -99,7 +99,7 @@ watch( ); onMounted(async () => { - const collectionPosts = await Mys.PostCollect(props.collection.collection_id); + const collectionPosts = await Mys.Post.getPostFullInCollection(props.collection.collection_id); const tempArr: TpoCollectionItem[] = []; for (const postItem of collectionPosts) { const post: TpoCollectionItem = { diff --git a/src/components/postReply/tpr-main.vue b/src/components/postReply/tpr-main.vue index d8c2722f..2bd4e4d0 100644 --- a/src/components/postReply/tpr-main.vue +++ b/src/components/postReply/tpr-main.vue @@ -125,7 +125,7 @@ async function reloadReply(): Promise { async function loadReply(): Promise { loading.value = true; - const resp = await Mys.Post.reply( + const resp = await Mys.Post.getPostReplies( props.postId, props.gid, isHot.value, diff --git a/src/components/postReply/tpr-reply.vue b/src/components/postReply/tpr-reply.vue index b9776f72..2ba7957f 100644 --- a/src/components/postReply/tpr-reply.vue +++ b/src/components/postReply/tpr-reply.vue @@ -207,17 +207,14 @@ async function showReply(): Promise { async function loadSub(): Promise { loading.value = true; - const resp = await Mys.Post.replySub( + const resp = await Mys.Post.getSubReplies( props.modelValue.reply.floor_id, props.modelValue.reply.game_id, props.modelValue.reply.post_id, lastId.value, ); if ("retcode" in resp) { - showSnackbar({ - text: `[${resp.retcode}] ${resp.message}`, - color: "error", - }); + showSnackbar({ text: `[${resp.retcode}] ${resp.message}`, color: "error" }); loading.value = false; return; } @@ -225,12 +222,7 @@ async function loadSub(): Promise { lastId.value = resp.last_id; subReplies.value = subReplies.value.concat(resp.list); loading.value = false; - if (isLast.value) { - showSnackbar({ - text: "没有更多了", - color: "info", - }); - } + if (isLast.value) showSnackbar({ text: "没有更多了", color: "info" }); } async function exportData(): Promise { diff --git a/src/components/wiki/twc-character.vue b/src/components/wiki/twc-character.vue index d865de6c..fdf0b78c 100644 --- a/src/components/wiki/twc-character.vue +++ b/src/components/wiki/twc-character.vue @@ -63,9 +63,9 @@ v-for="(item, index) in data?.talks" :key="index" > - + @@ -82,12 +82,12 @@ v-for="(item, index) in data.stories" :key="index" > - - + + @@ -101,8 +101,7 @@ import { computed, onMounted, ref, watch } from "vue"; import { useRouter } from "vue-router"; import { WikiCharacterData, AppNameCardsData, AppCharacterData } from "../../data/index.js"; -import Mys from "../../plugins/Mys/index.js"; -import { createTGWindow } from "../../utils/TGWindow.js"; +import { createObc } from "../../utils/TGWindow.js"; import { parseHtmlText } from "../../utils/toolFunc.js"; import showSnackbar from "../func/snackbar.js"; import TItembox, { TItemBoxData } from "../main/t-itembox.vue"; @@ -143,10 +142,7 @@ const nameCard = ref(); async function loadData(): Promise { const res = WikiCharacterData.find((item) => item.id === props.item.id); if (res === undefined) { - showSnackbar({ - text: `未获取到角色 ${props.item.name} 的 Wiki 数据`, - color: "error", - }); + showSnackbar({ text: `未获取到角色 ${props.item.name} 的 Wiki 数据`, color: "error" }); return; } data.value = res; @@ -157,38 +153,22 @@ async function loadData(): Promise { } else { hasNc.value = false; } - showSnackbar({ - text: `成功获取角色 ${props.item.name} 的 Wiki 数据`, - color: "success", - }); + showSnackbar({ text: `成功获取角色 ${props.item.name} 的 Wiki 数据` }); } watch( () => props.item, - async () => { - await loadData(); - }, + async () => await loadData(), ); onMounted(async () => await loadData()); async function toWiki(): Promise { if (props.item.contentId === 0) { - showSnackbar({ - text: `角色 ${props.item.name} 暂无详情`, - color: "warn", - }); + showSnackbar({ text: `角色 ${props.item.name} 暂无详情`, color: "warn" }); return; } - const url = Mys.Api.Obc.replace("{contentId}", props.item.contentId.toString()); - await createTGWindow( - url, - "Sub_window", - `Content_${props.item.contentId} ${props.item.name}`, - 1200, - 800, - true, - ); + await createObc(props.item.contentId, props.item.name); } async function toBirth(date: string): Promise { diff --git a/src/components/wiki/twc-weapon.vue b/src/components/wiki/twc-weapon.vue index b87f1893..68d19540 100644 --- a/src/components/wiki/twc-weapon.vue +++ b/src/components/wiki/twc-weapon.vue @@ -54,8 +54,7 @@ import { computed, onMounted, ref, watch } from "vue"; import { WikiWeaponData } from "../../data/index.js"; -import Mys from "../../plugins/Mys/index.js"; -import { createTGWindow } from "../../utils/TGWindow.js"; +import { createObc } from "../../utils/TGWindow.js"; import { parseHtmlText } from "../../utils/toolFunc.js"; import showSnackbar from "../func/snackbar.js"; import TItembox, { TItemBoxData } from "../main/t-itembox.vue"; @@ -88,17 +87,11 @@ const selectItems = ref([]); async function loadData(): Promise { const res = WikiWeaponData.find((item) => item.id === props.item.id); if (res === undefined) { - showSnackbar({ - text: `未获取到武器 ${props.item.name} 的 Wiki 数据`, - color: "error", - }); + showSnackbar({ text: `未获取到武器 ${props.item.name} 的 Wiki 数据`, color: "error" }); return; } data.value = res; - showSnackbar({ - text: `成功获取武器 ${props.item.name} 的 Wiki 数据`, - color: "success", - }); + showSnackbar({ text: `成功获取武器 ${props.item.name} 的 Wiki 数据` }); if (data.value?.affix === undefined) return; selectItems.value = data.value?.affix.Descriptions.map((item) => item.Level) ?? []; } @@ -112,21 +105,10 @@ onMounted(async () => await loadData()); async function toWiki(): Promise { if (props.item.contentId === 0) { - showSnackbar({ - text: `武器 ${props.item.name} 暂无详情`, - color: "warn", - }); + showSnackbar({ text: `武器 ${props.item.name} 暂无详情`, color: "warn" }); return; } - const url = Mys.Api.Obc.replace("{contentId}", props.item.contentId.toString()); - await createTGWindow( - url, - "Sub_window", - `Content_${props.item.contentId} ${props.item.name}`, - 1200, - 800, - true, - ); + await createObc(props.item.contentId, props.item.name); }