From 5524d25d9afdcbcc67b302e0240e52d0ed891145 Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Fri, 15 Aug 2025 03:22:14 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/.env | 2 +- .../dashboard/auth-control/general/invite.tsx | 44 ++++++++++++++++--- .../dashboard/subscribe/subscribe-form.tsx | 2 - apps/user/.env | 2 +- .../app/(main)/(content)/(user)/Header.tsx | 2 +- .../app/(main)/(content)/(user)/layout.tsx | 4 +- .../(main)/(content)/(user)/order/page.tsx | 36 +++++++++++++-- .../(content)/(user)/subscribe/page.tsx | 2 +- .../(main)/(content)/(user)/ticket/page.tsx | 6 +-- apps/user/app/auth/email/login-form.tsx | 2 +- apps/user/app/layout.tsx | 2 +- apps/user/assets/svg-icon/language-zh.svg | 4 ++ apps/user/assets/svg-icon/language.svg | 2 +- .../SubscribePlan/PlanTabs/PlanTabs.tsx | 4 +- apps/user/components/affiliate/index.tsx | 4 +- apps/user/components/language-switch.tsx | 7 ++- apps/user/components/subscribe/renewal.tsx | 38 +++------------- apps/user/components/user-nav.tsx | 2 +- .../airo-ui/src/components/AiroButton.tsx | 1 + packages/airo-ui/src/components/input.tsx | 2 +- .../pro-list/column-filter.tsx | 4 +- .../custom-components/pro-list/pro-list.tsx | 23 +++++++--- scripts/prepare.sh | 6 +-- scripts/publish.sh | 4 +- 24 files changed, 128 insertions(+), 77 deletions(-) create mode 100644 apps/user/assets/svg-icon/language-zh.svg diff --git a/apps/admin/.env b/apps/admin/.env index 19c1c8e..b279b26 100644 --- a/apps/admin/.env +++ b/apps/admin/.env @@ -1,5 +1,5 @@ # Default Language -NEXT_PUBLIC_DEFAULT_LANGUAGE=en-US +NEXT_PUBLIC_DEFAULT_LANGUAGE=zh-CN # Site URL and API URL NEXT_PUBLIC_SITE_URL=https://admin.ppanel.dev diff --git a/apps/admin/app/dashboard/auth-control/general/invite.tsx b/apps/admin/app/dashboard/auth-control/general/invite.tsx index 0b71f42..848bd3d 100644 --- a/apps/admin/app/dashboard/auth-control/general/invite.tsx +++ b/apps/admin/app/dashboard/auth-control/general/invite.tsx @@ -62,20 +62,52 @@ export function Invite() { - -

- {t('inviteCommissionPercentageDescription')} -

+ +

updateConfig('referral_percentage', value)} + onValueBlur={(value) => updateConfig('first_yearly_purchase_percentage', value)} + /> + +
+ + + +

+
+ + updateConfig('first_purchase_percentage', value)} + /> + +
+ + + +

