import NavBarNormal from "@/components/nav-bar-normal/index";
import { View } from "@tarojs/components";
import PageCustom from "@/components/page-custom/index";

import CardList from "@/components/list/card-list";
import TagCertificated from "@/components/tag-certificated";
import CardListItem from "@/components/list/card-list-item";
import Taro, { useRouter } from "@tarojs/taro";


export default function Index() {
  const router = useRouter()
  const {agentId} = router.params
  const navToUrl = (url: string)=> {
    Taro.navigateTo({url})
  }
  return (
    <PageCustom>
      <NavBarNormal backText="数字名片"></NavBarNormal>
      <View className="px-16 w-full pt-4">
        <CardList>
          <View className="py-16 px-20 flex flex-col gap-20">
            <CardListItem underline arrow onClick={()=> navToUrl(`/pages/editor-pages/editor-name/index?agentId=${agentId}`)}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">姓名</View>
                <View className="text-gray-65 mr-8">张三</View>
              </View>
            </CardListItem>
            <CardListItem underline arrow onClick={()=> navToUrl(`/pages/editor-pages/editor-phone/index?agentId=${agentId}`)}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">手机号码</View>
                <View className="text-gray-65 mr-8">137 1234 1234</View>
              </View>
            </CardListItem>
            <CardListItem underline arrow onClick={()=> navToUrl(`/pages/editor-pages/editor-email/index?agentId=${agentId}`)}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">联系邮箱</View>
                <View className="text-gray-65 mr-8 truncate max-w-[188px]">zhangsan@eyeclear.com</View>
              </View>
            </CardListItem>
            <CardListItem underline arrow>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">联系地址</View>
                <View className="text-gray-65 mr-8 truncate max-w-[188px]">浙江省杭州市上城区钱江国际时代广场2幢</View>
              </View>
            </CardListItem>
            <CardListItem arrow onClick={()=> navToUrl('/pages/editor-pages/editor-qrcode/index')}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">我的二维码</View>
                <View className="text-gray-65 mr-8 text-primary">已上传</View>
              </View>
            </CardListItem>
          </View>
        </CardList>
      </View>
      <View className="px-16 w-full pt-12">
        <CardList>
          <View className="py-16 px-20 flex flex-col gap-20">
            <CardListItem underline arrow onClick={()=> navToUrl('/pages/editor-pages/editor-company/index')}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">企业</View>
                <View className="text-gray-65 mr-8 truncate max-w-[188px]">北京茗视光眼科医院管理有限公司</View>
              </View>
            </CardListItem>
            <CardListItem underline>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">企业认证</View>
                <TagCertificated />
              </View>
            </CardListItem>
            <CardListItem arrow onClick={()=> navToUrl('/pages/editor-pages/editor-position/index')}>
              <View className="flex items-center font-normal pb-16">
                <View className="flex-1 font-normal">职位</View>
                <View className="text-gray-65 mr-8">销售医师</View>
              </View>
            </CardListItem>
          </View>
        </CardList>
      </View>
    </PageCustom>
  );
}
