import { View, Text, Image, Button, Icon } from "@tarojs/components";
import { useLoad } from "@tarojs/taro";
import Taro from "@tarojs/taro";
import {
  AtAvatar,
  AtTag,
  AtIcon,
  AtTabBar,
  AtButton,
  AtAccordion,
  AtList,
  AtListItem,
} from "taro-ui";
import "./index.scss";
import beijing from "@/images/city/beijing.jpg";
import guangzhou from "@/images/city/guangzhou.jpg";
import shanghai from "@/images/city/shanghai.jpg";
import shenzhen from "@/images/city/shenzhen.jpg";
import touxiang from "@/images/index/touxiang.jpg";
import TabbarCom from "@/componments/TabbarCom";
import { useEffect, useState } from "react";
const my = () => {
  const [open, setopen] = useState(false);
  const [localuserInfo, setlocaluserInfo] = useState(
    Taro.getStorageSync("userInfo")
  );

  useEffect(() => {
    // 获取路由参数
    const params = Taro.getCurrentInstance().router.params;
    console.log("params", params);
  }, []);

  const handleClick = (value) => {
    setopen(true);
  };
  return (
    <View className="my">
      <View className="myContent">
        <View className="myHeader">
          {/* 头像 */}
          <AtAvatar
            circle
            image={localuserInfo?.smallhead ?? touxiang}
          ></AtAvatar>
          <View>
            <AtTag size="small">{localuserInfo?.nickname??星球新居民}</AtTag>
            {/* <AtTag size="small">女</AtTag> */}
          </View>
        </View>

        {/* 列表 */}
        <View className="mylist">
          <AtListItem
            title="我参加的"
            arrow="right"
            thumb="https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png"
          />
          <AtListItem
            title="更新日志"
            // note="描述信息"
            arrow="right"
            thumb="http://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png"
            onClick={() => {
              // 跳转到目的页面，打开新页面
              Taro.navigateTo({
                url: "/pages/my/componments/Log/index",
              });
            }}
          />
          <AtListItem
            title="联系客服"
            // note="描述信息"
            // extraText="详细信息"
            arrow="right"
            thumb="http://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png"
          />
        </View>

        {/* 个人客服 */}
        {/* <View className="wechat">
          <Button open-type="contact" className="wecahtBtn">
            联系客服
          </Button>
        </View> */}
      </View>

      {/* 底部tabbar */}
      <TabbarCom active={1} />
    </View>
  );
};

export default my;
