🎨 子窗口缩减为两个label Sub_window 和 Dev_JSON

This commit is contained in:
BTMuli
2023-09-16 14:29:05 +08:00
parent d3eb5b7ab0
commit 0a9f3d2483
11 changed files with 54 additions and 26 deletions

View File

@@ -175,7 +175,7 @@ async function toOuter(url: string, title: string): Promise<void> {
showBar.value = true; showBar.value = true;
return; return;
} }
createTGWindow(url, "祈愿", title, 1200, 800, true, true); createTGWindow(url, "Sub_window", `Pool_${title}`, 1200, 800, true, true);
} }
function toPost(pool: TGApp.Plugins.Mys.Gacha.RenderCard): void { function toPost(pool: TGApp.Plugins.Mys.Gacha.RenderCard): void {
@@ -185,7 +185,7 @@ function toPost(pool: TGApp.Plugins.Mys.Gacha.RenderCard): void {
post_id: pool.postId.toString(), post_id: pool.postId.toString(),
}, },
}).href; }).href;
createTGWindow(path, "限时祈愿", pool.title, 960, 720, false, false); createTGWindow(path, "Sub_window", `Post_${pool.postId} ${pool.title}`, 960, 720, false, false);
} }
onUnmounted(() => { onUnmounted(() => {

View File

@@ -116,7 +116,7 @@ async function toPost(card: TGApp.Plugins.Mys.Position.RenderCard): Promise<void
}, },
}).href; }).href;
// 打开新窗口 // 打开新窗口
createTGWindow(path, "近期活动", card.title, 960, 720, false, false); createTGWindow(path, "Sub_window", `Post_${card.postId} ${card.title}`, 960, 720, false, false);
} }
onUnmounted(() => { onUnmounted(() => {

View File

@@ -84,7 +84,7 @@ function toDetail(item: TGApp.App.Calendar.Item): void {
return; return;
} }
const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString()); const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString());
createTGWindow(url, "素材详情", item.name, 1200, 800, true); createTGWindow(url, "Sub_window", `Content_${item.contentId} ${item.name}`, 1200, 800, true);
} }
</script> </script>
<style scoped> <style scoped>

View File

@@ -28,7 +28,7 @@ function toOuter(item: TGApp.App.Character.WikiBriefInfo): void {
return; return;
} }
const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString()); const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString());
createTGWindow(url, "角色详情", item.name, 1200, 800, true); createTGWindow(url, "Sub_window", `Content_${item.contentId} ${item.name}`, 1200, 800, true);
} }
</script> </script>
<style scoped> <style scoped>

View File

@@ -146,7 +146,7 @@ function toOuter(cardName: string, cardId: number): void {
return; return;
} }
const url = Mys.Api.Obc.replace("{contentId}", cardId.toString()); const url = Mys.Api.Obc.replace("{contentId}", cardId.toString());
createTGWindow(url, "GCG", cardName, 1200, 800, true); createTGWindow(url, "Sub_window", `Content_${cardId} ${cardName}`, 1200, 800, true);
} }
async function searchCard(): Promise<void> { async function searchCard(): Promise<void> {

View File

@@ -28,7 +28,7 @@ function toOuter(item: TGApp.App.Weapon.WikiBriefInfo): void {
return; return;
} }
const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString()); const url = Mys.Api.Obc.replace("{contentId}", item.contentId.toString());
createTGWindow(url, "武器详情", item.name, 1200, 800, true); createTGWindow(url, "Sub_window", `Content_${item.contentId} ${item.name}`, 1200, 800, true);
} }
</script> </script>
<style scoped> <style scoped>

View File

