's'
This commit is contained in:
@@ -401,6 +401,19 @@
|
|||||||
padding: 0.9rem 1rem 1rem;
|
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 {
|
.modalRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|||||||
@@ -14,17 +14,7 @@ type ModalState = {
|
|||||||
link: NetdiskLink;
|
link: NetdiskLink;
|
||||||
} | null;
|
} | null;
|
||||||
|
|
||||||
function BaiduDownloadIcon() {
|
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" />
|
|
||||||
<path d="m7 10 5 5 5-5" />
|
|
||||||
<path d="M21 21H3" />
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function QuarkDownloadIcon() {
|
|
||||||
return (
|
return (
|
||||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
<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="M12 3v12" />
|
||||||
@@ -35,6 +25,7 @@ function QuarkDownloadIcon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildCopyText(resource: NetdiskResource, link: NetdiskLink) {
|
function buildCopyText(resource: NetdiskResource, link: NetdiskLink) {
|
||||||
|
if (link.copyText?.trim()) return link.copyText.trim();
|
||||||
const url = link.url?.trim() || "";
|
const url = link.url?.trim() || "";
|
||||||
const code = link.code?.trim() || "";
|
const code = link.code?.trim() || "";
|
||||||
const codeLabel = link.codeLabel || "提取码";
|
const codeLabel = link.codeLabel || "提取码";
|
||||||
@@ -111,29 +102,11 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
|||||||
{variant === "vip" && isOpen && (
|
{variant === "vip" && isOpen && (
|
||||||
<div id={`netdisk-panel-${r.id}`} className={styles.panel} role="region" aria-label={`${r.title} 链接`}>
|
<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 quark = getLinkByProvider(r, "quark");
|
||||||
const baiduUrl = baidu?.url?.trim() || "";
|
|
||||||
const quarkUrl = quark?.url?.trim() || "";
|
const quarkUrl = quark?.url?.trim() || "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.iconRow} aria-label="下载图标">
|
<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
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`${styles.netdiskIconBtn} ${!quarkUrl ? styles.netdiskIconBtnDisabled : ""}`}
|
className={`${styles.netdiskIconBtn} ${!quarkUrl ? styles.netdiskIconBtnDisabled : ""}`}
|
||||||
@@ -143,10 +116,10 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
|||||||
}}
|
}}
|
||||||
disabled={!quarkUrl}
|
disabled={!quarkUrl}
|
||||||
aria-disabled={!quarkUrl}
|
aria-disabled={!quarkUrl}
|
||||||
title={quarkUrl ? "打开分享链接" : "链接待补充"}
|
title={quarkUrl ? "打开夸克网盘分享" : "链接待补充"}
|
||||||
>
|
>
|
||||||
<span className={styles.iconColorQuark} aria-hidden="true">
|
<span className={styles.iconColorQuark} aria-hidden="true">
|
||||||
<QuarkDownloadIcon />
|
<DownloadIcon />
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,7 +146,7 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
|||||||
<div className={styles.modalHeader}>
|
<div className={styles.modalHeader}>
|
||||||
<div className={styles.modalTitleRow}>
|
<div className={styles.modalTitleRow}>
|
||||||
<span className={styles.modalIcon} aria-hidden="true">
|
<span className={styles.modalIcon} aria-hidden="true">
|
||||||
{modal.link.provider === "baidu" ? <BaiduDownloadIcon /> : <QuarkDownloadIcon />}
|
<DownloadIcon />
|
||||||
</span>
|
</span>
|
||||||
<div className={styles.modalTitle}>{modal.resource.title}</div>
|
<div className={styles.modalTitle}>{modal.resource.title}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -186,16 +159,8 @@ export function NetdiskDownloadsSection({ variant, onRequireVip }: { variant: Va
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.modalBody}>
|
<div className={styles.modalBody}>
|
||||||
<div className={styles.modalRow}>
|
<div className={styles.modalPre} aria-label="网盘分享内容">
|
||||||
<div className={styles.modalLabel}>分享链接</div>
|
{buildCopyText(modal.resource, modal.link)}
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ export type NetdiskLink = {
|
|||||||
url?: string;
|
url?: string;
|
||||||
codeLabel?: string;
|
codeLabel?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
|
/**
|
||||||
|
* 弹窗内“一键复制”的整段内容(用于网盘 App 识别/导入)。
|
||||||
|
* 为空时会回退到 title + url + code 的组合文案。
|
||||||
|
*/
|
||||||
|
copyText?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NetdiskResource = {
|
export type NetdiskResource = {
|
||||||
@@ -27,20 +32,14 @@ export const NETDISK_RESOURCES: NetdiskResource[] = [
|
|||||||
desc: "系统镜像、固件与驱动相关资源,适合装机/刷机/修复。",
|
desc: "系统镜像、固件与驱动相关资源,适合装机/刷机/修复。",
|
||||||
tags: ["系统固件", "镜像", "驱动"],
|
tags: ["系统固件", "镜像", "驱动"],
|
||||||
links: [
|
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",
|
provider: "quark",
|
||||||
label: "夸克网盘",
|
label: "夸克网盘",
|
||||||
url: "",
|
url: "https://pan.quark.cn/s/3c8439859b8b?pwd=PLgV",
|
||||||
codeLabel: "访问码",
|
codeLabel: "提取码",
|
||||||
code: "",
|
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: "常用软件与安装包合集(例如刷机/写盘/远控/解压等)。",
|
desc: "常用软件与安装包合集(例如刷机/写盘/远控/解压等)。",
|
||||||
tags: ["软件", "安装包", "合集"],
|
tags: ["软件", "安装包", "合集"],
|
||||||
links: [
|
links: [
|
||||||
{
|
|
||||||
provider: "baidu",
|
|
||||||
label: "百度网盘",
|
|
||||||
url: "",
|
|
||||||
codeLabel: "提取码",
|
|
||||||
code: "",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
provider: "quark",
|
provider: "quark",
|
||||||
label: "夸克网盘",
|
label: "夸克网盘",
|
||||||
url: "",
|
url: "https://pan.quark.cn/s/f9f489da5777?pwd=qD61",
|
||||||
codeLabel: "访问码",
|
codeLabel: "提取码",
|
||||||
code: "",
|
code: "qD61",
|
||||||
|
copyText:
|
||||||
|
"我用夸克网盘给你分享了「直播助手.zip」,点击链接或复制整段内容,打开「夸克APP」即可获取。\n/~05213Xseol~:/\n链接:https://pan.quark.cn/s/f9f489da5777?pwd=qD61\n提取码:qD61",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user