样式和代码结构调整
This commit is contained in:
@@ -77,7 +77,7 @@ export default function LoginCard(props: {
|
||||
const [showPwd, setShowPwd] = useState(false)
|
||||
|
||||
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">
|
||||
{/* 登录方式切换 */}
|
||||
<Tabs
|
||||
@@ -87,7 +87,7 @@ export default function LoginCard(props: {
|
||||
form.reset({username: form.getValues('username'), password: '', remember: false})
|
||||
}}
|
||||
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="phone_code">验证码登录</Tab>
|
||||
</TabsList>
|
||||
@@ -99,7 +99,7 @@ export default function LoginCard(props: {
|
||||
{...field}
|
||||
id={id}
|
||||
type="tel"
|
||||
placeholder="请输入手机号"
|
||||
placeholder={mode === 'phone_code' ? '请输入手机号' : '请输入用户名'}
|
||||
autoComplete="tel-national"
|
||||
/>
|
||||
)}
|
||||
@@ -113,6 +113,7 @@ export default function LoginCard(props: {
|
||||
id={id}
|
||||
className="h-10"
|
||||
placeholder="请输入验证码"
|
||||
autoComplete="one-time-code"
|
||||
/>
|
||||
<Captcha/>
|
||||
</div>
|
||||
@@ -180,20 +181,16 @@ export default function LoginCard(props: {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
function Tab(props: {
|
||||
value: string
|
||||
children: ReactNode
|
||||
}) {
|
||||
return (
|
||||
<TabsTrigger
|
||||
className={merge(
|
||||
`w-36 h-12 text-base font-normal flex-none`,
|
||||
`data-[state=active]:text-primary data-[state=active]:bg-primary-muted`,
|
||||
)}
|
||||
className="h-12 text-base data-[state=active]:text-primary data-[state=active]:bg-primary-muted"
|
||||
value={props.value}
|
||||
>
|
||||
{props.children}
|
||||
</TabsTrigger>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,16 +90,6 @@ export default function BillsPage(props: BillsPageProps) {
|
||||
</div>
|
||||
|
||||
<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>}>
|
||||
{({id, field}) => (
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
@@ -178,7 +168,7 @@ export default function BillsPage(props: BillsPageProps) {
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
{/* 类型展示 */}
|
||||
<div className="flex-shrink-0">
|
||||
<div className="shrink-0">
|
||||
{bill.type === 1 && (
|
||||
<div className="flex gap-2 items-center bg-orange-50 w-fit px-2 py-1 rounded-md">
|
||||
<CreditCard size={16}/>
|
||||
@@ -248,21 +238,13 @@ export default function BillsPage(props: BillsPageProps) {
|
||||
}
|
||||
const paymentMethod = trade ? paymentMethodMap[trade.method as keyof typeof paymentMethodMap] || '余额' : '余额'
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="flex gap-1">
|
||||
<span className="text-sm">
|
||||
{paymentMethod}
|
||||
</span>
|
||||
<span className={amount > 0 ? 'text-green-400' : 'text-orange-400'}>
|
||||
¥
|
||||
{amount.toFixed(2)}
|
||||
</span>
|
||||
</div>
|
||||
{trade?.inner_no && (
|
||||
<div className="text-xs text-gray-500">
|
||||
订单号: {trade.inner_no}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex gap-1">
|
||||
<span className="text-sm">
|
||||
{paymentMethod}
|
||||
</span>
|
||||
<span className={amount > 0 ? 'text-green-500' : 'text-orange-500'}>
|
||||
¥{amount.toFixed(2)}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
|
||||
@@ -18,8 +18,16 @@ import personal from './_assets/personal.webp'
|
||||
import step1 from './_assets/step1.webp'
|
||||
import step2 from './_assets/step2.webp'
|
||||
import step3 from './_assets/step3.webp'
|
||||
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from '@/components/ui/card'
|
||||
import {CheckCircle, CheckCircleIcon, WorkflowIcon} from 'lucide-react'
|
||||
import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card'
|
||||
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 = {}
|
||||
|
||||
@@ -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>({
|
||||
resolver: zodResolver(schema),
|
||||
defaultValues: {
|
||||
|
||||
Reference in New Issue
Block a user