From e03da9a4057c7158269123c432fff626d815c2e4 Mon Sep 17 00:00:00 2001 From: jinchao <383321154@qq.com> Date: Thu, 8 May 2025 09:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A6=82=E8=A7=88=E9=A1=B5=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0Q&A=E4=B8=8E=E5=B8=AE=E5=8A=A9=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Release/database/XNSim.db | Bin 172032 -> 172032 bytes XNSimHtml/components/overview-page.js | 149 ++++++++++++++++++++++++++ XNSimHtml/components/qa-component.js | 1 - XNSimHtml/main.html | 2 + 4 files changed, 151 insertions(+), 1 deletion(-) diff --git a/Release/database/XNSim.db b/Release/database/XNSim.db index c43ade218a22fcf09b2d5f36a3e022e22386ab03..c9790f08b94711b98bb81c18d5f76e3e5ab69b5e 100644 GIT binary patch delta 228 zcmZoTz}0YoYl1Xm%tRSy#+Z!>OYE5i*xyWMcaUddf3vai2zz~z0K253Y;?4^p`L-B zp{bF9k*Tf$5Lp;lS{a#I85=%Z*7Ra|$IFFVU(Q|hZ2Rt~T?+!$9G~pyd%9!Y)2@}z zXSKYXyzg1xQX-WlrsQVkHS+Rv04)t|6cyi`?J<*GM1Vh?ffwNq(1`>2w;;3Kp(MzIta61NTdf64-aMl5BCr4 w50Vdu4}1@C4`#C%P(u%qPz{q?UkQV6Ux#mB0k>~o0+k>G1`fQp2Y>?k9~w&>(*OVf diff --git a/XNSimHtml/components/overview-page.js b/XNSimHtml/components/overview-page.js index a9cf995..9083e57 100644 --- a/XNSimHtml/components/overview-page.js +++ b/XNSimHtml/components/overview-page.js @@ -102,6 +102,52 @@ class OverviewPage extends HTMLElement { } }); } + + // 添加Q&A和帮助链接的事件监听 + const qaLink = this.shadowRoot.querySelector('#qa-link'); + const helpLink = this.shadowRoot.querySelector('#help-link'); + + if (qaLink) { + qaLink.addEventListener('click', (e) => { + e.preventDefault(); + // 获取子工具栏 + const subToolbar = document.querySelector('sub-toolbar'); + if (subToolbar) { + // 触发与常见问题按钮相同的事件 + const event = new CustomEvent('sub-item-selected', { + detail: { + parent: 'home', + text: 'Q&A', + icon: 'question' + }, + bubbles: true, + composed: true + }); + subToolbar.dispatchEvent(event); + } + }); + } + + if (helpLink) { + helpLink.addEventListener('click', (e) => { + e.preventDefault(); + // 获取子工具栏 + const subToolbar = document.querySelector('sub-toolbar'); + if (subToolbar) { + // 触发与帮助文档按钮相同的事件 + const event = new CustomEvent('sub-item-selected', { + detail: { + parent: 'home', + text: '帮助', + icon: 'help' + }, + bubbles: true, + composed: true + }); + subToolbar.dispatchEvent(event); + } + }); + } } render() { @@ -215,6 +261,105 @@ class OverviewPage extends HTMLElement { border-radius: 12px; padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); + display: flex; + flex-direction: column; + } + + .about-section .section-title { + margin-bottom: 15px; + } + + .about-section p { + margin-bottom: 15px; + } + + .about-section .version-list { + margin-bottom: auto; + } + + .help-links { + margin-top: auto; + display: flex; + gap: 16px; + justify-content: center; + padding-top: 20px; + border-top: 1px solid #eee; + } + + .help-link { + position: relative; + color: #667eea; + text-decoration: none; + display: flex; + align-items: center; + gap: 6px; + font-size: 15px; + padding: 4px 2px; + transition: all 0.3s ease; + } + + .help-link:hover { + color: #764ba2; + } + + .help-link::before { + content: ''; + display: inline-block; + width: 16px; + height: 16px; + background-size: 16px; + background-repeat: no-repeat; + background-position: center; + transition: all 0.3s ease; + /* 将黑色图标转换为蓝色 (#667eea) */ + filter: brightness(0) saturate(100%) invert(53%) sepia(95%) saturate(1731%) hue-rotate(213deg) brightness(99%) contrast(94%) !important; + } + + #qa-link::before { + background-image: url('assets/icons/png/question_b.png'); + } + + #help-link::before { + background-image: url('assets/icons/png/help_b.png'); + } + + .help-link:hover::before { + /* 将黑色图标转换为紫色 (#764ba2) */ + filter: brightness(0) saturate(100%) invert(36%) sepia(24%) saturate(1674%) hue-rotate(233deg) brightness(94%) contrast(92%) !important; + } + + .help-link::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 1px; + background: currentColor; + transform: scaleX(0); + transform-origin: right; + transition: transform 0.3s ease; + } + + .help-link:hover::after { + transform: scaleX(1); + transform-origin: left; + } + + .help-link::before { + content: ''; + display: inline-block; + width: 18px; + height: 18px; + background-size: 18px; + background-repeat: no-repeat; + background-position: center; + filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1)); + transition: all 0.3s ease; + } + + .help-link:hover::before { + transform: scale(1.1); } .calendar-widget { @@ -419,6 +564,10 @@ class OverviewPage extends HTMLElement {
  • 技术支持:无
  • 官方网站:无
  • +
    diff --git a/XNSimHtml/components/qa-component.js b/XNSimHtml/components/qa-component.js index a481324..a97ad1a 100644 --- a/XNSimHtml/components/qa-component.js +++ b/XNSimHtml/components/qa-component.js @@ -31,7 +31,6 @@ class QAComponent extends HTMLElement { async loadQuestions() { try { - console.log('Loading page:', this.currentPage); const response = await fetch(`/api/qa/questions?sort=desc`); const data = await response.json(); if (data.success) { diff --git a/XNSimHtml/main.html b/XNSimHtml/main.html index c3b0e57..99dea6e 100644 --- a/XNSimHtml/main.html +++ b/XNSimHtml/main.html @@ -336,6 +336,7 @@ if (title === '帮助') { const id = 'help'; tabsContainer.createTab(id, title, icon, parentText, parentTool); + contentArea.loadContent(id); return; } @@ -343,6 +344,7 @@ if (title === 'Q&A') { const id = 'qa'; tabsContainer.createTab(id, title, icon, parentText, parentTool); + contentArea.loadContent(id); return; }