import { Image, Text, View } from "@tarojs/components"
import next from '@/images/next.png'
import './index.scss'
import Taro from "@tarojs/taro"
import backNav from '@/images/backNav.png'
import { useEffect, useState } from "react"
import { configs } from "../../utils/api"


const Login = () => {


    const [about, setAbout] = useState({})
    useEffect(() => {
        configs().then(rs => {
            if (!rs) return
            setAbout(rs.about)
        })
    }, [])

    // 返回页面
    const backFn = () => {
        Taro.getCurrentPages().length > 0 && Taro.navigateBack()
    }


    const navAboutMe = () => {
        Taro.navigateTo({
            url: '/pages/about-me/index'
        })
    }


    return <View className="about-frame  h-screen text-base">
        <View className='addr-detail-title'>
            <Image src={backNav} className="square-35 absolute left-10 nav-icon" onClick={backFn} />
            关于我们
        </View>
        <View className="flex-center about-logo">
            <Image src={about.logo} className="about-img" />
        </View>
        <View className="about-container flex-col justify-center">
            <View className="about-item">
                <Text>客服邮箱</Text>
                <Text className="about-item-text">{about.email}</Text>
            </View>
            <View className="about-item">
                <Text>当前版本</Text>
                <Text className="about-item-text">{about.version}</Text>
            </View>
        </View>
    </View>
}


export default Login