From a32ee6c28143b76c14e32c91c63d0e21ce7c67fe Mon Sep 17 00:00:00 2001
From: al
Date: Wed, 9 Oct 2024 16:59:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E8=BE=93?=
=?UTF-8?q?=E5=85=A5=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/login/page.js | 64 +++++++++++++++++++++++++++++++-----
components/OwnInput/index.js | 42 +++++++++++++++++++++++
2 files changed, 98 insertions(+), 8 deletions(-)
create mode 100644 components/OwnInput/index.js
diff --git a/app/login/page.js b/app/login/page.js
index 1509965..3efcd14 100644
--- a/app/login/page.js
+++ b/app/login/page.js
@@ -2,7 +2,7 @@
import React, { useState, useRef, useEffect } from "react";
import {
- Input,
+ // Input,
Button,
Swiper,
Tabs,
@@ -20,6 +20,7 @@ import { connect } from "react-redux";
import { cryptoPassword } from "@/utils/crypto";
import requireAPI from "@/utils/requireAPI";
import { signOut, signIn, checkAuth } from "@/utils/auth";
+import OwnInput from "@/components/OwnInput";
/*
params格式:
{
@@ -278,7 +279,7 @@ function Login({ handleLogin }) {
+{loginInfo.regionCode}
- */}
+ {
+ setLoginInfo({
+ ...loginInfo,
+ mobilePhone: value,
+ });
+ }}
+ value={loginInfo.mobilePhone}
/>
@@ -301,7 +317,7 @@ function Login({ handleLogin }) {
验证码
- setVeriCode(value)}
value={veriCode}
@@ -311,6 +327,14 @@ function Login({ handleLogin }) {
"--placeholder-color": "#FFFFFF80",
"--font-size": "16px",
}}
+ /> */}
+
- */}
+ {
+ setLoginInfo({
+ ...loginInfo,
+ mobilePhone: value,
+ });
+ }}
+ value={loginInfo.mobilePhone}
/>
@@ -361,7 +400,7 @@ function Login({ handleLogin }) {
密码
- */}
+ {
+ setLoginInfo({ ...loginInfo, password: value });
+ }}
+ value={loginInfo.password}
/>
@@ -405,9 +455,7 @@ function Login({ handleLogin }) {
const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
const router = useRouter();
- useEffect(() => {
- // console.log("loginInfo", loginInfo);
- }, []);
+ useEffect(() => {}, []);
return (
diff --git a/components/OwnInput/index.js b/components/OwnInput/index.js
new file mode 100644
index 0000000..48c8045
--- /dev/null
+++ b/components/OwnInput/index.js
@@ -0,0 +1,42 @@
+"use client";
+
+import React from "react";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { faClose } from "@fortawesome/free-solid-svg-icons";
+// import styles from "./index.module.scss";
+export default function OwnInput({
+ value,
+ onChange,
+ type = "text",
+ name,
+ placeholder,
+ clearable,
+ disabled,
+}) {
+ return (
+
+
onChange(e.target?.value)}
+ value={value}
+ className="text-[#ffffff] w-full text-[16px] placeholder:text-[#FFFFFF80]"
+ />
+ {clearable && value != "" && (
+
+ {
+ onChange && onChange("");
+ }}
+ />
+
+ )}
+
+ );
+}