<template>
  <HeaderNav headerText="我的" headerRouter="/"></HeaderNav>
  <div class="otc-user">
    <div class="user-info">
      <img src="@/assets/img/index/user/default-head.png" alt="" />
      <div class="info-name">
        <div class="pf500 fs18 fc2C3131">用户昵称</div>
        <div class="time pf500 fs12 fc999999">注册时间: 2025-11-07</div>
      </div>
    </div>
    <div class="chengjiao-number pf500 fs10 fc999999">成交量 12550 · 98.95% 成交率</div>
    <div class="certification-center">
      <div class="certification-item pf500 fs10 fcDF384C">
        <CheckBox v-model="baseFlag"></CheckBox>
        <div class="text">基础认证</div>
      </div>
      <div class="certification-item pf500 fs10 fcDF384C">
        <CheckBox v-model="baseFlag"></CheckBox>
        <div class="text">身份认证</div>
      </div>
      <div class="certification-item pf500 fs10 fcDF384C">
        <CheckBox v-model="baseFlag"></CheckBox>
        <div class="text">高级认证</div>
      </div>
    </div>
    <div class="user-details">
      <div class="details-title pf600 fs18 fc2C3131">详情</div>
      <div class="details-item margin-top10">
        <div class="pf500 fs14 fc2C3131">成交单数</div>
        <div class="pf500 fs12 fc2C3131">15020</div>
      </div>
      <div class="details-item margin-top7">
        <div class="pf500 fs14 fc999999">购买</div>
        <div class="pf500 fs12 fc999999">520</div>
      </div>
      <div class="details-item margin-top7">
        <div class="pf500 fs14 fc999999">出售</div>
        <div class="pf500 fs12 fc999999">12500</div>
      </div>
      <div class="line"></div>
      <div class="details-item margin-top10">
        <div class="pf500 fs14 fc2C3131">成交率</div>
        <div class="pf500 fs12 fc2C3131">100.00%</div>
      </div>
      <div class="details-item margin-top7">
        <div class="pf500 fs14 fc999999">购买</div>
        <div class="pf500 fs12 fc999999">50.20%</div>
      </div>
      <div class="details-item margin-top7">
        <div class="pf500 fs14 fc999999">出售</div>
        <div class="pf500 fs12 fc999999">25.05%</div>
      </div>
      <div class="details-item margin-top13">
        <div class="pf500 fs14 fc2C3131">交易对手数</div>
        <div class="pf500 fs12 fc2C3131">894820</div>
      </div>
      <div class="details-item margin-top13">
        <div class="pf500 fs14 fc2C3131">平均付款时间</div>
        <div class="pf500 fs12 fc2C3131">1m15s</div>
      </div>
    </div>
    <div class="kongbai"></div>
    <div class="user-func">
      <div
        class="func-item"
        v-for="(item, index) in userMenu"
        :key="index"
        @click="goMenuRouter(index)">
        <div class="item-left pf500 fs14 fc333333">
          <img :src="item.img" class="anquan-set" alt="" />
          <div class="text">{{ item.name }}</div>
        </div>
        <img src="@/assets/icon/user/right-arrow.svg" class="right-arrow" alt="" />
      </div>
    </div>
  </div>
</template>
<script setup>
  import { ref } from "vue";
  import { useRoute, useRouter } from "vue-router";
  import HeaderNav from "../../../index/components/HeaderNav.vue";
  import CheckBox from "../../../../components/ui/CheckBox.vue";

  const router = useRouter();
  const baseFlag = ref(true);

  const userMenu = [
    {
      name: "我的关注",
      img: require("@/assets/icon/asset/guanzhu.png"),
    },
    {
      name: "联系客服",
      img: require("@/assets/icon/asset/kefu.png"),
    },
    {
      name: "交易指南",
      img: require("@/assets/icon/asset/zhinan.png"),
    },
    {
      name: "等级限额说明",
      img: require("@/assets/icon/asset/dengji.png"),
    },
  ];

  const goMenuRouter = (index) => {
    if (index == 0) {
      router.push("/myFollow");
    } else if (index == 2) {
      router.push("/transactionGuide");
    } else if (index == 3) {
      router.push("/levelLimit");
    }
  };
</script>
<style lang="less" scoped>
  .otc-user {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 48px;
    width: 100%;

    .user-info {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      margin-top: 10px;
      width: 345px;
      height: 56px;

      img {
        width: 56px;
        height: 56px;
      }

      .info-name {
        margin-left: 16px;

        .time {
          margin-top: 3px;
        }
      }
    }

    .chengjiao-number {
      margin-top: 2px;
      width: 345px;
      height: 24px;
      line-height: 24px;
    }

    .certification-center {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      margin-top: 2px;
      width: 345px;
      height: 16px;

      .certification-item {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        margin-left: 8px;

        &:first-child {
          margin-left: 0;
        }

        .text {
          margin-left: 4px;
        }
      }
    }

    .user-details {
      margin-top: 11px;
      width: 345px;

      .margin-top10 {
        margin-top: 10px;
      }

      .margin-top7 {
        margin-top: 7px;
      }

      .margin-top13 {
        margin-top: 13px;
      }

      .details-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 345px;
        height: 18px;
      }
    }

    .line {
      margin-top: 15px;
      width: 335px;
      height: 1px;
      background: #f5f5f5;
    }

    .kongbai {
      margin-top: 12px;
      width: 375px;
      height: 8px;
      background: #f5f5f5;
    }

    .user-func {
      width: 345px;

      .func-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 26.5px;
        width: 345px;
        height: 24px;

        &:first-child {
          margin-top: 18px;
        }

        .item-left {
          display: flex;
          flex-direction: row;
          justify-content: flex-start;
          align-items: center;
          height: 24px;

          .anquan-set {
            width: 19px;
            height: 19px;
          }

          .text {
            margin-left: 8px;
          }
        }

        .right-arrow {
          width: 7px;
          height: 15px;
        }
      }
    }
  }
</style>