@@ -231,7 +231,14 @@ async function selectSeries(index: number): Promise<void> {
// 打开图片 // 打开图片
function openImg(): void { function openImg(): void {
createTGWindow(getCardImg.value.profile, "nameCard", getCardInfo.value.name, 840, 400, false); createTGWindow(
getCardImg.value.profile,
"Sub_window",
`Namecard_${getCardInfo.value.name}`,
840,
400,
false,
);
} }
async function searchCard(): Promise<void> { async function searchCard(): Promise<void> {

View File

@@ -32,7 +32,12 @@
{{ item.startTime.split(" ")[0] }}~{{ item.endTime.split(" ")[0] }} {{ item.startTime.split(" ")[0] }}~{{ item.endTime.split(" ")[0] }}
</v-card-subtitle> </v-card-subtitle>
<v-card-subtitle v-show="appStore.devMode"> id: {{ item.id }} </v-card-subtitle> <v-card-subtitle v-show="appStore.devMode"> id: {{ item.id }} </v-card-subtitle>
<v-btn v-show="appStore.devMode" class="anno-dev-btn" @click="toJson(item)"> <v-btn
v-show="appStore.devMode"
variant="outlined"
class="anno-dev-btn"
@click="toJson(item)"
>
<img src="../../assets/icons/arrow-right.svg" alt="right" /> <img src="../../assets/icons/arrow-right.svg" alt="right" />
<span>查看数据</span> <span>查看数据</span>
</v-btn> </v-btn>
@@ -58,7 +63,12 @@
{{ item.startTime.split(" ")[0] }}~{{ item.endTime.split(" ")[0] }} {{ item.startTime.split(" ")[0] }}~{{ item.endTime.split(" ")[0] }}
</v-card-subtitle> </v-card-subtitle>
<v-card-subtitle v-show="appStore.devMode"> id: {{ item.id }} </v-card-subtitle> <v-card-subtitle v-show="appStore.devMode"> id: {{ item.id }} </v-card-subtitle>
<v-btn v-show="appStore.devMode" class="anno-dev-btn" @click="toJson(item)"> <v-btn
v-show="appStore.devMode"
variant="outlined"
class="anno-dev-btn"
@click="toJson(item)"
>
<img src="../../assets/icons/arrow-right.svg" alt="right" /> <img src="../../assets/icons/arrow-right.svg" alt="right" />
<span>查看数据</span> <span>查看数据</span>
</v-btn> </v-btn>
@@ -128,7 +138,7 @@ async function toPost(item: TGApp.App.Announcement.ListCard): Promise<void> {
anno_id: item.id, anno_id: item.id,
}, },
}).href; }).href;
createTGWindow(path, "游戏内公告", item.title, 960, 720, false, false); createTGWindow(path, "Sub_window", `Anno_${item.id} ${item.title}`, 960, 720, false, false);
} }
async function toJson(item: TGApp.App.Announcement.ListCard): Promise<void> { async function toJson(item: TGApp.App.Announcement.ListCard): Promise<void> {
@@ -138,7 +148,7 @@ async function toJson(item: TGApp.App.Announcement.ListCard): Promise<void> {
anno_id: item.id, anno_id: item.id,
}, },
}).href; }).href;
createTGWindow(path, "游戏内公告-JSON", item.title, 960, 720, false, false); createTGWindow(path, "Dev_JSON", `Anno_${item.id}_JSON ${item.title}`, 960, 720, false, false);
} }
</script> </script>
@@ -216,18 +226,19 @@ async function toJson(item: TGApp.App.Announcement.ListCard): Promise<void> {
} }
.anno-dev-btn { .anno-dev-btn {
background: var(--box-bg-t-1); border: 1px solid var(--common-shadow-4);
color: var(--btn-text); border-radius: 5px;
margin-left: auto;
font-family: var(--font-title); font-family: var(--font-title);
} }
.anno-dev-btn img { .anno-dev-btn img {
width: 20px; width: 20px;
height: 20px; height: 20px;
padding: 2px; padding: 3px;
border-radius: 50%; border-radius: 50%;
margin-right: 5px; margin-right: 5px;
background: var(--common-shadow-t-4); background: var(--common-shadow-4);
object-fit: cover; object-fit: cover;
} }
</style> </style>

View File

