样式和代码结构调整
This commit is contained in:
@@ -77,7 +77,7 @@ export default function LoginCard(props: {
|
|||||||
const [showPwd, setShowPwd] = useState(false)
|
const [showPwd, setShowPwd] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="w-96 mx-4 shadow-lg relative z-20">
|
<Card className="w-96 mx-4 shadow-lg relative z-20 py-8">
|
||||||
<CardContent className="px-8">
|
<CardContent className="px-8">
|
||||||
{/* 登录方式切换 */}
|
{/* 登录方式切换 */}
|
||||||
<Tabs
|
<Tabs
|
||||||
@@ -87,7 +87,7 @@ export default function LoginCard(props: {
|
|||||||
form.reset({username: form.getValues('username'), password: '', remember: false})
|
form.reset({username: form.getValues('username'), password: '', remember: false})
|
||||||
}}
|
}}
|
||||||
className="mb-6">
|
className="mb-6">
|
||||||
<TabsList className="w-full p-2 bg-white rounded-lg justify-start md:justify-center overflow-auto">
|
<TabsList className="w-full p-0 bg-white">
|
||||||
<Tab value="password">密码登录</Tab>
|
<Tab value="password">密码登录</Tab>
|
||||||
<Tab value="phone_code">验证码登录</Tab>
|
<Tab value="phone_code">验证码登录</Tab>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
@@ -99,7 +99,7 @@ export default function LoginCard(props: {
|
|||||||
{...field}
|
{...field}
|
||||||
id={id}
|
id={id}
|
||||||
type="tel"
|
type="tel"
|
||||||
placeholder="请输入手机号"
|
placeholder={mode === 'phone_code' ? '请输入手机号' : '请输入用户名'}
|
||||||
autoComplete="tel-national"
|
autoComplete="tel-national"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -113,6 +113,7 @@ export default function LoginCard(props: {
|
|||||||
id={id}
|
id={id}
|
||||||
className="h-10"
|
className="h-10"
|
||||||
placeholder="请输入验证码"
|
placeholder="请输入验证码"
|
||||||
|
autoComplete="one-time-code"
|
||||||
/>
|
/>
|
||||||
<Captcha/>
|
<Captcha/>
|
||||||
</div>
|
</div>
|
||||||
@@ -180,17 +181,13 @@ export default function LoginCard(props: {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Tab(props: {
|
function Tab(props: {
|
||||||
value: string
|
value: string
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
className={merge(
|
className="h-12 text-base data-[state=active]:text-primary data-[state=active]:bg-primary-muted"
|
||||||
`w-36 h-12 text-base font-normal flex-none`,
|
|
||||||
`data-[state=active]:text-primary data-[state=active]:bg-primary-muted`,
|
|
||||||
)}
|
|
||||||
value={props.value}
|
value={props.value}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|||||||
@@ -90,16 +90,6 @@ export default function BillsPage(props: BillsPageProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Form form={form} onSubmit={onSubmit} className="flex items-end gap-4 flex-wrap">
|
<Form form={form} onSubmit={onSubmit} className="flex items-end gap-4 flex-wrap">
|
||||||
{/* <FormField name="trade_id" label={<span className="text-sm">订单号</span>}>
|
|
||||||
{({id, field}) => (
|
|
||||||
<Input
|
|
||||||
{...field}
|
|
||||||
id={id}
|
|
||||||
className="h-9 text-sm"
|
|
||||||
placeholder="输入订单号"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</FormField> */}
|
|
||||||
<FormField name="type" label={<span className="text-sm">账单类型</span>}>
|
<FormField name="type" label={<span className="text-sm">账单类型</span>}>
|
||||||
{({id, field}) => (
|
{({id, field}) => (
|
||||||
<Select value={field.value} onValueChange={field.onChange}>
|
<Select value={field.value} onValueChange={field.onChange}>
|
||||||
@@ -178,7 +168,7 @@ export default function BillsPage(props: BillsPageProps) {
|
|||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{/* 类型展示 */}
|
{/* 类型展示 */}
|
||||||
<div className="flex-shrink-0">
|
<div className="shrink-0">
|
||||||
{bill.type === 1 && (
|
{bill.type === 1 && (
|
||||||
<div className="flex gap-2 items-center bg-orange-50 w-fit px-2 py-1 rounded-md">
|
<div className="flex gap-2 items-center bg-orange-50 w-fit px-2 py-1 rounded-md">
|
||||||
<CreditCard size={16}/>
|
<CreditCard size={16}/>
|
||||||
@@ -248,21 +238,13 @@ export default function BillsPage(props: BillsPageProps) {
|
|||||||
}
|
}
|
||||||
const paymentMethod = trade ? paymentMethodMap[trade.method as keyof typeof paymentMethodMap] || '余额' : '余额'
|
const paymentMethod = trade ? paymentMethodMap[trade.method as keyof typeof paymentMethodMap] || '余额' : '余额'
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex gap-1">
|
||||||
<div className="flex gap-1">
|
<span className="text-sm">
|
||||||
<span className="text-sm">
|
{paymentMethod}
|
||||||
{paymentMethod}
|
</span>
|
||||||
</span>
|
<span className={amount > 0 ? 'text-green-500' : 'text-orange-500'}>
|
||||||
<span className={amount > 0 ? 'text-green-400' : 'text-orange-400'}>
|
¥{amount.toFixed(2)}
|
||||||
¥
|
</span>
|
||||||
{amount.toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{trade?.inner_no && (
|
|
||||||
<div className="text-xs text-gray-500">
|
|
||||||
订单号: {trade.inner_no}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,8 +18,16 @@ import personal from './_assets/personal.webp'
|
|||||||
import step1 from './_assets/step1.webp'
|
import step1 from './_assets/step1.webp'
|
||||||
import step2 from './_assets/step2.webp'
|
import step2 from './_assets/step2.webp'
|
||||||
import step3 from './_assets/step3.webp'
|
import step3 from './_assets/step3.webp'
|
||||||
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from '@/components/ui/card'
|
import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card'
|
||||||
import {CheckCircle, CheckCircleIcon, WorkflowIcon} from 'lucide-react'
|
import {CheckCircleIcon, WorkflowIcon} from 'lucide-react'
|
||||||
|
|
||||||
|
const schema = zod.object({
|
||||||
|
type: zod.enum([`personal`, `enterprise`], {errorMap: () => ({message: `请选择认证类型`})}).default('personal'),
|
||||||
|
name: zod.string().min(2, {message: `姓名至少2个字符`}),
|
||||||
|
iden_no: zod.string().length(18, {message: `身份证号码必须为18位`}),
|
||||||
|
})
|
||||||
|
|
||||||
|
type Schema = zod.infer<typeof schema>
|
||||||
|
|
||||||
export type IdentifyPageProps = {}
|
export type IdentifyPageProps = {}
|
||||||
|
|
||||||
@@ -28,13 +36,6 @@ export default function IdentifyPage(props: IdentifyPageProps) {
|
|||||||
// 填写信息
|
// 填写信息
|
||||||
// ======================
|
// ======================
|
||||||
|
|
||||||
const schema = zod.object({
|
|
||||||
type: zod.enum([`personal`, `enterprise`], {errorMap: () => ({message: `请选择认证类型`})}).default('personal'),
|
|
||||||
name: zod.string().min(2, {message: `姓名至少2个字符`}),
|
|
||||||
iden_no: zod.string().length(18, {message: `身份证号码必须为18位`}),
|
|
||||||
})
|
|
||||||
type Schema = zod.infer<typeof schema>
|
|
||||||
|
|
||||||
const form = useForm<Schema>({
|
const form = useForm<Schema>({
|
||||||
resolver: zodResolver(schema),
|
resolver: zodResolver(schema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|||||||
Reference in New Issue
Block a user