<template>
  <!-- 套餐详情 -->
  <div class="loan-header">
    <div class="header-content pf600 fs18 fc1F2937">
      <img
        class="left-arrow-image"
        src="../../../assets/icon/index/left-arrow.svg"
        @click="toPath()" />
      套餐名称
      <div class="save pf500 fs14 fcDF384C">
        <img src="../../../assets/icon/index/Headphones.svg" alt="" />
      </div>
    </div>
  </div>
  <div class="combo-details">
    <img src="@/assets/img/index/kuangji.svg" class="kuangji" alt="" />
    <div class="combo-name">
      <div class="name-left pf500 fs22 fc2C3131">算力套餐名称</div>
      <div class="name-right pf500 fs18 fc2C3131">15/天</div>
    </div>
    <div class="combo-day">
      <div class="pf500 fs18 fcDF384C">0.0176/T/天</div>
      <div class="pf500 fs14 fc999999">套餐天数</div>
    </div>
    <div class="combo-line"></div>
    <div class="combo-info margin-top17">
      <div class="pf500 fs14 fc666666">挖矿奖励</div>
      <div class="info-right pf500 fs14 fc666666">
        <img src="@/assets/icon/coin/bnb.svg" alt="" />BTC
      </div>
    </div>
    <div class="combo-info margin-top28 pf500 fs14 fc666666">
      <div>矿机类型</div>
      <div>类型名称</div>
    </div>
    <div class="combo-info margin-top28 pf500 fs14 fc666666">
      <div>开始挖矿时间</div>
      <div>24小时内</div>
    </div>
    <div class="combo-info margin-top28 pf500 fs14 fc666666">
      <div>奖励周期</div>
      <div>每日</div>
    </div>
    <div class="estimate">
      <div class="estimate-left">
        <div class="pf400 fs14 fc1F2937">预估每日成本</div>
        <div class="pf600 fs18 fc1F2937">15158.00/T/天</div>
      </div>
      <div class="estimate-right">
        <div class="pf400 fs14 fc1F2937">预估每日成本</div>
        <div class="pf600 fs18 fc1F2937">15158.00/T/天</div>
      </div>
    </div>
    <div class="cost">
      <div class="cost-item">
        <div class="pf400 fs12 fc666666">算力费</div>
        <div class="pf500 fs12 fc333333">2580.2820/T/天</div>
      </div>
      <div class="cost-item">
        <div class="pf400 fs12 fc666666">电力费</div>
        <div class="pf500 fs12 fc333333">2580.2820/T/天</div>
      </div>
      <div class="cost-item">
        <div class="pf400 fs12 fc666666">奖励</div>
        <div class="pf500 fs12 fc333333">0.0002150 BTC</div>
      </div>
    </div>
    <div class="calculator pf600 fs14 fcFFFFFF" @click="goCalculator">计算器</div>
    <div class="desc pf400 fs12 fc999999">
      提示：此计算结果采用当前难度PPS模式下的挖矿，由于挖矿收益 <br />
      受矿机和矿场电力等因素影响，计算结果仅供参考。
    </div>
    <div class="sure-buy pf600 fs14 fcFFFFFF" @click="cloudPowerBuyFlag = true">
      立即购买
    </div>
    <CloudPowerBuy
      v-show="cloudPowerBuyFlag"
      @cloudPowerBuyClose="cloudPowerBuyClose"></CloudPowerBuy>
  </div>
</template>
<script setup>
  import { ref } from "vue";
  import { useRoute, useRouter } from "vue-router";
  import CloudPowerBuy from "../dialog/CloudPowerBuy.vue";

  const router = useRouter();

  const cloudPowerBuyFlag = ref(false);
  const cloudPowerBuyClose = () => {
    cloudPowerBuyFlag.value = false;
  };

  const toPath = () => {
    router.back();
  };

  const goCalculator = () => {
    router.push("/cloudCalculator");
  };
</script>
<style lang="less" scoped>
  .loan-header {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
    height: 48px;
    background: #ffffff;
    overflow: hidden;

    .header-content {
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      position: relative;
      width: 100%;
      height: 48px;

      .left-arrow-image {
        position: absolute;
        left: 14px;
        top: 15px;
        width: 9px;
        height: 16px;
      }

      .save {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 24px;
        height: 24px;
      }
    }
  }

  .combo-details {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 48px;
    width: 100%;

    .kuangji {
      margin-top: 20px;
      width: 278px;
      height: 214px;
    }

    .combo-name {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-top: 28px;
      width: 345px;
      height: 31px;
    }

    .combo-day {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-top: 3px;
      width: 345px;
      height: 24px;
    }

    .combo-line {
      margin-top: 15px;
      width: 310px;
      height: 1px;
      background: #e9e9e9;
    }

    .margin-top28 {
      margin-top: 28px;
    }

    .margin-top17 {
      margin-top: 17px;
    }

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

      .info-right {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        height: 18px;

        img {
          margin-right: 6px;
          width: 18px;
          height: 18px;
        }
      }
    }

    .estimate {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-top: 28px;
      width: 308px;
      height: 52px;

      .estimate-left {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        width: 130px;
        height: 100%;
      }

      .estimate-right {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        width: 130px;
        height: 100%;
      }
    }

    .cost {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-top: 12px;
      width: 345px;
      height: 42px;

      .cost-item {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        width: 33%;
        height: 100%;
      }
    }

    .calculator {
      margin-top: 26px;
      width: 167px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-radius: 10px;
      background: #df384c;
    }

    .desc {
      margin-top: 12px;
      width: 345px;
      line-height: 18px;
    }

    .sure-buy {
      margin-top: 26px;
      margin-bottom: 50px;
      width: 311px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-radius: 100px;
      background: #df384c;
    }
  }
</style>
