<template>
  <view class="charge-item-wrapper">
    <view class="item-btn-wrap">{{ title }}</view>
    <view class="item-content-wrap">
      <view class="text">空闲</view>
      <view class="content-number">
        <view class="left-num">{{ freeNum }}</view>
        <view class="right-num">/{{ totalNum }}</view>
      </view>
    </view>
    <view class="item-status-wrap">{{ status }}</view>
  </view>
</template>

<script lang="ts" setup>
defineProps({
  title: {
    type: String,
    default: '快充'
  },
  freeNum: {
    type: Number,
    default: 0
  },
  totalNum: {
    type: Number,
    default: 24
  },
  status: {
    type: String,
    default: '排队中'
  }
})
</script>

<style lang="scss" scoped>
.charge-item-wrapper {
  width: 100%;
  height: 70rpx;
  background-color: #e2f9ef;
  border-radius: 8rpx;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20rpx;
  .item-btn-wrap {
    width: 94rpx;
    height: 42rpx;
    background-image: linear-gradient(90deg, #00d454 0%, #4ad581 100%), linear-gradient(#e5f5e7, #e5f5e7);
    background-blend-mode: normal, normal;
    border-radius: 8rpx;
    position: absolute;
    top: 14rpx;
    left: 18rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26rpx;
    color: #fff;
    font-weight: bold;
  }
  .item-content-wrap {
    display: flex;
    align-items: center;
    .text {
      font-size: 24rpx;
      color: #222830;
      line-height: 50rpx;
      margin-right: 14rpx;
    }
    .content-number {
      display: flex;
      align-items: center;
      font-size: 26rpx;
      font-weight: 600;
      .left-num {
        color: #222830;
      }
      .right-num {
        color: #999;
      }
    }
  }
  .item-status-wrap {
    font-size: 26rpx;
    line-height: 50rpx;
    color: #158e45;
    position: absolute;
    top: 14rpx;
    right: 24rpx;
  }
}
</style>
