This commit is contained in:
eric
2026-03-26 06:08:52 -05:00
parent 1a6f2511c4
commit d8bae6c180
3 changed files with 35 additions and 63 deletions

View File

@@ -401,6 +401,19 @@
padding: 0.9rem 1rem 1rem;
}
.modalPre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 0.86rem;
color: var(--foreground);
background: color-mix(in oklab, var(--card), transparent 0%);
border: 1px solid var(--border);
border-radius: 14px;
padding: 0.75rem 0.85rem;
white-space: pre-wrap;
word-break: break-word;
line-height: 1.55;
}
.modalRow {
display: flex;
gap: 1rem;

View File

@@ -14,17 +14,7 @@ type ModalState = {
link: NetdiskLink;
} | null;
function BaiduDownloadIcon() {
return (
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M12 3v12" />
<path d="m7 10 5 5 5-5" />
<path d="M21 21H3" />
</svg>
);
}
function QuarkDownloadIcon() {
function DownloadIcon() {
return (
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M12 3v12" />
@@ -35,6 +25,7 @@ function QuarkDownloadIcon() {
}
function buildCopyText(resource: NetdiskResource, link: NetdiskLink) {
if (link.copyText?.trim()) return link.copyText.trim();
const url = link.url?.trim() || "";
const code = link.code?.trim() || "";
const codeLabel = link.codeLabel || "提取码";
@@ -111,29 +102,11 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
{variant === "vip" && isOpen && (
<div id={`netdisk-panel-${r.id}`} className={styles.panel} role="region" aria-label={`${r.title} 链接`}>
{(() => {
const baidu = getLinkByProvider(r, "baidu");
const quark = getLinkByProvider(r, "quark");
const baiduUrl = baidu?.url?.trim() || "";
const quarkUrl = quark?.url?.trim() || "";
return (
<div className={styles.iconRow} aria-label="下载图标">
<button
type="button"
className={`${styles.netdiskIconBtn} ${!baiduUrl ? styles.netdiskIconBtnDisabled : ""}`}
onClick={() => {
if (!baidu || !baiduUrl) return;
setModal({ resource: r, link: baidu });
}}
disabled={!baiduUrl}
aria-disabled={!baiduUrl}
title={baiduUrl ? "打开分享链接" : "链接待补充"}
>
<span className={styles.iconColorBaidu} aria-hidden="true">
<BaiduDownloadIcon />
</span>
</button>
<button
type="button"
className={`${styles.netdiskIconBtn} ${!quarkUrl ? styles.netdiskIconBtnDisabled : ""}`}
@@ -143,10 +116,10 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
}}
disabled={!quarkUrl}
aria-disabled={!quarkUrl}
title={quarkUrl ? "打开分享链接" : "链接待补充"}
title={quarkUrl ? "打开夸克网盘分享" : "链接待补充"}
>
<span className={styles.iconColorQuark} aria-hidden="true">
<QuarkDownloadIcon />
<DownloadIcon />
</span>
</button>
</div>
@@ -173,7 +146,7 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
<div className={styles.modalHeader}>
<div className={styles.modalTitleRow}>
<span className={styles.modalIcon} aria-hidden="true">
{modal.link.provider === "baidu" ? <BaiduDownloadIcon /> : <QuarkDownloadIcon />}
<DownloadIcon />
</span>
<div className={styles.modalTitle}>{modal.resource.title}</div>
</div>
@@ -186,16 +159,8 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
</div>
<div className={styles.modalBody}>
<div className={styles.modalRow}>
<div className={styles.modalLabel}></div>
<div className={styles.modalMono} title={modal.link.url || ""}>
{modal.link.url || "链接待补充"}
</div>
</div>
<div className={styles.modalRow}>
<div className={styles.modalLabel}>{modal.link.codeLabel || "提取码"}</div>
<div className={styles.modalMono}>{modal.link.code?.trim() || "——"}</div>
<div className={styles.modalPre} aria-label="网盘分享内容">
{buildCopyText(modal.resource, modal.link)}
</div>
</div>

View File

@@ -6,6 +6,11 @@ export type NetdiskLink = {
url?: string;
codeLabel?: string;
code?: string;
/**
* 弹窗内“一键复制”的整段内容(用于网盘 App 识别/导入)。
* 为空时会回退到 title + url + code 的组合文案。
*/
copyText?: string;
};
export type NetdiskResource = {
@@ -27,20 +32,14 @@ export const NETDISK_RESOURCES: NetdiskResource[] = [
desc: "系统镜像、固件与驱动相关资源,适合装机/刷机/修复。",
tags: ["系统固件", "镜像", "驱动"],
links: [
{
provider: "baidu",
label: "百度网盘",
// 来自 app/data/cloudphone.md 的「Ubuntu Server」示例链接
url: "https://pan.baidu.com/s/1DFsdtgL-pvQt22U4MNXjHg?pwd=call",
codeLabel: "提取码",
code: "call",
},
{
provider: "quark",
label: "夸克网盘",
url: "",
codeLabel: "访问码",
code: "",
url: "https://pan.quark.cn/s/3c8439859b8b?pwd=PLgV",
codeLabel: "提取码",
code: "PLgV",
copyText:
"我用夸克网盘给你分享了「r3s-armbian-ubuntu.7z」点击链接或复制整段内容打开「夸克APP」即可获取。\n/~4adf3Xsf3S~:/\n链接https://pan.quark.cn/s/3c8439859b8b?pwd=PLgV\n提取码PLgV",
},
],
},
@@ -50,19 +49,14 @@ export const NETDISK_RESOURCES: NetdiskResource[] = [
desc: "常用软件与安装包合集(例如刷机/写盘/远控/解压等)。",
tags: ["软件", "安装包", "合集"],
links: [
{
provider: "baidu",
label: "百度网盘",
url: "",
codeLabel: "提取码",
code: "",
},
{
provider: "quark",
label: "夸克网盘",
url: "",
codeLabel: "访问码",
code: "",
url: "https://pan.quark.cn/s/f9f489da5777?pwd=qD61",
codeLabel: "提取码",
code: "qD61",
copyText:
"我用夸克网盘给你分享了「直播助手.zip」点击链接或复制整段内容打开「夸克APP」即可获取。\n/~05213Xseol~:/\n链接https://pan.quark.cn/s/f9f489da5777?pwd=qD61\n提取码qD61",
},
],
},