@@ -1,4 +1,5 @@
<!-- eslint-disable vue/no-v-html --> <!-- eslint-disable vue/no-v-html -->
<!-- todo 优化显示样式 -->
<template> <template>
<TSwitchTheme /> <TSwitchTheme />
<TShareBtn <TShareBtn
@@ -66,14 +67,14 @@ onMounted(async () => {
loadingTitle.value = "正在渲染数据..."; loadingTitle.value = "正在渲染数据...";
annoHtml.value = await TGUtils.Anno.parseContent(annoData.value.content); annoHtml.value = await TGUtils.Anno.parseContent(annoData.value.content);
if (annoData.value.banner !== "") annoBanner.value = await saveImgLocal(annoData.value.banner); if (annoData.value.banner !== "") annoBanner.value = await saveImgLocal(annoData.value.banner);
annoTitle.value = `【公告】${annoId}-${annoData.value.title}`; annoTitle.value = `Anno_${annoId}`;
await appWindow.setTitle(annoTitle.value); await appWindow.setTitle(`Anno_${annoId} ${annoData.value.title}`);
annoRef.value = <HTMLElement>document.querySelector(".anno-body"); annoRef.value = <HTMLElement>document.querySelector(".anno-body");
} catch (error) { } catch (error) {
console.error(error); console.error(error);
loadingEmpty.value = true; loadingEmpty.value = true;
loadingTitle.value = "公告不存在或解析失败"; loadingTitle.value = "公告不存在或解析失败";
await appWindow.setTitle(`【公告】${annoId}-公告不存在或解析失败`); await appWindow.setTitle(`Anno_${annoId} Parsing Error`);
return; return;
} }
setTimeout(() => { setTimeout(() => {

View File

@@ -406,7 +406,7 @@ async function toPost(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item, post_id: item,
}, },
}).href; }).href;
createTGWindow(path, "帖子-Dev", item, 960, 720, false, false); createTGWindow(path, "Sub_window", `Post_${item}`, 960, 720, false, false);
} else { } else {
const path = router.resolve({ const path = router.resolve({
name: "帖子详情", name: "帖子详情",
@@ -414,7 +414,7 @@ async function toPost(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item.postId.toString(), post_id: item.postId.toString(),
}, },
}).href; }).href;
createTGWindow(path, "帖子", item.title, 960, 720, false, false); createTGWindow(path, "Sub_window", `Post_${item.postId} ${item.title}`, 960, 720, false, false);
} }
} }
@@ -426,7 +426,7 @@ async function toJson(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item, post_id: item,
}, },
}).href; }).href;
createTGWindow(path, "帖子-JSON-Dev", `${item}-JSON`, 960, 720, false, false); createTGWindow(path, "Dev_JSON", `Post_${item}_JSON`, 960, 720, false, false);
} else { } else {
const path = router.resolve({ const path = router.resolve({
name: "帖子详情JSON", name: "帖子详情JSON",
@@ -434,7 +434,15 @@ async function toJson(item: TGApp.Plugins.Mys.News.RenderCard | string): Promise
post_id: item.postId.toString(), post_id: item.postId.toString(),
}, },
}).href; }).href;
createTGWindow(path, "帖子-JSON", `${item.title}-JSON`, 960, 720, false, false); createTGWindow(
path,
"Dev_JSON",
`Post_${item.postId}_JSON ${item.title}`,
960,
720,
false,
false,
);
} }
} }

View File

@@ -1,4 +1,5 @@
<!-- eslint-disable vue/no-v-html --> <!-- eslint-disable vue/no-v-html -->
<!-- todo 添加更多信息 -->
<template> <template>
<TSwitchTheme /> <TSwitchTheme />
<TShareBtn <TShareBtn
@@ -71,15 +72,15 @@ onMounted(async () => {
created: new Date(postData.post.created_at * 1000).toLocaleString().replace(/\//g, "-"), created: new Date(postData.post.created_at * 1000).toLocaleString().replace(/\//g, "-"),
updated: new Date(postData.post.updated_at * 1000).toLocaleString().replace(/\//g, "-"), updated: new Date(postData.post.updated_at * 1000).toLocaleString().replace(/\//g, "-"),
}; };
shareTitle.value = `【帖子】${postId}-${postData.post.subject}`; shareTitle.value = `Post_${postId}`;
postRef.value = <HTMLElement>document.querySelector(".mys-post-body"); postRef.value = <HTMLElement>document.querySelector(".mys-post-body");
await appWindow.setTitle(shareTitle.value); await appWindow.setTitle(`Post_${postId} ${postData.post.subject}`);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
loadingEmpty.value = true; loadingEmpty.value = true;
loadingTitle.value = "帖子不存在或解析失败"; loadingTitle.value = "帖子不存在或解析失败";
loadingSub.value = error instanceof Error ? error.message : <string>error; loadingSub.value = error instanceof Error ? error.message : <string>error;
await appWindow.setTitle(`【帖子】${postId}-解析失败`); await appWindow.setTitle(`Post_${postId} Parsing Error`);
return; return;
} }
setTimeout(() => { setTimeout(() => {