<template>
  <!-- 等待审核 -->
  <div class="cloud-power-buy">
    <div class="apply-mask" @click="emits('cloudPowerBuyClose')"></div>
    <div class="apply-content">
      <div class="slide-line"></div>
      <div class="apply-text pf600 fs18 fc121212">购买</div>
      <div class="loan-price">
        <input type="text" class="input pf500 fs14 fc333333" placeholder="输入算力" />
        <div class="pf500 fs14 fc333333">T</div>
      </div>
      <div class="slide-choice"></div>
      <div class="type-select pf500 fs14 fc333333">
        <div>支付币种</div>
        <div>USDT</div>
      </div>
      <div class="use-number pf400 fs12 fc333333">
        可用&nbsp; 215.0508 USDT
        <img src="@/assets/icon/bitcoin/qianbao1.svg" alt="" class="qianbao" />
      </div>
      <div class="loan-desc margin-top16 pf500 fs14 fc666666">
        <div>套餐费用</div>
        <div>0.1252/T/天</div>
      </div>
      <div class="loan-desc margin-top26 pf500 fs14 fc666666">
        <div>套餐天数</div>
        <div>100 天</div>
      </div>
      <div class="loan-desc margin-top26 pf500 fs14 fc666666">
        <div>预付电费</div>
        <div>2.52 USDT</div>
      </div>
      <div class="loan-desc margin-top26 pf500 fs14 fc666666">
        <div>总计</div>
        <div>100 USDT</div>
      </div>
      <div class="auto-electricity pf400 fs12 fc666666">
        <input
          type="checkbox"
          class="checkbox"
          v-model="autoBuyFlag" />同意开启电费自动续费
      </div>
      <div class="sure-btn pf600 fs14 fcFFFFFF">立即支付</div>
    </div>
  </div>
</template>
<script setup>
  import { ref } from "vue";

  const emits = defineEmits(["cloudPowerBuyClose"]);

  const autoBuyFlag = ref(true);
</script>
<style lang="less" scoped>
  .cloud-power-buy {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    min-height: 100vh;

    .apply-mask {
      position: fixed;
      left: 0;
      top: 0;
      z-index: -1;
      width: 100%;
      min-height: 100vh;
      background: rgba(0, 0, 0, 0.5);
    }

    .apply-content {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      width: 375px;
      height: 564px;
      background: #ffffff;
      border-radius: 24px 24px 0px 0px;

      .slide-line {
        margin-top: 12px;
        width: 32px;
        height: 4px;
        border-radius: 2px;
        opacity: 0.4;
        background: rgba(0, 0, 0, 0.5);
      }

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

      .loan-price {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 14px;
        padding-right: 11px;
        width: 345px;
        height: 45px;
        background: #f5f5f5;
        box-sizing: border-box;

        .input {
          padding-left: 11px;
          width: 80%;
          height: 100%;
          box-sizing: border-box;
          outline: none;
          border: none;
          border-radius: 6px;
          background: #f5f5f5;
        }
      }

      .slide-choice {
        margin-top: 15px;
        width: 345px;
        height: 54px;
        background: pink;
      }

      .type-select {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 11px;
        padding: 0 11px;
        width: 345px;
        height: 45px;
        border-radius: 6px;
        background: #f5f5f5;
        box-sizing: border-box;
      }

      .use-number {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        margin-top: 7px;
        width: 345px;
        height: 18px;

        .qianbao {
          margin-left: 8px;
          width: 14px;
          height: 14px;
        }
      }

      .margin-top16 {
        margin-top: 16px;
      }

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

      .loan-desc {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 345px;
        height: 20px;
      }

      .auto-electricity {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        margin-top: 13px;
        width: 345px;
        height: 18px;

        .checkbox {
          margin-right: 6px;
          width: 16px;
          height: 16px;
          border-radius: 4px;
          background: #ffffff;
          border: 1px solid #a8a8a8;
          appearance: none;
          -webkit-appearance: none;
          -moz-appearance: none;
          cursor: pointer;
          position: relative;
        }

        .checkbox:checked::after {
          content: "✓";
          font-size: 12px;
          color: black; /* 默认对号颜色 */
          position: absolute;
          left: 2.5px;
          top: 0.6px;
        }
      }

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