<template>
  <!-- 我的算力 -->
  <HeaderNav headerText="我的算力"></HeaderNav>
  <div class="my-power">
    <div class="my-asset">
      <div class="total-left">
        <div class="asset-title pf400 fs16 fc1F2937">总收益(USDT)</div>
        <div class="asset-number pf600 fs32 fc1F2937">1,125,158.00</div>
        <div class="asset-approximately pf400 fs16 fcDF384C">≈35,458.00</div>
      </div>
      <div class="total-right pf500 fs12 fcFFFFFF" @click="goMyOrder">我的订单</div>
    </div>
    <div class="electricity-bill pf400 fs12 fc6A7187">
      电费余额(USDT) <span class="fcDF384C">自动续费中</span>
    </div>
    <div class="electricity-banlance pf500 fs16 fc1F2937">5,678.00</div>
    <div class="index-menu">
      <div
        class="menu-item"
        v-for="(item, index) in indexMenu"
        :key="index"
        @click="goMenu(index)">
        <img :src="item.image" alt="" />
        <div class="item-text pf400 fs14 fc666666">{{ item.name }}</div>
      </div>
    </div>
    <div class="notifi-classifi">
      <div class="pf600 fs14 fc121212" @click="currentTab = 0">BTC</div>
      <div class="sys-notifi pf600 fs14 fcA8A8A8" @click="currentTab = 1">USDT</div>
    </div>
    <div class="class-first pf600 fs18 fc121212" v-if="currentTab == 0">
      <div class="title">
        我的挖矿收益
        <img src="@/assets/icon/index/CalendarDots.svg" alt="" />
      </div>
      <div class="rate pf400 fs10 fc121212">
        <img src="@/assets/icon/coin/bnb.svg" alt="" />
        <div class="first pf500 fs14 fc121212">0.2050878500 BTC</div>
        ≈35,458.00 USDT
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top15">
        <div>挖矿中算力</div>
        <div>5020.5050 T</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>预购算力</div>
        <div>0.1215 T</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>总成本</div>
        <div>20 USDT</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>回本天数</div>
        <div>10天</div>
      </div>
    </div>
    <div class="class-second pf600 fs18 fc121212" v-if="currentTab == 1">
      <div class="title">
        我的挖矿收益1
        <img src="@/assets/icon/index/CalendarDots.svg" alt="" />
      </div>
      <div class="rate pf400 fs10 fc121212">
        <img src="@/assets/icon/coin/bnb.svg" alt="" />
        <div class="first pf500 fs14 fc121212">0.2050878500 BTC</div>
        ≈35,458.00 USDT
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top15">
        <div>挖矿中算力</div>
        <div>5020.5050 T</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>预购算力</div>
        <div>0.1215 T</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>总成本</div>
        <div>20 USDT</div>
      </div>
      <div class="info-item pf500 fs14 fc666666 margin-top26">
        <div>回本天数</div>
        <div>10天</div>
      </div>
    </div>
  </div>
</template>
<script setup>
  import HeaderNav from "../components/HeaderNav.vue";
  import { ref } from "vue";
  import { useRouter } from "vue-router";

  const router = useRouter();

  const currentTab = ref(0);

  const goMenu = (index) => {
    if (index == 0) {
      router.push("/miningOutput");
    } else if (index == 1) {
      router.push("/electricityBill");
    } else if (index == 2) {
      router.push("/electricityRecharge");
    } else if (index == 3) {
      router.push("/electricitySetting");
    }
  };

  const goMyOrder = () => {
    router.push("/cloudMyOrder");
  };

  const indexMenu = [
    {
      name: "挖矿产出",
      image: require("@/assets/icon/index/kuang-chanchu.svg"),
    },
    {
      name: "电费账单",
      image: require("@/assets/icon/index/dian-zhangdan.svg"),
    },
    {
      name: "电费充值",
      image: require("@/assets/icon/index/dian-chongzhi.svg"),
    },
    {
      name: "电费设置",
      image: require("@/assets/icon/index/dian-shezhi.svg"),
    },
  ];
</script>
<style lang="less" scoped>
  .my-power {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 48px;
    width: 100%;

    .my-asset {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      width: 345px;
      align-items: center;

      .total-left {
        .asset-title {
          display: flex;
          flex-direction: row;
          justify-content: flex-start;
          align-items: center;
          height: 22px;

          .eye-close {
            margin-left: 5px;
            width: 16px;
            height: 16px;
          }
        }

        .asset-number {
          margin-top: 3px;
          height: 44px;
          line-height: 44px;
        }

        .asset-approximately {
          margin-top: 1px;
          height: 22px;
          line-height: 22px;
        }
      }

      .total-right {
        width: 76px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        border-radius: 5px;
        background: #df384c;
      }
    }

    .electricity-bill {
      margin-top: 6px;
      width: 345px;
      height: 20px;
      line-height: 20px;
      text-align: left;
    }

    .electricity-banlance {
      margin-top: 3px;
      width: 345px;
      height: 24px;
      line-height: 24px;
      text-align: left;
    }

    .index-menu {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      margin-top: 15px;
      width: calc(345px - 26px);
      height: 57px;

      .menu-item {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        width: 57px;
        height: 57px;

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

        .item-text {
          margin-top: 1px;
          height: 24px;
          line-height: 24px;
          letter-spacing: 0.2px;
        }
      }
    }

    .notifi-classifi {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: flex-end;
      margin-top: 11px;
      width: 345px;
      height: 24px;

      .sys-notifi {
        margin-left: 33px;
      }
    }

    .class-first,
    .class-second {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      margin-top: 11px;
      width: 345px;

      .title {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 24px;

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

      .rate {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        margin-top: 14px;
        height: 30px;

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

        .first {
          margin-left: 10px;
          margin-right: 2px;
        }
      }

      .margin-top15 {
        margin-top: 15px;
      }

      .margin-top26 {
        margin-top: 26px;
      }

      .info-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 345px;
        height: 20px;
      }
    }
  }
</style>
