动态生成购买套餐 & 取消初次进后台修改密码的弹窗 & 添加总折扣字段 & 发布v1.5.0版本

This commit is contained in:
Eamon-meng
2026-04-16 14:41:42 +08:00
parent 319baea5e8
commit 5607217625
25 changed files with 619 additions and 273 deletions

View File

@@ -2,7 +2,6 @@
import {ReactNode, Suspense, use, useState} from 'react'
import Image from 'next/image'
import Link from 'next/link'
import {ChangePasswordDialog} from '@/components/composites/dialogs/change-password-dialog'
import {RealnameAuthDialog} from '@/components/composites/dialogs/realname-auth-dialog'
import UserCenter from '@/components/composites/user-center'
import {Button} from '@/components/ui/button'
@@ -75,6 +74,7 @@ export function Content(props: {children: ReactNode}) {
}
function ContentResolved() {
const profile = use(useProfileStore(store => store.profile))
if (profile)
return (
<>
@@ -82,10 +82,10 @@ function ContentResolved() {
triggerClassName="hidden"
defaultOpen={!profile.id_token}
/>
<ChangePasswordDialog
{/* <ChangePasswordDialog
triggerClassName="hidden"
defaultOpen={!profile.has_password}
/>
/> */}
</>
)
}

View File

@@ -78,8 +78,8 @@ export function BasicForm(props: {
}) {
const schema = z.object({
username: z.string(),
email: z.string(),
contact_qq: z.string(),
email: z.string().email('请输入正确的邮箱格式').or(z.literal('')),
contact_qq: z.string().regex(/^\d*$/, 'QQ号只能包含数字'),
contact_wechat: z.string(),
})
type Schema = z.infer<typeof schema>

View File

@@ -3,16 +3,17 @@ import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card'
import {CheckCircle} from 'lucide-react'
import Image from 'next/image'
import banner from '@/app/admin/identify/_assets/banner.webp'
import RechargeModal from '@/components/composites/recharge'
import {RealnameAuthDialog} from '@/components/composites/dialogs/realname-auth-dialog'
import {ChangePasswordDialog} from '@/components/composites/dialogs/change-password-dialog'
import {getProfile} from '@/actions/auth'
import {Aftersale, BasicForm} from './clients'
import {Button} from '@/components/ui/button'
import Link from 'next/link'
export type ProfilePageProps = {}
export default async function ProfilePage(props: ProfilePageProps) {
const profile = await getProfile()
if (!profile.success) {
return (
<Page>
@@ -22,6 +23,7 @@ export default async function ProfilePage(props: ProfilePageProps) {
}
const user = profile.data
return (
<Page className="lg:flex-row lg:items-stretch md:flex-col max-sm:flex-col">
<div className="flex-3/4 flex flex-col gap-4">
@@ -34,26 +36,13 @@ export default async function ProfilePage(props: ProfilePageProps) {
{/* 块信息 */}
<div className="flex gap-4 max-md:flex-col max-sm:flex-col">
{/* <Card className="flex-1 ">
<CardHeader>
<CardTitle className="font-normal">账户余额(元)</CardTitle>
</CardHeader>
<CardContent className="flex-auto flex justify-between items-center px-8">
<p className="text-xl">{user.balance}</p>
<RechargeModal classNames={{
trigger: `h-10 px-6`,
}}/>
</CardContent>
</Card> */}
<Card className="flex-1 ">
<CardHeader>
<CardTitle className="font-normal"></CardTitle>
</CardHeader>
<CardContent className="flex-auto flex justify-between items-center px-8">
<p>{user.phone}</p>
<ChangePasswordDialog triggerClassName="w-24 h-9"/>
<ChangePasswordDialog triggerClassName="w-24 h-9" phone={user?.phone}/>
</CardContent>
</Card>
@@ -66,10 +55,13 @@ export default async function ProfilePage(props: ProfilePageProps) {
? (
<>
<p className="text-sm">使</p>
<RealnameAuthDialog
defaultOpen={!user.id_token}
{/* <RealnameAuthDialog
// defaultOpen={!user.id_token}
triggerClassName="w-24"
/>
/> */}
<Link href="/admin/identify">
<Button></Button>
</Link>
</>
)
: (

View File

@@ -219,6 +219,17 @@ export default function ResourceList({resourceType}: ResourceListProps) {
header: '开通时间',
cell: ({row}) => formatDateTime(row.original.created_at),
},
{
header: '状态',
cell: ({row}) => {
const isActive = row.original.active
return (
<span className={isActive ? 'text-green-500' : 'text-red-500'}>
{isActive ? '启用' : '禁用'}
</span>
)
},
},
]
// 短效资源增加到期时间列