<template>
  <!-- 云算力-首页 -->
  <div class="loan-header">
    <div class="header-content pf600 fs18 fc121212">
      <img
        class="left-arrow-image"
        src="../../../assets/icon/index/left-arrow.svg"
        @click="toPath()" />
      云算力
      <div class="save pf600 fs14 fc333333" @click="goMyPower">我的算力</div>
    </div>
  </div>
  <div class="cloud-power-index">
    <img src="@/assets/img/index/yunsuanli-banner.svg" class="yunsuanli-banner" alt="" />
    <div class="cloud-combo">
      <div class="title pf600 fs18 fc121212">算力套餐</div>
      <div class="combo-main">
        <div class="coin-item" v-for="(item, index) in 2" :key="index">
          <div class="item-name">
            <div class="item-info">
              <div class="info-top pf500 fs14 fc1F2937">
                <div>算力套餐名称</div>
                <div>0.0176/T/天</div>
              </div>
              <div class="info-bottom">
                <div class="bottom-coin pf500 fs10 fc121212">
                  <img src="@/assets/icon/coin/bnb.svg" alt="" />
                  BTC
                </div>
                <div class="start-time pf500 fs10 fc999999">
                  <img src="@/assets/icon/index/time.svg" class="time" alt="" />
                  开始挖矿 24小时内
                </div>
              </div>
            </div>
          </div>
          <div class="item-line"></div>
          <div class="item-use pf500 fs12 margin-top10">
            <div class="fcA8A8A8">套餐天数</div>
            <div class="fcDF384C">15 天</div>
          </div>
          <div class="item-use pf500 fs12 margin-top4">
            <div class="fcA8A8A8">预估每日收益</div>
            <div class="fc767676">0.015/T天</div>
          </div>
          <div class="item-use pf500 fs12 margin-top4">
            <div class="fcA8A8A8">预估每日成本</div>
            <div class="fc767676">0.00215/T天</div>
          </div>
          <div class="item-use pf500 fs12 margin-top4">
            <div class="fcA8A8A8">预期收益率</div>
            <div class="fc767676">152.16%</div>
          </div>
          <div class="conduct-btn pf600 fs14 fcFFFFFF" @click="goComboDetails">
            立即购买
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
  import { useRoute, useRouter } from "vue-router";

  const router = useRouter();

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

  const goComboDetails = () => {
    router.push("/comboDetails");
  };

  const goMyPower = () => {
    router.push("/myPower");
  };
</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: 16px;
        width: 9px;
        height: 16px;
      }

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

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

    .yunsuanli-banner {
      width: 345px;
      height: 100px;
    }

    .cloud-combo {
      margin-top: 10px;
      width: 345px;

      .title {
        height: 24px;
        line-height: 24px;
      }

      .combo-main {
        width: 100%;

        .coin-item {
          padding-left: 19px;
          padding-right: 11px;
          margin-top: 10px;
          width: 345px;
          height: 209px;
          border-radius: 8px;
          border: 1px solid #ebebeb;
          box-sizing: border-box;

          .item-name {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            margin-top: 11px;
            width: 100%;
            height: 34px;

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

            .item-info {
              width: calc(345px);
              height: 34px;

              .info-top {
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                width: 100%;
                height: 20px;
              }

              .info-bottom {
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                margin-top: 2px;
                width: 100%;
                height: 15px;

                .bottom-coin {
                  display: flex;
                  flex-direction: row;
                  justify-content: flex-start;
                  align-items: center;

                  img {
                    margin-right: 2px;
                  }
                }

                .start-time {
                  display: flex;
                  flex-direction: row;
                  justify-content: flex-start;
                  align-items: center;
                }

                .time {
                  margin-right: 2px;
                  width: 12px;
                  height: 12px;
                }
              }
            }
          }

          .item-line {
            margin-top: 10px;
            width: 100%;
            height: 1px;
            background: #e9e9e9;
          }

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

          .margin-top4 {
            margin-top: 4px;
          }

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

          .conduct-btn {
            margin-top: 8px;
            width: 311px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border-radius: 100px;
            background: #df384c;
            letter-spacing: 0.2px;
          }
        }
      }
    }
  }
</style>
