|
@@ -8,15 +8,16 @@ import "./style.scss";
|
|
|
/**
|
|
|
* @description 登录注册From表单
|
|
|
* @param {string} type 使用类型
|
|
|
+ * @param {string} msgError 错误提示 login 或 register
|
|
|
* @param {(params: any) => void} callbackFun 回调方法
|
|
|
*/
|
|
|
export interface FromComProps {
|
|
|
type?: string;
|
|
|
- text?: string;
|
|
|
+ msgError?: string;
|
|
|
callbackFun?: (params: any) => void;
|
|
|
}
|
|
|
|
|
|
-const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', callbackFun}) => {
|
|
|
+const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', msgError = '', callbackFun}) => {
|
|
|
let [pwdVisible, setPwdVisible] = useState(false)
|
|
|
const spanClassName = clsx("iconfont", {
|
|
|
"icon-kejian": pwdVisible,
|
|
@@ -30,7 +31,7 @@ const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', callbackF
|
|
|
|
|
|
const activeCls = useMemo(() => {
|
|
|
let { userPhone, pwd } = fromParam
|
|
|
- if (userPhone && userPhone.length==11 && pwd && pwd.length>6) {
|
|
|
+ if (userPhone && userPhone.length==11 && pwd && pwd.length>5) {
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
@@ -66,7 +67,7 @@ const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', callbackF
|
|
|
<span className={spanClassName} onClick={() => setPwdVisible(!pwdVisible)}></span>
|
|
|
</div>
|
|
|
<div className="btnContent">
|
|
|
- <div className="tips"> O número de telefone não existe. </div>
|
|
|
+ { msgError && <div className="tips"> {msgError} </div> }
|
|
|
<ButtonOwn active={activeCls} callbackFun={submitRequest}>{type == 'login'? 'Login' : 'Criar conta'}</ButtonOwn>
|
|
|
</div>
|
|
|
<div className="link">
|