This commit is contained in:
hailin 2025-03-15 18:18:00 +08:00
parent ecbb83315f
commit c8ea591f7a
4 changed files with 17 additions and 11 deletions

View File

@ -17,6 +17,7 @@ export default function AuthenticationPage() {
const [email, setEmail] = React.useState("");
const [password, setPassword] = React.useState("");
const [code, setCode] = React.useState("");
const [referrer, setReferrer] = React.useState("");
const { t } = useTranslation();
@ -37,10 +38,11 @@ export default function AuthenticationPage() {
setVerification={setVerify}
email={setEmail}
referrer={setReferrer}
password={setPassword}
emailValue={email}
passwordValue={password}
referrerValue={referrer}
/>
</div>
</>

View File

@ -20,8 +20,10 @@ export function MixSignUp(props: {
email: (value: string) => void;
password: (value: string) => void;
referrer: (value: string) => void;
emailValue: string;
passwordValue: string;
referrerValue: string;
}) {
const [isLoading, setIsLoading] = React.useState(false);
@ -88,9 +90,9 @@ export function MixSignUp(props: {
setTransferLoading(false);
}, []);
const signUpWithOutCode = async (username: string, password: string) => {
const signUpWithOutCode = async (username: string, password: string, referrer: string) => {
console.log("--username:", username, "--password:", password);
console.log("--username:", username, "--password:", password, "--referrer", referrer);
if (
isLoading ||
@ -102,7 +104,7 @@ export function MixSignUp(props: {
await service.post('/api/v1/customer/uregister', {
user_name: username,
Referral: "Referral",
Referral: referrer,
password: md5(password),
}).then(function (result: any) {
setIsLoading(false);
@ -137,6 +139,7 @@ export function MixSignUp(props: {
<form className="grid gap-2" onSubmit={(e) => {
e.preventDefault();
const regname = new FormData(e.currentTarget).get("regname");
const refer = new FormData(e.currentTarget).get("referreredit")
if (
typeof regname !== "string"
@ -144,8 +147,9 @@ export function MixSignUp(props: {
return null;
}
console.log("--regname:", regname)
console.log("--regname:", regname, "--referrer:", refer)
props.email(regname)
props.referrer(refer)
setGoPassword(true)
}}>
@ -168,13 +172,13 @@ export function MixSignUp(props: {
className="h-10 text-black duration-500 bg-transparent focus:text-black border-black/20 focus:bg-white focus:border-black rounded hover:bg-white/20 hover:border-black/40 placeholder:black/20 "
/>
<label htmlFor="referralcode" className="text-xs text-black/50">
<label htmlFor="referreredit" className="text-xs text-black/50">
{t("refcode")}
</label>
<Input
name="referralcode"
placeholder={t("auth.refcodeplaceholder")}
name="referreredit"
placeholder={t("auth.referrerplaceholder")}
type="text"
defaultValue={props.emailValue}
autoCapitalize="none"
@ -205,7 +209,7 @@ export function MixSignUp(props: {
return
}
await signUpWithOutCode(props.emailValue, password)
await signUpWithOutCode(props.emailValue, password, props.referrer)
setGoPassword(false)
}} >

View File

@ -31,7 +31,7 @@
"verification_code": "Six-digit verification code",
"send_again": "Send Again",
"email_address": "Email Address",
"refcodeplaceholder": "Enter your referral code(Optional)",
"referrerplaceholder": "Enter your referral code(Optional)",
"mixplacehoder": "Enter your phone number or Email address",
"creat_account": "Creat Account",
"frogot_password": "Frogot password?",

View File

@ -32,7 +32,7 @@
"send_again": "再次发送",
"email_address": "电子邮件地址",
"mixplacehoder": "输入你的手机号或者邮箱地址",
"refcodeplaceholder": "填写你的推荐码(选填)",
"referrerplaceholder": "填写你的推荐码(选填)",
"creat_account": "创建帐户",
"frogot_password": "忘记密码?",
"account_not_found": "未找到帐户,您想注册吗?",