- /mcp-connect 功能页:连接信息/令牌管理/接入后怎么使用(三步+13场景话术+排错)/工具清单/注意事项 - 已购授权机自动显示主令牌+配置自动带真实令牌(打开即复制即用);未授权显示购买引导 - 右上角 MCP 入口(Plug);Admin 左侧「MCP 调用」页(总览/排行/流水) - nginx location ~ ^/mcp(/|\$) 边界反代(防吞 /mcp-connect SPA 路由) - WIDE_TOOLS/locales/relay in-repo 副本同步
871 lines
25 KiB
Vue
871 lines
25 KiB
Vue
<script lang="ts" setup>
|
||
import { NIcon, useThemeVars } from 'naive-ui';
|
||
|
||
import { RouterLink } from 'vue-router';
|
||
import { Heart, Home2, Key, Menu2, Plug } from '@vicons/tabler';
|
||
|
||
import { storeToRefs } from 'pinia';
|
||
import HeroGradient from '../assets/hero-gradient.svg?component';
|
||
import MenuLayout from '../components/MenuLayout.vue';
|
||
import NavbarButtons from '../components/NavbarButtons.vue';
|
||
import { useStyleStore } from '@/stores/style.store';
|
||
import { useCloudSync } from '@/composable/cloud-sync';
|
||
import { config } from '@/config';
|
||
import type { ToolCategory } from '@/tools/tools.types';
|
||
import { useToolStore } from '@/tools/tools.store';
|
||
import { useTracker } from '@/modules/tracker/tracker.services';
|
||
import CollapsibleToolMenu from '@/components/CollapsibleToolMenu.vue';
|
||
import UserMenu from '@/components/UserMenu.vue';
|
||
import FeedbackModal from '@/components/FeedbackModal.vue';
|
||
import { getMachineId } from '@/tools/license/license';
|
||
|
||
const themeVars = useThemeVars();
|
||
const styleStore = useStyleStore();
|
||
|
||
// 页脚模式:默认随内容排在页面最底部(首页等);功能页传入 fixedFooter 改为固定在视口底部
|
||
const props = withDefaults(defineProps<{ fixedFooter?: boolean }>(), { fixedFooter: false });
|
||
|
||
// 已登录用户每次打开页面:自动拉取一次云端数据(收藏/记录/对话等跨设备恢复)
|
||
const { syncNow, isLoggedIn } = useCloudSync();
|
||
if (isLoggedIn.value) {
|
||
setTimeout(() => syncNow(), 1500);
|
||
}
|
||
const version = config.app.version;
|
||
const commitSha = config.app.lastCommitSha.slice(0, 7);
|
||
|
||
// ---- 站内留言反馈(右上角入口,弹窗提交,与授权系统无关) ----
|
||
const showFeedback = ref(false);
|
||
|
||
// ---- 授权系统接入(auth.88531.cn 项目 6):在线统计上报 + 公告推送 + 右上角铃铛/版本号 ----
|
||
const SITE_VERSION = '2026.11.12'; // 当前版本号,与 Gitea Release tag 同步(发版时更新)
|
||
const annOpen = ref(false);
|
||
const announcements = ref<Record<string, any>[]>([]);
|
||
const popupAnn = ref<Record<string, any> | null>(null);
|
||
const annSeenVersion = ref(0);
|
||
let annSeen: string[] = [];
|
||
try {
|
||
annSeen = JSON.parse(localStorage.getItem('it-tools-ann-read') || '[]');
|
||
if (!Array.isArray(annSeen)) annSeen = [];
|
||
}
|
||
catch {
|
||
annSeen = [];
|
||
}
|
||
const annUnread = computed(() => {
|
||
annSeenVersion.value; // 依赖已读版本号,标记已读后重算
|
||
return announcements.value.filter(a => !annSeen.includes(String(a.id))).length;
|
||
});
|
||
function annIsUnread(a: Record<string, any>) {
|
||
annSeenVersion.value;
|
||
return !annSeen.includes(String(a.id));
|
||
}
|
||
function annSaveSeen() {
|
||
try {
|
||
localStorage.setItem('it-tools-ann-read', JSON.stringify(annSeen));
|
||
}
|
||
catch { /* localStorage 不可用时忽略 */ }
|
||
annSeenVersion.value++;
|
||
}
|
||
function annMarkRead(a: Record<string, any>) {
|
||
const id = String(a?.id ?? '');
|
||
if (id && !annSeen.includes(id)) {
|
||
annSeen.push(id);
|
||
annSaveSeen();
|
||
}
|
||
}
|
||
function annMarkAll() {
|
||
const ids = announcements.value.map(a => String(a?.id ?? '')).filter(Boolean);
|
||
annSeen = [...new Set([...annSeen, ...ids])];
|
||
annSaveSeen();
|
||
}
|
||
function annTime(t?: string) {
|
||
return t ? String(t).slice(0, 16) : '';
|
||
}
|
||
function toggleAnn() {
|
||
annOpen.value = !annOpen.value;
|
||
if (annOpen.value) fetchAnnouncements();
|
||
}
|
||
async function fetchAnnouncements() {
|
||
try {
|
||
const res = await fetch('/relay/hub/announcements?limit=20');
|
||
if (!res.ok) return;
|
||
const body = await res.json();
|
||
if (body?.code !== 200) return;
|
||
announcements.value = Array.isArray(body.data?.list) ? body.data.list : [];
|
||
// 公告推送:popup 列表里没看过的条目每次只弹第一条(其余在铃铛面板可读)
|
||
const pops = (Array.isArray(body.data?.popup) ? body.data.popup : [])
|
||
.filter((p: any) => p && !annSeen.includes(String(p.id)));
|
||
if (pops.length && !popupAnn.value)
|
||
popupAnn.value = pops[0];
|
||
}
|
||
catch {
|
||
// 授权系统不可达时静默降级,不影响站点使用
|
||
}
|
||
}
|
||
function closePopup() {
|
||
if (popupAnn.value)
|
||
annMarkRead(popupAnn.value);
|
||
popupAnn.value = null;
|
||
}
|
||
// 在线统计:打开页面即登记安装 + 每 30 分钟心跳,授权系统后台据此统计安装/在线
|
||
async function reportOnline() {
|
||
try {
|
||
await fetch('/relay/hub/report', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify({
|
||
machine_id: getMachineId(),
|
||
client_version: SITE_VERSION,
|
||
device_info: `web ${location.host}`,
|
||
}),
|
||
});
|
||
}
|
||
catch {
|
||
// 静默降级
|
||
}
|
||
}
|
||
function onAnnDocClick(e: MouseEvent) {
|
||
const el = e.target as Element | null;
|
||
// 面板已 Teleport 到 body,不再位于 .ann-wrap 内,需一并放行
|
||
if (annOpen.value && !el?.closest?.('.ann-wrap, .ann-panel'))
|
||
annOpen.value = false;
|
||
}
|
||
onMounted(() => {
|
||
reportOnline();
|
||
fetchAnnouncements();
|
||
setInterval(reportOnline, 30 * 60 * 1000);
|
||
setInterval(fetchAnnouncements, 15 * 60 * 1000);
|
||
document.addEventListener('click', onAnnDocClick);
|
||
});
|
||
onUnmounted(() => document.removeEventListener('click', onAnnDocClick));
|
||
|
||
// ---- 页脚售后微信:点击复制 ----
|
||
const WECHAT_ID = 'q3970260761';
|
||
const wechatCopied = ref(false);
|
||
async function copyWechat() {
|
||
let ok = false;
|
||
try {
|
||
await navigator.clipboard.writeText(WECHAT_ID);
|
||
ok = true;
|
||
}
|
||
catch {
|
||
// 剪贴板 API 不可用(非 https / 老浏览器)时退回 execCommand
|
||
try {
|
||
const ta = document.createElement('textarea');
|
||
ta.value = WECHAT_ID;
|
||
ta.style.position = 'fixed';
|
||
ta.style.opacity = '0';
|
||
document.body.appendChild(ta);
|
||
ta.select();
|
||
ok = document.execCommand('copy');
|
||
document.body.removeChild(ta);
|
||
}
|
||
catch {
|
||
ok = false;
|
||
}
|
||
}
|
||
if (ok) {
|
||
wechatCopied.value = true;
|
||
setTimeout(() => {
|
||
wechatCopied.value = false;
|
||
}, 2000);
|
||
}
|
||
}
|
||
|
||
const { tracker } = useTracker();
|
||
const { t } = useI18n();
|
||
|
||
const toolStore = useToolStore();
|
||
const { favoriteTools, toolsByCategory } = storeToRefs(toolStore);
|
||
|
||
// 全屏页面:不显示工具侧边栏
|
||
const NO_SIDEBAR = new Set(['/user-center', '/admin']);
|
||
const fullBleed = computed(() => NO_SIDEBAR.has(route.path));
|
||
|
||
const favoriteCategory = computed<ToolCategory | null>(() =>
|
||
favoriteTools.value.length > 0 ? { name: t('tools.categories.favorite-tools'), components: favoriteTools.value } : null,
|
||
);
|
||
|
||
const tools = computed<ToolCategory[]>(() => [
|
||
...toolsByCategory.value,
|
||
]);
|
||
|
||
// ---- 全站 IPv6 切换(公网入口 it.88531.cn ⇄ itv6.88531.cn:4443) ----
|
||
const V6_HOST = 'itv6.88531.cn';
|
||
const V6_PORT = 4443;
|
||
const onV6Host = ref(location.hostname === V6_HOST);
|
||
const onPublicHost = ['it.88531.cn', V6_HOST].includes(location.hostname);
|
||
const v6ok = ref(false);
|
||
const v6Switching = ref(false);
|
||
|
||
async function probeV6() {
|
||
// 结果缓存 10 分钟,避免每次开页都探测
|
||
try {
|
||
const c = JSON.parse(localStorage.getItem('it_v6_probe') || 'null');
|
||
if (c && typeof c.ok === 'boolean' && Date.now() - (c.ts || 0) < 600000) {
|
||
v6ok.value = c.ok;
|
||
return;
|
||
}
|
||
}
|
||
catch { /* 探测 */ }
|
||
let ok = false;
|
||
try {
|
||
const ctl = new AbortController();
|
||
const timer = setTimeout(() => ctl.abort(), 4000);
|
||
// api6.ipify.org 仅 AAAA:能连通即说明本机有 IPv6 出口
|
||
const r = await fetch('https://api6.ipify.org?format=json', { signal: ctl.signal, cache: 'no-store' });
|
||
clearTimeout(timer);
|
||
const j = await r.json();
|
||
ok = typeof j?.ip === 'string' && j.ip.includes(':');
|
||
}
|
||
catch { ok = false; }
|
||
v6ok.value = ok;
|
||
try { localStorage.setItem('it_v6_probe', JSON.stringify({ ok, ts: Date.now() })); }
|
||
catch { /* ignore */ }
|
||
}
|
||
|
||
function switchV6() {
|
||
if (v6Switching.value) {
|
||
return;
|
||
}
|
||
v6Switching.value = true;
|
||
const path = location.pathname + location.search + location.hash;
|
||
location.href = onV6Host.value
|
||
? `https://it.88531.cn${path}`
|
||
: `https://${V6_HOST}:${V6_PORT}${path}`;
|
||
}
|
||
|
||
// 右下角回到顶部火箭
|
||
const showTop = ref(false);
|
||
// 页面可能有多层 .n-layout-scroll-container(嵌套 n-layout),外层往往不滚、内层才滚;
|
||
// 全部绑定,任一层滚动超过阈值即显示,避免挂在不滚的那层导致火箭永不出现
|
||
const scrollEls: Element[] = [];
|
||
function onWinScroll() {
|
||
showTop.value = scrollEls.some((el) => el.scrollTop > 300);
|
||
}
|
||
function scrollToTop() {
|
||
const el = scrollEls.find((e) => e.scrollTop > 0) ?? scrollEls[0];
|
||
el?.scrollTo({ top: 0, behavior: 'smooth' });
|
||
}
|
||
function bindTopScroll() {
|
||
document.querySelectorAll('.n-layout-scroll-container').forEach((el) => {
|
||
if (!scrollEls.includes(el)) {
|
||
scrollEls.push(el);
|
||
el.addEventListener('scroll', onWinScroll, { passive: true });
|
||
}
|
||
});
|
||
}
|
||
onMounted(() => {
|
||
if (onPublicHost) {
|
||
probeV6().catch(() => {});
|
||
}
|
||
// 等布局渲染后再绑定滚动容器(内层容器可能晚于挂载出现,多试几次)
|
||
let tries = 0;
|
||
const timer = setInterval(() => {
|
||
bindTopScroll();
|
||
tries++;
|
||
if (scrollEls.length >= 2 || tries >= 10) clearInterval(timer);
|
||
}, 300);
|
||
});
|
||
onBeforeUnmount(() => {
|
||
scrollEls.forEach((el) => el.removeEventListener('scroll', onWinScroll));
|
||
});
|
||
</script>
|
||
|
||
<template>
|
||
<MenuLayout class="menu-layout" :class="{ isSmallScreen: styleStore.isSmallScreen, 'fixed-footer': props.fixedFooter }">
|
||
<template #sider>
|
||
<RouterLink to="/" class="hero-wrapper">
|
||
<HeroGradient class="gradient" />
|
||
<div class="text-wrapper">
|
||
<div class="title">
|
||
IT-TOOLS-PRO
|
||
</div>
|
||
<div class="divider" />
|
||
<div class="subtitle">
|
||
{{ $t('home.subtitle') }}
|
||
</div>
|
||
</div>
|
||
</RouterLink>
|
||
|
||
<div class="sider-content">
|
||
<div v-if="styleStore.isSmallScreen" flex flex-col items-center>
|
||
<locale-selector w="90%" />
|
||
|
||
<div flex justify-center>
|
||
<NavbarButtons />
|
||
</div>
|
||
</div>
|
||
|
||
<CollapsibleToolMenu :tools-by-category="tools" :favorite-category="favoriteCategory" />
|
||
</div>
|
||
</template>
|
||
|
||
<template #content>
|
||
<div class="top-nav" flex items-center justify-center gap-2>
|
||
<c-button
|
||
circle
|
||
variant="text"
|
||
:aria-label="$t('home.toggleMenu')"
|
||
@click="styleStore.isMenuCollapsed = !styleStore.isMenuCollapsed"
|
||
>
|
||
<NIcon size="25" :component="Menu2" />
|
||
</c-button>
|
||
|
||
<c-tooltip :tooltip="$t('home.home')" position="bottom">
|
||
<c-button to="/" circle variant="text" :aria-label="$t('home.home')">
|
||
<NIcon size="25" :component="Home2" />
|
||
</c-button>
|
||
</c-tooltip>
|
||
|
||
<c-tooltip :tooltip="$t('home.uiLib')" position="bottom">
|
||
<c-button v-if="config.app.env === 'development'" to="/c-lib" circle variant="text" :aria-label="$t('home.uiLib')">
|
||
<icon-mdi:brush-variant text-20px />
|
||
</c-button>
|
||
</c-tooltip>
|
||
|
||
<command-palette />
|
||
|
||
<locale-selector v-if="!styleStore.isSmallScreen" />
|
||
|
||
<div>
|
||
<NavbarButtons v-if="!styleStore.isSmallScreen" />
|
||
</div>
|
||
|
||
<UserMenu />
|
||
|
||
<!-- 全站右上角:留言反馈(与授权系统无关,任何人可提交) -->
|
||
<c-tooltip position="bottom" :tooltip="'给我们留言:功能建议 / 意见反馈'">
|
||
<c-button
|
||
round
|
||
class="feedback-btn"
|
||
:bordered="false"
|
||
@click="showFeedback = true"
|
||
>
|
||
✍️ <span class="feedback-btn-text">留言反馈</span>
|
||
</c-button>
|
||
</c-tooltip>
|
||
|
||
<c-tooltip position="bottom" :tooltip="'查看授权功能与购买'">
|
||
<RouterLink to="/pricing" class="pricing-link">
|
||
<c-button
|
||
round
|
||
class="support-button"
|
||
:bordered="false"
|
||
>
|
||
授权应用
|
||
<NIcon v-if="!styleStore.isSmallScreen" :component="Key" ml-2 />
|
||
</c-button>
|
||
</RouterLink>
|
||
</c-tooltip>
|
||
|
||
<!-- 全站右上角:MCP 接入(教程/令牌管理入口,未购卡密显示购买链接) -->
|
||
<c-tooltip position="bottom" :tooltip="'MCP 接入:让 AI 助手直接调用本站工具'">
|
||
<RouterLink to="/mcp-connect" class="pricing-link">
|
||
<c-button
|
||
round
|
||
class="support-button"
|
||
:bordered="false"
|
||
>
|
||
MCP
|
||
<NIcon v-if="!styleStore.isSmallScreen" :component="Plug" ml-2 />
|
||
</c-button>
|
||
</RouterLink>
|
||
</c-tooltip>
|
||
|
||
<!-- 全站右上角:IPv6 直连切换(仅公网域名且探测到本机有 IPv6 时显示) -->
|
||
<c-tooltip
|
||
v-if="onV6Host || v6ok"
|
||
position="bottom"
|
||
:tooltip="onV6Host ? '当前 IPv6 直连入口,点击切回 IPv4 中转' : '检测到你的网络支持 IPv6,点击切换 IPv6 直连加速'"
|
||
>
|
||
<c-button
|
||
round
|
||
class="v6-switch"
|
||
:bordered="false"
|
||
:disabled="v6Switching"
|
||
@click="switchV6"
|
||
>
|
||
<template v-if="onV6Host">⇄ IPv4</template>
|
||
<template v-else>⚡ <span class="v6-text">IPv6 直连</span></template>
|
||
</c-button>
|
||
</c-tooltip>
|
||
|
||
<!-- 全站右上角:授权系统公告(铃铛 + 未读红点 + 下拉面板) -->
|
||
<div class="ann-wrap">
|
||
<c-tooltip position="bottom" :tooltip="annUnread ? `有 ${annUnread} 条新公告` : '系统公告'">
|
||
<c-button
|
||
round
|
||
class="ann-btn"
|
||
:bordered="false"
|
||
aria-label="系统公告"
|
||
@click.stop="toggleAnn"
|
||
>
|
||
🔔
|
||
<span class="ann-dot" :style="{ display: annUnread ? 'block' : 'none' }"></span>
|
||
</c-button>
|
||
</c-tooltip>
|
||
<!-- 面板 Teleport 到 body:避免 top-nav 内 v-if 子树挂载进 null 容器(实测 insertBefore 崩溃) -->
|
||
<Teleport to="body">
|
||
<div v-if="annOpen" class="ann-panel" @click.stop>
|
||
<div class="ann-panel-head">
|
||
<span>📢 系统公告</span>
|
||
<button v-if="announcements.length" class="ann-readall" type="button" @click="annMarkAll">全部已读</button>
|
||
</div>
|
||
<div class="ann-panel-body">
|
||
<div v-if="!announcements.length" class="ann-empty">暂无公告</div>
|
||
<div
|
||
v-for="a in announcements"
|
||
:key="a.id"
|
||
class="ann-item"
|
||
:class="{ 'is-unread': annIsUnread(a) }"
|
||
role="button"
|
||
tabindex="0"
|
||
@click="annMarkRead(a)"
|
||
@keyup.enter="annMarkRead(a)"
|
||
>
|
||
<div class="ann-item-head">
|
||
<b v-if="a.title">{{ a.title }}</b>
|
||
<span class="ann-time">{{ annTime(a.created_at) }}</span>
|
||
</div>
|
||
<div class="ann-content">{{ a.content }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</Teleport>
|
||
</div>
|
||
|
||
<!-- 全站右上角:当前版本号(与 Gitea Release tag 同步) -->
|
||
<span class="ver-badge" :title="`IT-TOOLS-PRO v${SITE_VERSION}`">v{{ SITE_VERSION }}</span>
|
||
</div>
|
||
<slot />
|
||
|
||
<!-- 页脚:功能页固定在底部,其它页随内容排在页面最底部 -->
|
||
<div class="footer" :class="{ fixed: props.fixedFooter }">
|
||
<span>© {{ new Date().getFullYear() }} IT-TOOLS-PRO</span>
|
||
<span class="footer-sep">·</span>
|
||
<span>
|
||
<c-link target="_blank" rel="noopener" href="https://nav.88531.cn">🚀 更多应用尽在 nav.88531.cn</c-link>
|
||
</span>
|
||
<span class="footer-sep">·</span>
|
||
<span>
|
||
<c-link
|
||
target="_blank" rel="noopener"
|
||
href="https://gitea.88531.cn/jinghui/it-tools-pro"
|
||
title="https://gitea.88531.cn/jinghui/it-tools-pro"
|
||
>🐙 开源 gitea.88531.cn</c-link>
|
||
</span>
|
||
<span class="footer-sep">·</span>
|
||
<span>
|
||
<span
|
||
class="footer-wechat"
|
||
role="button"
|
||
tabindex="0"
|
||
title="点击复制售后微信 q3970260761"
|
||
@click="copyWechat"
|
||
@keyup.enter="copyWechat"
|
||
>💬 售后微信 {{ wechatCopied ? '已复制 ✓' : 'q3970260761' }}</span>
|
||
</span>
|
||
</div>
|
||
|
||
<!-- 留言反馈弹窗 -->
|
||
<FeedbackModal v-model:show="showFeedback" />
|
||
|
||
<!-- 授权系统公告推送(popup 类型,每条只弹一次);Teleport 到 body 避免内容区补丁冲突 -->
|
||
<Teleport to="body">
|
||
<div v-if="popupAnn" class="ann-popup-mask" @click.self="closePopup">
|
||
<div class="ann-popup" role="dialog" aria-label="系统公告">
|
||
<div class="ann-popup-head">📢 系统公告</div>
|
||
<div v-if="popupAnn.title" class="ann-popup-title">{{ popupAnn.title }}</div>
|
||
<div class="ann-popup-content">{{ popupAnn.content }}</div>
|
||
<div v-if="popupAnn.created_at" class="ann-popup-time">{{ annTime(popupAnn.created_at) }}</div>
|
||
<c-button round class="ann-popup-ok" type="primary" @click="closePopup">我知道了</c-button>
|
||
</div>
|
||
</div>
|
||
</Teleport>
|
||
|
||
<!-- 右下角回到顶部火箭 -->
|
||
<button v-show="showTop" class="back-top" title="回到顶部" aria-label="回到顶部" @click="scrollToTop">🚀</button>
|
||
</template>
|
||
</MenuLayout>
|
||
</template>
|
||
|
||
<style lang="less" scoped>
|
||
// ::v-deep(.n-layout-scroll-container) {
|
||
// @percent: 4%;
|
||
// @position: 25px;
|
||
// @size: 50px;
|
||
// @color: #eeeeee25;
|
||
// background-image: radial-gradient(@color @percent, transparent @percent),
|
||
// radial-gradient(@color @percent, transparent @percent);
|
||
// background-position: 0 0, @position @position;
|
||
// background-size: @size @size;
|
||
// }
|
||
|
||
// 右下角回到顶部火箭(页脚已改为底部居中,右下角不再冲突,恢复原始位置)
|
||
.back-top {
|
||
position: fixed;
|
||
right: 26px;
|
||
bottom: 26px;
|
||
z-index: 400;
|
||
width: 50px;
|
||
height: 50px;
|
||
border: none;
|
||
border-radius: 50%;
|
||
background: linear-gradient(48deg, #0e9384, #14b8a6);
|
||
color: #fff;
|
||
font-size: 22px;
|
||
line-height: 1;
|
||
cursor: pointer;
|
||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
|
||
transition: transform 0.18s, box-shadow 0.18s;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&:hover {
|
||
transform: translateY(-4px);
|
||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
|
||
}
|
||
|
||
&:active {
|
||
transform: translateY(-1px);
|
||
}
|
||
}
|
||
|
||
.support-button {
|
||
background: rgb(37, 99, 108);
|
||
background: linear-gradient(48deg, rgba(37, 99, 108, 1) 0%, rgba(59, 149, 111, 1) 60%, rgba(20, 160, 88, 1) 100%);
|
||
color: #fff !important;
|
||
transition: padding ease 0.2s !important;
|
||
|
||
&:hover {
|
||
color: #fff;
|
||
padding-left: 30px;
|
||
padding-right: 30px;
|
||
}
|
||
}
|
||
|
||
/* 页脚:默认随内容排在页面最底部(不固定、随内容滚动),单行横排居中 */
|
||
.footer {
|
||
margin-top: 40px;
|
||
padding: 0 0 22px;
|
||
text-align: center;
|
||
color: #838587;
|
||
font-size: 12px;
|
||
line-height: 1.55;
|
||
white-space: normal; // 放得下时保持单行(原 nowrap 的观感),放不下时折行而不是横向溢出
|
||
user-select: none;
|
||
|
||
.footer-sep {
|
||
margin: 0 8px;
|
||
opacity: 0.55;
|
||
}
|
||
|
||
// 售后微信:点击复制(固定底栏下 pointer-events:none,这里单独放行)
|
||
.footer-wechat {
|
||
cursor: pointer;
|
||
pointer-events: auto;
|
||
|
||
&:hover {
|
||
color: #0e9384;
|
||
}
|
||
}
|
||
|
||
:deep(a) {
|
||
color: #838587;
|
||
text-decoration: none;
|
||
|
||
&:hover {
|
||
color: #0e9384;
|
||
}
|
||
}
|
||
|
||
// 功能页:固定在视口底部居中,且滚动区为其预留一条独立底栏(见 MenuLayout 的 height 规则),
|
||
// 因此既不占文档流(不会把"刚好一屏"的页面顶出滚动条),也不会压在工具内容之上
|
||
&.fixed {
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 12px;
|
||
z-index: 350;
|
||
margin: 0;
|
||
padding: 0;
|
||
pointer-events: none; // 不拦截下方内容点击,仅链接可点
|
||
|
||
:deep(a) {
|
||
pointer-events: auto;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 功能页:内容滚动区高度 = 100% - 底栏(44px),让页脚显示在功能区域外面,且不产生滚动条
|
||
// (注意:不能用 padding-bottom 留白,那会把"刚好一屏"的页面顶出滚动条)
|
||
.menu-layout.fixed-footer :deep(.content .n-layout-scroll-container) {
|
||
height: calc(100% - 44px);
|
||
padding-bottom: 0;
|
||
}
|
||
|
||
// 顶部导航:滚动时固定在最顶部(sticky),通栏贴顶遮挡滚动内容
|
||
.v6-switch {
|
||
// 顶栏内正常排版(紧跟「授权应用」之后),不悬浮、不遮挡
|
||
font-size: 13px;
|
||
white-space: nowrap;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
// 右上角「留言反馈」入口:与顶栏其它文字按钮同规格
|
||
.feedback-btn {
|
||
font-size: 13px;
|
||
white-space: nowrap;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
// 右上角:授权系统公告(铃铛 + 未读红点 + 下拉面板)
|
||
.ann-wrap {
|
||
position: relative;
|
||
flex-shrink: 0;
|
||
}
|
||
.ann-btn {
|
||
position: relative;
|
||
font-size: 13px;
|
||
padding-left: 8px;
|
||
padding-right: 12px;
|
||
}
|
||
.ann-dot {
|
||
position: absolute;
|
||
top: 5px;
|
||
right: 6px;
|
||
width: 8px;
|
||
height: 8px;
|
||
border-radius: 50%;
|
||
background: #ff4d4f;
|
||
box-shadow: 0 0 0 2px v-bind('themeVars.bodyColor');
|
||
}
|
||
.ann-panel {
|
||
position: fixed;
|
||
top: 60px;
|
||
right: 26px;
|
||
z-index: 3000;
|
||
width: 320px;
|
||
max-width: 84vw;
|
||
background: v-bind('themeVars.bodyColor');
|
||
border: 1px solid v-bind('themeVars.textColor3');
|
||
border-radius: 10px;
|
||
box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
|
||
overflow: hidden;
|
||
text-align: left;
|
||
}
|
||
.ann-panel-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
padding: 10px 12px;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
border-bottom: 1px solid v-bind('themeVars.textColor3');
|
||
}
|
||
.ann-readall {
|
||
border: none;
|
||
background: none;
|
||
padding: 0;
|
||
font-size: 12px;
|
||
color: v-bind('themeVars.primaryColor');
|
||
cursor: pointer;
|
||
}
|
||
.ann-panel-body {
|
||
max-height: 300px;
|
||
overflow-y: auto;
|
||
padding: 6px 0;
|
||
}
|
||
.ann-empty {
|
||
padding: 18px 12px;
|
||
text-align: center;
|
||
font-size: 13px;
|
||
opacity: 0.6;
|
||
}
|
||
.ann-item {
|
||
padding: 8px 12px;
|
||
cursor: pointer;
|
||
border-left: 3px solid transparent;
|
||
|
||
&:hover {
|
||
background: rgba(128, 128, 128, 0.12);
|
||
}
|
||
&.is-unread {
|
||
border-left-color: #ff4d4f;
|
||
}
|
||
}
|
||
.ann-item-head {
|
||
display: flex;
|
||
align-items: baseline;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
font-size: 13px;
|
||
|
||
b {
|
||
flex: 1;
|
||
min-width: 0;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
}
|
||
.ann-time {
|
||
flex-shrink: 0;
|
||
font-size: 11px;
|
||
opacity: 0.55;
|
||
}
|
||
.ann-content {
|
||
margin-top: 2px;
|
||
font-size: 12px;
|
||
line-height: 1.5;
|
||
opacity: 0.85;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 3;
|
||
-webkit-box-orient: vertical;
|
||
overflow: hidden;
|
||
word-break: break-word;
|
||
}
|
||
|
||
// 右上角:当前版本号徽标
|
||
.ver-badge {
|
||
flex-shrink: 0;
|
||
align-self: center;
|
||
padding: 4px 9px;
|
||
border-radius: 999px;
|
||
font-size: 11px;
|
||
line-height: 1;
|
||
white-space: nowrap;
|
||
cursor: default;
|
||
background: rgba(128, 128, 128, 0.16);
|
||
border: 1px solid v-bind('themeVars.textColor3');
|
||
color: v-bind('themeVars.textColor2');
|
||
}
|
||
|
||
// 授权系统公告推送弹窗(每条只弹一次)
|
||
.ann-popup-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 6000;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 20px;
|
||
background: rgba(0, 0, 0, 0.45);
|
||
}
|
||
.ann-popup {
|
||
width: 380px;
|
||
max-width: 92vw;
|
||
padding: 18px 20px 16px;
|
||
border-radius: 12px;
|
||
background: v-bind('themeVars.bodyColor');
|
||
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
|
||
text-align: left;
|
||
}
|
||
.ann-popup-head {
|
||
margin-bottom: 8px;
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
}
|
||
.ann-popup-title {
|
||
margin-bottom: 6px;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
}
|
||
.ann-popup-content {
|
||
font-size: 13px;
|
||
line-height: 1.7;
|
||
opacity: 0.9;
|
||
white-space: pre-wrap;
|
||
word-break: break-word;
|
||
}
|
||
.ann-popup-time {
|
||
margin-top: 8px;
|
||
font-size: 11px;
|
||
opacity: 0.5;
|
||
}
|
||
.ann-popup-ok {
|
||
width: 100%;
|
||
margin-top: 14px;
|
||
}
|
||
|
||
@media (max-width: 900px) {
|
||
// 窄屏顶栏放不下完整文字时收缩为纯图标,并收紧间距,避免溢出右边缘
|
||
.top-nav {
|
||
gap: 4px;
|
||
}
|
||
.v6-switch {
|
||
.v6-text {
|
||
display: none;
|
||
}
|
||
padding-left: 8px;
|
||
padding-right: 8px;
|
||
}
|
||
.feedback-btn {
|
||
.feedback-btn-text {
|
||
display: none;
|
||
}
|
||
padding-left: 8px;
|
||
padding-right: 8px;
|
||
}
|
||
}
|
||
|
||
.top-nav {
|
||
position: sticky;
|
||
// -26px 抵消滚动容器 padding-top 内缩,使导航真正贴到视口最顶(0)
|
||
top: -26px;
|
||
z-index: 200;
|
||
// 通栏:抵消滚动容器的 26px padding
|
||
margin: -26px -26px 0 -26px;
|
||
padding: 12px 26px;
|
||
background: v-bind('themeVars.bodyColor');
|
||
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.sider-content {
|
||
padding-top: 160px;
|
||
padding-bottom: 200px;
|
||
}
|
||
|
||
.hero-wrapper {
|
||
position: absolute;
|
||
display: block;
|
||
left: 0;
|
||
width: 100%;
|
||
z-index: 10;
|
||
overflow: hidden;
|
||
|
||
.gradient {
|
||
margin-top: -65px;
|
||
}
|
||
|
||
.text-wrapper {
|
||
position: absolute;
|
||
left: 0;
|
||
width: 100%;
|
||
text-align: center;
|
||
top: 16px;
|
||
color: #fff;
|
||
|
||
.title {
|
||
font-size: 25px;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.divider {
|
||
width: 50px;
|
||
height: 2px;
|
||
border-radius: 4px;
|
||
background-color: v-bind('themeVars.primaryColor');
|
||
margin: 0 auto 5px;
|
||
}
|
||
|
||
.subtitle {
|
||
font-size: 16px;
|
||
}
|
||
}
|
||
}
|
||
</style>
|