From 82cdee00e75c4b428efc0492f71c6f71406e61db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Wed, 7 Feb 2024 13:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/client/mod.rs | 1 - src/components/config/tc-userBadge.vue | 1 + src/components/main/t-itembox.vue | 9 ++++++++- src/components/userRecord/tur-world-sub.vue | 5 ++--- src/components/wiki/two-source.vue | 2 +- src/pages/common/Posts.vue | 19 ++++++++----------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src-tauri/src/client/mod.rs b/src-tauri/src/client/mod.rs index 128a4e34..e01301d9 100644 --- a/src-tauri/src/client/mod.rs +++ b/src-tauri/src/client/mod.rs @@ -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 { diff --git a/src/components/config/tc-userBadge.vue b/src/components/config/tc-userBadge.vue index 5eeb9f5f..210c7e50 100644 --- a/src/components/config/tc-userBadge.vue +++ b/src/components/config/tc-userBadge.vue @@ -213,6 +213,7 @@ async function getTokenWeb(cookie: string): Promise { await TGLogger.Error("[tc-userBadge][getTokenWeb] 获取 cookie 失败"); return; } + await TGSqlite.saveAppData("cookie", JSON.stringify(cookieUser)); showSnackbar({ text: "登录成功!", color: "success", diff --git a/src/components/main/t-itembox.vue b/src/components/main/t-itembox.vue index 2f2ce68a..7a291e54 100644 --- a/src/components/main/t-itembox.vue +++ b/src/components/main/t-itembox.vue @@ -74,7 +74,7 @@ /> - {{ modelValue.innerText }} + {{ modelValue.innerText }} @@ -208,6 +208,13 @@ const props = defineProps(); margin-right: 5px; } +.tib-inner span { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + word-break: break-all; +} + .tib-outer { position: absolute; bottom: 0; diff --git a/src/components/userRecord/tur-world-sub.vue b/src/components/userRecord/tur-world-sub.vue index fa9ced46..279a3ea7 100644 --- a/src/components/userRecord/tur-world-sub.vue +++ b/src/components/userRecord/tur-world-sub.vue @@ -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); } diff --git a/src/components/wiki/two-source.vue b/src/components/wiki/two-source.vue index 42d80d1e..8526acfb 100644 --- a/src/components/wiki/two-source.vue +++ b/src/components/wiki/two-source.vue @@ -16,7 +16,7 @@ const props = defineProps(); 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)"; }); diff --git a/src/pages/common/Posts.vue b/src/pages/common/Posts.vue index b158881e..774ed47e 100644 --- a/src/pages/common/Posts.vue +++ b/src/pages/common/Posts.vue @@ -40,12 +40,7 @@
-
+
navIcon {{ navItem.name }}
@@ -237,8 +232,10 @@ watch(curSortLabel, async (newVal) => { await freshPostData(); }); -async function toNav(path: string): Promise { - const link = new URL(path); +async function toNav(item: TGApp.BBS.Navigator.Navigator): Promise { + 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 { } // 如果不在上面的域名里面,就直接打开 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 { }); 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