mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
⚡️ 一些优化
This commit is contained in:
@@ -9,7 +9,6 @@ use tauri::{AppHandle, Manager, WindowBuilder, WindowEvent, WindowUrl};
|
||||
#[tauri::command]
|
||||
pub async fn create_mhy_client(handle: AppHandle, func: String, url: String) {
|
||||
let mut mhy_window_config = handle.config().tauri.windows.get(1).unwrap().clone();
|
||||
mhy_window_config.visible = true;
|
||||
if url != "" {
|
||||
mhy_window_config.url = WindowUrl::External(url.parse().unwrap());
|
||||
} else {
|
||||
|
||||
@@ -213,6 +213,7 @@ async function getTokenWeb(cookie: string): Promise<void> {
|
||||
await TGLogger.Error("[tc-userBadge][getTokenWeb] 获取 cookie 失败");
|
||||
return;
|
||||
}
|
||||
await TGSqlite.saveAppData("cookie", JSON.stringify(cookieUser));
|
||||
showSnackbar({
|
||||
text: "登录成功!",
|
||||
color: "success",
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
/>
|
||||
</slot>
|
||||
<slot name="inner-text">
|
||||
<span>{{ modelValue.innerText }}</span>
|
||||
<span :title="modelValue.innerText">{{ modelValue.innerText }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,6 +208,13 @@ const props = defineProps<TItemBoxProps>();
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.tib-inner span {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.tib-outer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
|
||||
@@ -101,10 +101,8 @@ onUnmounted(() => {
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
background: var(--box-bg-2);
|
||||
background-image: v-bind(bg);
|
||||
background: var(--common-shadow-t-4) v-bind(bg) no-repeat;
|
||||
background-position-x: right;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
@@ -150,5 +148,6 @@ onUnmounted(() => {
|
||||
|
||||
.tur-ws-sub :nth-last-child(2) {
|
||||
color: var(--tgc-yellow-1);
|
||||
font-family: var(--font-title);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,7 @@ const props = defineProps<TwoConvertProps>();
|
||||
const textColor = computed(() => {
|
||||
if (!props.data || !props.data.days) return "var(--tgc-blue-2)";
|
||||
const day = new Date().getDay();
|
||||
if (props.data.days.includes(day)) return "var(--tgc-pink-1)";
|
||||
if (props.data.days.includes(day.toString())) return "var(--tgc-pink-1)";
|
||||
return "var(--tgc-blue-2)";
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -40,12 +40,7 @@
|
||||
</v-btn>
|
||||
</div>
|
||||
<div class="posts-nav">
|
||||
<div
|
||||
v-for="navItem in nav"
|
||||
:key="navItem.id"
|
||||
class="post-nav"
|
||||
@click="toNav(navItem.app_path)"
|
||||
>
|
||||
<div v-for="navItem in nav" :key="navItem.id" class="post-nav" @click="toNav(navItem)">
|
||||
<img alt="navIcon" :src="navItem.icon" />
|
||||
<span>{{ navItem.name }}</span>
|
||||
</div>
|
||||
@@ -237,8 +232,10 @@ watch(curSortLabel, async (newVal) => {
|
||||
await freshPostData();
|
||||
});
|
||||
|
||||
async function toNav(path: string): Promise<void> {
|
||||
const link = new URL(path);
|
||||
async function toNav(item: TGApp.BBS.Navigator.Navigator): Promise<void> {
|
||||
await TGLogger.Info(`[Posts][${curGameLabel.value}][toNav] 打开网页活动 ${item.name}`);
|
||||
await TGLogger.Info(`[Posts][${curGameLabel.value}][toNav] ${item.app_path}`);
|
||||
const link = new URL(item.app_path);
|
||||
const mysList = [
|
||||
"https://act.mihoyo.com",
|
||||
"https://webstatic.mihoyo.com",
|
||||
@@ -251,7 +248,7 @@ async function toNav(path: string): Promise<void> {
|
||||
}
|
||||
// 如果不在上面的域名里面,就直接打开
|
||||
if (!mysList.includes(link.origin)) {
|
||||
window.open(path);
|
||||
window.open(item.app_path);
|
||||
return;
|
||||
}
|
||||
const modeConfirm = await showConfirm({
|
||||
@@ -265,8 +262,8 @@ async function toNav(path: string): Promise<void> {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (modeConfirm) await TGClient.open("web_act", path);
|
||||
else await TGClient.open("web_act_thin", path);
|
||||
if (modeConfirm) await TGClient.open("web_act", item.app_path);
|
||||
else await TGClient.open("web_act_thin", item.app_path);
|
||||
}
|
||||
|
||||
// 处理 protocol
|
||||
|
||||
Reference in New Issue
Block a user