mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🐛 fix(TGWindow): 修复部分窗口打开不可见的问题
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
alt="material.content_id"
|
alt="material.content_id"
|
||||||
:src="material.icon"
|
:src="material.icon"
|
||||||
class="calendar-icon"
|
class="calendar-icon"
|
||||||
@click="showContent(material.content_id)"
|
@click="showContent(material.content_id, material.name)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-detail">
|
<div class="content-detail">
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
alt="content.content_id"
|
alt="content.content_id"
|
||||||
:src="content.icon"
|
:src="content.icon"
|
||||||
class="calendar-icon"
|
class="calendar-icon"
|
||||||
@click="showContent(content.content_id)"
|
@click="showContent(content.content_id, content.name)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
alt="material.content_id"
|
alt="material.content_id"
|
||||||
:src="material.icon"
|
:src="material.icon"
|
||||||
class="calendar-icon"
|
class="calendar-icon"
|
||||||
@click="showContent(material.content_id)"
|
@click="showContent(material.content_id, material.name)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-detail">
|
<div class="content-detail">
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
alt="content.content_id"
|
alt="content.content_id"
|
||||||
:src="content.icon"
|
:src="content.icon"
|
||||||
class="calendar-icon"
|
class="calendar-icon"
|
||||||
@click="showContent(content.content_id)"
|
@click="showContent(content.content_id, content.name)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -101,6 +101,7 @@ import { TGAppData } from "../data/index";
|
|||||||
import { type Map } from "../interface/Base";
|
import { type Map } from "../interface/Base";
|
||||||
import { CalendarData, CalendarItem } from "../interface/Calendar";
|
import { CalendarData, CalendarItem } from "../interface/Calendar";
|
||||||
import { OBC_CONTENT_API } from "../plugins/Mys/interface/utils";
|
import { OBC_CONTENT_API } from "../plugins/Mys/interface/utils";
|
||||||
|
import { createTGWindow } from "../utils/TGWindow";
|
||||||
|
|
||||||
// loading
|
// loading
|
||||||
const loading = ref(true as boolean);
|
const loading = ref(true as boolean);
|
||||||
@@ -168,9 +169,9 @@ function getCalendar (day: number) {
|
|||||||
return calendarData.value[week];
|
return calendarData.value[week];
|
||||||
}
|
}
|
||||||
|
|
||||||
function showContent (contentId: number) {
|
function showContent (contentId: number, name: string) {
|
||||||
// todo:二级跳转,目前先直接跳到角色详情页
|
const url = OBC_CONTENT_API.replace("{content_id}", contentId.toString());
|
||||||
window.open(OBC_CONTENT_API.replace("{content_id}", contentId.toString()));
|
createTGWindow(url, "素材详情", name, 800, 600, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContents (day: number) {
|
function getContents (day: number) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ function checkCover (data: GachaData[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toOuter (url: string, title: string) {
|
function toOuter (url: string, title: string) {
|
||||||
createTGWindow(url, "祈愿", title, 1200, 800, true);
|
createTGWindow(url, "祈愿", title, 1200, 800, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLastPoolTime (time: number) {
|
function getLastPoolTime (time: number) {
|
||||||
@@ -156,7 +156,7 @@ function toPost (pool: GachaCard) {
|
|||||||
post_id: pool.post_id.toString(),
|
post_id: pool.post_id.toString(),
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "限时祈愿", pool.title, 960, 720, false);
|
createTGWindow(path, "限时祈愿", pool.title, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ async function toPost (card: PositionCard) {
|
|||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
// 打开新窗口
|
// 打开新窗口
|
||||||
createTGWindow(path, "近期活动", card.title, 960, 720, false);
|
createTGWindow(path, "近期活动", card.title, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ async function toPost (item: AnnoListCard) {
|
|||||||
anno_id: item.id,
|
anno_id: item.id,
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "游戏内公告", item.title, 960, 720, false);
|
createTGWindow(path, "游戏内公告", item.title, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toJson (item: AnnoListCard) {
|
async function toJson (item: AnnoListCard) {
|
||||||
@@ -155,7 +155,7 @@ async function toJson (item: AnnoListCard) {
|
|||||||
anno_id: item.id,
|
anno_id: item.id,
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "游戏内公告-JSON", item.title, 960, 720, false);
|
createTGWindow(path, "游戏内公告-JSON", item.title, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { window as TauriWindow } from "@tauri-apps/api";
|
|||||||
* @param {number} width 窗口宽度
|
* @param {number} width 窗口宽度
|
||||||
* @param {number} height 窗口高度
|
* @param {number} height 窗口高度
|
||||||
* @param {boolean} resizable 是否可调整大小
|
* @param {boolean} resizable 是否可调整大小
|
||||||
|
* @param {boolean} visible 是否可见
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export function createTGWindow (
|
export function createTGWindow (
|
||||||
@@ -24,6 +25,7 @@ export function createTGWindow (
|
|||||||
width: number,
|
width: number,
|
||||||
height: number,
|
height: number,
|
||||||
resizable: boolean,
|
resizable: boolean,
|
||||||
|
visible: boolean = true,
|
||||||
): void {
|
): void {
|
||||||
// 计算窗口位置
|
// 计算窗口位置
|
||||||
const left = (window.screen.width - width) / 2;
|
const left = (window.screen.width - width) / 2;
|
||||||
@@ -37,7 +39,7 @@ export function createTGWindow (
|
|||||||
resizable,
|
resizable,
|
||||||
url,
|
url,
|
||||||
title,
|
title,
|
||||||
visible: false,
|
visible,
|
||||||
});
|
});
|
||||||
void new TauriWindow.WindowManager(label).close().then(() => {
|
void new TauriWindow.WindowManager(label).close().then(() => {
|
||||||
void new TauriWindow.WebviewWindow(label, {
|
void new TauriWindow.WebviewWindow(label, {
|
||||||
@@ -48,7 +50,7 @@ export function createTGWindow (
|
|||||||
resizable,
|
resizable,
|
||||||
url,
|
url,
|
||||||
title,
|
title,
|
||||||
visible: false,
|
visible,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ async function toPost (item: NewsCard | string) {
|
|||||||
post_id: item,
|
post_id: item,
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "帖子-Dev", item, 960, 720, false);
|
createTGWindow(path, "帖子-Dev", item, 960, 720, false, false);
|
||||||
} else {
|
} else {
|
||||||
const path = router.resolve({
|
const path = router.resolve({
|
||||||
name: "帖子详情",
|
name: "帖子详情",
|
||||||
@@ -305,7 +305,7 @@ async function toPost (item: NewsCard | string) {
|
|||||||
post_id: item.post_id.toString(),
|
post_id: item.post_id.toString(),
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "帖子", item.title, 960, 720, false);
|
createTGWindow(path, "帖子", item.title, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function toJson (item: NewsCard | string) {
|
async function toJson (item: NewsCard | string) {
|
||||||
@@ -317,7 +317,7 @@ async function toJson (item: NewsCard | string) {
|
|||||||
post_id: item,
|
post_id: item,
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "帖子-JSON-Dev", `${item}-JSON`, 960, 720, false);
|
createTGWindow(path, "帖子-JSON-Dev", `${item}-JSON`, 960, 720, false, false);
|
||||||
} else {
|
} else {
|
||||||
const path = router.resolve({
|
const path = router.resolve({
|
||||||
name: "帖子详情(JSON)",
|
name: "帖子详情(JSON)",
|
||||||
@@ -326,7 +326,7 @@ async function toJson (item: NewsCard | string) {
|
|||||||
post_id: item.post_id.toString(),
|
post_id: item.post_id.toString(),
|
||||||
},
|
},
|
||||||
}).href;
|
}).href;
|
||||||
createTGWindow(path, "帖子-JSON", `${item.title}-JSON`, 960, 720, false);
|
createTGWindow(path, "帖子-JSON", `${item.title}-JSON`, 960, 720, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user