diff --git a/src/views/t-anno.vue b/src/views/t-anno.vue index 3513d96a..c02faa4f 100644 --- a/src/views/t-anno.vue +++ b/src/views/t-anno.vue @@ -98,7 +98,7 @@ watch(loadShare, (value) => { }); function createAnnoJson(annoId: number) { - const jsonPath = `/anno_detail/${annoId}`; + const jsonPath = `/anno_detail_json/${annoId}`; const jsonTitle = `Anno_${annoId}_JSON`; createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false); } diff --git a/src/web/utils/parseAnno.ts b/src/web/utils/parseAnno.ts index 9863b7f2..75630386 100644 --- a/src/web/utils/parseAnno.ts +++ b/src/web/utils/parseAnno.ts @@ -1,17 +1,17 @@ /** - * @file web utils parseAnno.ts + * @file web/utils/parseAnno.ts * @description 解析游戏内公告数据 - * @todo 需要完善 - * @author BTMuli - * @since Alpha v0.2.0 + * @since Beta v0.4.0 */ import { decodeRegExp } from "./tools"; import { saveImgLocal } from "../../utils/TGShare"; +import { isColorSimilar } from "../../utils/toolFunc"; /** * @description 解析游戏内公告数据 - * @since Alpha v0.2.0 + * @since Beta v0.4.0 + * @todo 需要完善 * @param {string} data 游戏内公告数据 * @returns {Promise} 解析后的数据 */ @@ -21,6 +21,12 @@ export async function parseAnnoContent(data: string): Promise { if (span.style.fontSize) { span.style.fontSize = ""; } + // 获取color + if (span.style.color) { + if (isColorSimilar("#000000", span.style.color)) { + span.style.color = "var(--app-page-content)"; + } + } if (span.children.length === 0) { return (span.innerHTML = decodeRegExp(span.innerHTML)); } else { @@ -65,7 +71,10 @@ export async function parseAnnoContent(data: string): Promise { } }); htmlBase.querySelectorAll("table").forEach((table) => { - table.style.borderColor = "#546d8b"; + table.style.borderColor = "var(--common-shadow-2)"; + table.querySelectorAll("td").forEach((td) => { + if (td.style.backgroundColor) td.style.backgroundColor = "var(--box-bg-1)"; + }); }); return htmlBase.body.innerHTML; }