From 09084eef214a30f8fe547ede07de2d42b8fab3af Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Wed, 24 Sep 2025 07:26:08 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E7=89=88=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(content)/(user)/dashboard/content.tsx | 147 ++++++++++++++---- apps/user/assets/svg-icon/Group 75.svg | 25 +++ apps/user/assets/svg-icon/Group 77.svg | 22 +++ 3 files changed, 164 insertions(+), 30 deletions(-) create mode 100644 apps/user/assets/svg-icon/Group 75.svg create mode 100644 apps/user/assets/svg-icon/Group 77.svg diff --git a/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx b/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx index f1b2e09..03e279c 100644 --- a/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx +++ b/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx @@ -7,6 +7,7 @@ import useGlobalStore from '@/config/use-global'; import { getStat } from '@/services/common/common'; import { queryUserSubscribe } from '@/services/user/user'; import { useQuery } from '@tanstack/react-query'; +import { AiroButton } from '@workspace/airo-ui/components/AiroButton'; import { Button } from '@workspace/airo-ui/components/button'; import { Card } from '@workspace/airo-ui/components/card'; import { useTranslations } from 'next-intl'; @@ -23,6 +24,7 @@ import { PopupRef, } from '@/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup'; import { Empty } from '@/components/empty'; +import SvgIcon from '@/components/SvgIcon'; import { queryAnnouncement } from '@/services/user/announcement'; import { queryOrderList } from '@/services/user/order'; import { default as Airo_Empty } from '@workspace/airo-ui/custom-components/empty'; @@ -91,11 +93,120 @@ export default function Content() { const popupRef = useRef(null); const dialogRef = useRef(null); + + function openPopupWindow(item) { + // features 字符串用于控制窗口的特性 + const pageWidth = 600; // 弹出窗口的宽度 + const pageHeight = 550; // 弹出窗口的高度 + const { + availLeft, // 返回浏览器可用空间左边距离屏幕(系统桌面)左边界的距离。 + availHeight, // 浏览器在显示屏上的可用高度,即当前屏幕高度 + availWidth, // 浏览器在显示屏上的可用宽度,即当前屏幕宽度 + } = window.screen; + const pageTop = (availHeight - pageHeight) / 2; // 窗口的垂直位置 + let pageLeft = (availWidth - pageWidth) / 2; // 窗口的水平位置; + + pageLeft += availLeft; // 加上屏幕偏移值 + + const features = `width=${pageWidth},height=${pageHeight},left=${pageLeft},top=${pageTop},toolbar=no,location=no,menubar=no`; + console.log(features); + window.open(item.download, item.title, features); + } + return ( <> -
+
+ {/* 快捷下载 Card */} + +
+

快捷下载

+
+
+ 选择对应操作系统下载客户端 +
+ +
+ {[ + { + label: 'iOS', + icon: 'Group 77', + href: 'https://apps.apple.com/us/app/shadowrocket/id932747118?l=zh-Hans-CN', + }, + { + label: 'Mac', + icon: 'Group 77', + href: 'https://apps.apple.com/us/app/shadowrocket/id932747118?l=zh-Hans-CN', + }, + { label: 'Win', icon: 'Group 75', href: '' }, + { label: 'Android', icon: 'Group 75', href: '' }, + ].map((v) => { + return ( + +
+ +
+ {v.label} +
+ ); + })} +
+
+ 免费美区Apple ID + { + openPopupWindow({ + download: 'https://aunlock.laomaos.com/share/DEXVzMSP', + title: 'Shadowrocket', + }); + }} + > + 获取 + +
+
+ + {/* 我的订阅 Card */} + +
+
+

+ {t('mySubscription')} +

+ + {t('beginnerTutorial')} + +
+
+ 复制订阅链接或点击二维码按钮扫码 +
+
+ + {userSubscribe?.[0] && data?.protocol ? ( + + ) : ( + + )} +
+ {/* 账户概况 Card */} - +

{t('accountOverview')} @@ -120,7 +231,7 @@ export default function Content() { {t('accountBalance')}

@@ -131,7 +242,7 @@ export default function Content() {
{/* 套餐状态 Card */} - +

@@ -224,8 +335,9 @@ export default function Content() { )} + {/* 网站公告 Card */} - +

{t('siteAnnouncements')} @@ -282,31 +394,6 @@ export default function Content() { - - {/* 我的订阅 Card */} - -
-

- {t('mySubscription')} -

- - {t('beginnerTutorial')} - -
- - {userSubscribe?.[0] && data?.protocol ? ( - - ) : ( - - )} -

); diff --git a/apps/user/assets/svg-icon/Group 75.svg b/apps/user/assets/svg-icon/Group 75.svg new file mode 100644 index 0000000..76aeb25 --- /dev/null +++ b/apps/user/assets/svg-icon/Group 75.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/user/assets/svg-icon/Group 77.svg b/apps/user/assets/svg-icon/Group 77.svg new file mode 100644 index 0000000..c3fbf70 --- /dev/null +++ b/apps/user/assets/svg-icon/Group 77.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +