import { Image, Input, Text, View } from "@tarojs/components" import back from '@/images/back.png' import checked from '@/images/checked.png' import eyeClose from '@/images/eyeClose.png' import eye from '@/images/eye.png' import './index.scss' import { Button } from "@nutui/nutui-react-taro" import { useState } from "react" import Taro from "@tarojs/taro" const activeEye = eye const Login = () => { const [account, setAccount] = useState('') const [pwd, setPwd] = useState() const [showPwd, setShowPwd] = useState(false) const [loginMode, setLoginMode] = useState('account') const [mobile, setMobile] = useState('') const [smsCode, setSmsCode] = useState('') const [interval, setIntervalTime] = useState(0) // 返回页面 const backFn = () => { Taro.getCurrentPages().length > 0 && Taro.navigateBack() } // 去登陆 const loginFn = () => { Taro.redirectTo({ url: '/pages/login/index' }) } //清理数据 const cleanFn = () => { if (loginMode === 'account') { setAccount('') setPwd('') return } setMobile('') setSmsCode('') } // 倒计时 const countDown = () => { if (!mobile) { return } setIntervalTime(60) if (interval > 0) { return } let start = 60 const timer = setInterval(() => { if (start > 0) { start-- if (start <= 0) { clearInterval(timer) } setIntervalTime(start) } }, 1000) } return 新起点 忘记密码 账号 { setAccount(v.detail.value) }} /> { account && } 验证码 { setSmsCode(v.detail.value) }} /> 密码 { setPwd(v.detail.value) }} /> { setShowPwd(v => !v) }} /> 密码 { setPwd(v.detail.value) }} /> { setShowPwd(v => !v) }} /> 已有账号,去登陆 } export default Login