+
+ + updateConfig('non_first_purchase_percentage', value)} />
diff --git a/apps/admin/app/dashboard/subscribe/subscribe-form.tsx b/apps/admin/app/dashboard/subscribe/subscribe-form.tsx index 634f7cc..e267045 100644 --- a/apps/admin/app/dashboard/subscribe/subscribe-form.tsx +++ b/apps/admin/app/dashboard/subscribe/subscribe-form.tsx @@ -656,9 +656,7 @@ export default function SubscribeForm>({ { name: 'discount', type: 'number', - min: 0.01, max: 100, - step: 0.01, placeholder: t('form.discountPercent'), suffix: '%', }, diff --git a/apps/user/.env b/apps/user/.env index 73941d3..681b33c 100644 --- a/apps/user/.env +++ b/apps/user/.env @@ -1,5 +1,5 @@ # Default Language -NEXT_PUBLIC_DEFAULT_LANGUAGE=en-US +NEXT_PUBLIC_DEFAULT_LANGUAGE=zh-CN # Site URL and API URL NEXT_PUBLIC_SITE_URL=https://user.ppanel.dev diff --git a/apps/user/app/(main)/(content)/(user)/Header.tsx b/apps/user/app/(main)/(content)/(user)/Header.tsx index 30de089..f464658 100644 --- a/apps/user/app/(main)/(content)/(user)/Header.tsx +++ b/apps/user/app/(main)/(content)/(user)/Header.tsx @@ -18,7 +18,7 @@ export function Header() { const pathname = usePathname(); const items = useMemo(() => findNavByUrl(pathname), [pathname]); return ( -
+
diff --git a/apps/user/app/(main)/(content)/(user)/layout.tsx b/apps/user/app/(main)/(content)/(user)/layout.tsx index f9733e9..6672193 100644 --- a/apps/user/app/(main)/(content)/(user)/layout.tsx +++ b/apps/user/app/(main)/(content)/(user)/layout.tsx @@ -13,8 +13,8 @@ export default async function DashboardLayout({ children }: { children: React.Re {/**/} -
-
+
+
{children}
diff --git a/apps/user/app/(main)/(content)/(user)/order/page.tsx b/apps/user/app/(main)/(content)/(user)/order/page.tsx index 10c16e2..02ea585 100644 --- a/apps/user/app/(main)/(content)/(user)/order/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/order/page.tsx @@ -31,13 +31,13 @@ export default function Page() { }} renderItem={(item) => { return ( - +
{t('orderNo')}

{item.order_no}

-
+
{item.status === 1 ? ( <> )}
+
+ { + await closeOrder({ orderNo: item.order_no }); + ref.current?.refresh(); + }} + > + {t('cancelOrder')} + +
- +
  • {t('name')} @@ -88,6 +100,24 @@ export default function Page() {
+
+ {item.status === 1 ? ( + <> + + + {t('payment')} + + + + ) : ( + OrderDetailDialogRef?.current?.show(item.order_no)} + > + {t('detail')} + + )} +
); diff --git a/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx b/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx index 0e5e14a..2b5ef8b 100644 --- a/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx @@ -38,7 +38,7 @@ export default function Page() {
{t('description')} diff --git a/apps/user/app/(main)/(content)/(user)/ticket/page.tsx b/apps/user/app/(main)/(content)/(user)/ticket/page.tsx index 7b3d954..1c81f2c 100644 --- a/apps/user/app/(main)/(content)/(user)/ticket/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/ticket/page.tsx @@ -158,8 +158,8 @@ export default function Page() { }} renderItem={(item) => { return ( - - + + - +
  • {t('title')} diff --git a/apps/user/app/auth/email/login-form.tsx b/apps/user/app/auth/email/login-form.tsx index 187e034..805b3f5 100644 --- a/apps/user/app/auth/email/login-form.tsx +++ b/apps/user/app/auth/email/login-form.tsx @@ -87,7 +87,7 @@ export default function LoginForm({ className={ 'h-[60px] rounded-[20px] text-xl shadow-[inset_0_0_7.6px_0_#00000040]' } - placeholder='password' + placeholder='Password' type='password' {...field} /> diff --git a/apps/user/app/layout.tsx b/apps/user/app/layout.tsx index 0f412f0..fc1b16f 100644 --- a/apps/user/app/layout.tsx +++ b/apps/user/app/layout.tsx @@ -108,7 +108,7 @@ export default async function RootLayout({ diff --git a/apps/user/assets/svg-icon/language-zh.svg b/apps/user/assets/svg-icon/language-zh.svg new file mode 100644 index 0000000..978aeac --- /dev/null +++ b/apps/user/assets/svg-icon/language-zh.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/user/assets/svg-icon/language.svg b/apps/user/assets/svg-icon/language.svg index 64da1cd..8336544 100644 --- a/apps/user/assets/svg-icon/language.svg +++ b/apps/user/assets/svg-icon/language.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/user/components/SubscribePlan/PlanTabs/PlanTabs.tsx b/apps/user/components/SubscribePlan/PlanTabs/PlanTabs.tsx index 9d7b149..28c47b1 100644 --- a/apps/user/components/SubscribePlan/PlanTabs/PlanTabs.tsx +++ b/apps/user/components/SubscribePlan/PlanTabs/PlanTabs.tsx @@ -34,10 +34,10 @@ const PlanTabs: React.FC = (props) => { > {tabValue === 'year' ? ( - + -{props.discount}%{/* 小三角箭头 */} diff --git a/apps/user/components/affiliate/index.tsx b/apps/user/components/affiliate/index.tsx index a351208..383bf06 100644 --- a/apps/user/components/affiliate/index.tsx +++ b/apps/user/components/affiliate/index.tsx @@ -74,8 +74,8 @@ export default function Affiliate() { {inviteListData?.total}
-
-

+

+

{t('totalCommission')}

diff --git a/apps/user/components/language-switch.tsx b/apps/user/components/language-switch.tsx index 0282489..69899f8 100644 --- a/apps/user/components/language-switch.tsx +++ b/apps/user/components/language-switch.tsx @@ -45,7 +45,7 @@ export default function LanguageSwitch() { return (

{ console.log(locale, 111); if (locale === 'en-US') { @@ -55,7 +55,10 @@ export default function LanguageSwitch() { } }} > - + {languages[locale as keyof typeof languages]}
diff --git a/apps/user/components/subscribe/renewal.tsx b/apps/user/components/subscribe/renewal.tsx index b80125a..5261cdc 100644 --- a/apps/user/components/subscribe/renewal.tsx +++ b/apps/user/components/subscribe/renewal.tsx @@ -1,6 +1,7 @@ 'use client'; import PaymentMethods from '@/components/subscribe/payment-methods'; +import PlanTabs from '@/components/SubscribePlan/PlanTabs/PlanTabs'; import useGlobalStore from '@/config/use-global'; import { preCreateOrder, renewal } from '@/services/user/order'; import { useQuery } from '@tanstack/react-query'; @@ -14,7 +15,6 @@ import { DialogTrigger, } from '@workspace/airo-ui/components/dialog'; import { Separator } from '@workspace/airo-ui/components/separator'; -import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; @@ -115,11 +115,9 @@ export default function Renewal({ id, subscribe, className }: Readonly
- { + { if (val === 'year') { handleChange('quantity', 12); } else if (val === 'month') { @@ -127,32 +125,8 @@ export default function Renewal({ id, subscribe, className }: Readonly - - {tabValue === 'year' ? ( - - {t('discount20')} - {/* 小三角箭头 */} - - - ) : null} - - {t('yearlyPlan')} - - - {t('monthlyPlan')} - - - + discount={20} + />
diff --git a/apps/user/components/user-nav.tsx b/apps/user/components/user-nav.tsx index 71ea34f..652685f 100644 --- a/apps/user/components/user-nav.tsx +++ b/apps/user/components/user-nav.tsx @@ -63,7 +63,7 @@ export function UserNav({ from = '' }: { from?: string }) { forceMount align='end' side={from === 'profile' ? (isMobile ? 'top' : 'right') : undefined} - className='mt-[1px] flex w-[var(--sidebar-width)] flex-col gap-1 rounded-[28px] border-0 bg-transparent pl-[26px] pr-4 shadow-none md:w-48 md:gap-3 md:border md:bg-white md:p-3' + className='mt-[1px] flex w-[var(--sidebar-width)] flex-col gap-1 rounded-[28px] border-0 bg-transparent p-0 pl-[26px] pr-4 shadow-none md:w-48 md:gap-3 md:border md:bg-white md:p-3' style={{ '--sidebar-width': '14rem', }} diff --git a/packages/airo-ui/src/components/AiroButton.tsx b/packages/airo-ui/src/components/AiroButton.tsx index 19c80bb..d170ae8 100644 --- a/packages/airo-ui/src/components/AiroButton.tsx +++ b/packages/airo-ui/src/components/AiroButton.tsx @@ -12,6 +12,7 @@ const buttonVariants = cva( default: 'bg-[#0F2C53] text-primary-foreground shadow hover:bg-[#225BA9]', primary: 'bg-[#225BA9] text-primary-foreground shadow hover:bg-[#0F2C53] ', danger: 'bg-[#FF4248] text-primary-foreground shadow hover:bg-[#E22C2E]', + dangerLink: 'text-[#E22C2E] ', destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground', diff --git a/packages/airo-ui/src/components/input.tsx b/packages/airo-ui/src/components/input.tsx index 6053b82..25ffac6 100644 --- a/packages/airo-ui/src/components/input.tsx +++ b/packages/airo-ui/src/components/input.tsx @@ -8,7 +8,7 @@ const Input = React.forwardRef>( ({ table, params, filters }: ColumnFilterProp return ( { @@ -48,7 +48,7 @@ export function ColumnFilter({ table, params, filters }: ColumnFilterProp return ( updateFilter(param.key, event.target.value)} diff --git a/packages/airo-ui/src/custom-components/pro-list/pro-list.tsx b/packages/airo-ui/src/custom-components/pro-list/pro-list.tsx index b2c839f..ba39758 100644 --- a/packages/airo-ui/src/custom-components/pro-list/pro-list.tsx +++ b/packages/airo-ui/src/custom-components/pro-list/pro-list.tsx @@ -134,13 +134,22 @@ export function ProList>({ return (
-
+
{params ? ( - [item.id, item.value]))} - /> +
+ [item.id, item.value]))} + /> + +
) : ( header?.title )} @@ -150,7 +159,7 @@ export function ProList>({ <>