<template>
  <!-- 当前委托 -->
  <div class="details-main">
    <div
      class="details-item"
      v-for="(item, index) in 2"
      :key="index"
      @click="detailsClick">
      <div class="item-name">
        <div class="name-left">
          <img src="../../../assets/icon/coin/bnb.svg" alt="" class="left-coin" />
          <div class="name-area">
            <div class="pf500 fs16 fc121212">BTC/USDT 永续</div>
            <div class="name-flag">
              <div class="flag-buy pf500 fs10 fcFFFFFF">买入</div>
              <div class="flag-cang pf500 fs10 fcFFFFFF">逐仓 20X</div>
              <div class="flag-price pf500 fs10 fcFFFFFF">市价</div>
            </div>
          </div>
        </div>
        <div class="name-right pf500 fs12 fcFFFFFF">撤单</div>
      </div>
      <div class="item-line"></div>
      <div class="item-price">
        <div class="price-top">
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">数量</div>
            <div class="pf500 fs12 fc333333">0.215 USDT</div>
          </div>
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">价格</div>
            <div class="pf500 fs12 fc333333">0.215 USDT</div>
          </div>
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">状态</div>
            <div class="pf500 fs12 fc333333">止损</div>
          </div>
        </div>
        <div class="price-bottom">
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">触发价格</div>
            <div class="pf500 fs12 fc333333">标记价格>20</div>
          </div>
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">下单时间</div>
            <div class="pf500 fs12 fc333333">2025-11-04, 16:30</div>
          </div>
          <div class="price-item">
            <div class="pf500 fs12 fcA8A8A8">状态</div>
            <div class="pf500 fs12 fc333333">未触发</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
  import { useRoute, useRouter } from "vue-router";

  const router = useRouter();

  const detailsClick = () => {
    router.push("/entrustDetails");
  };
</script>
<style lang="less" scoped>
  .details-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;

    .details-item {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      margin-top: 10px;
      width: 345px;
      height: 161px;
      border: 1px solid #ebebeb;
      border-radius: 8px;

      .item-name {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
        width: 320px;
        height: 40px;

        .name-left {
          display: flex;
          flex-direction: row;
          justify-content: flex-start;
          height: 40px;

          .left-coin {
            width: 40px;
            height: 40px;
          }

          .name-area {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            margin-left: 8px;
            height: 40px;

            .name-flag {
              display: flex;
              flex-direction: row;
              justify-content: flex-start;
              height: 15px;

              .flag-buy {
                width: 33px;
                height: 15px;
                line-height: 15px;
                text-align: center;
                background: #45b26b;
                border-radius: 3px;
              }

              .flag-cang {
                margin-left: 2px;
                width: 49px;
                height: 15px;
                line-height: 15px;
                text-align: center;
                background: #a8a8a8;
                border-radius: 3px;
              }

              .flag-price {
                margin-left: 2px;
                width: 33px;
                height: 15px;
                line-height: 15px;
                text-align: center;
                background: #a8a8a8;
                border-radius: 3px;
              }
            }
          }
        }

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

      .item-line {
        margin-top: 8px;
        width: 320px;
        height: 1.5px;
        background: #e9e9e9;
      }

      .item-price {
        margin-top: 7px;
        width: 320px;
        height: 85px;

        .price-top {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          width: 100%;
          height: 38px;

          .price-item {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            align-items: center;
            height: 38px;

            &:nth-child(1),
            &:nth-child(3) {
              width: 80px;
            }
            &:nth-child(2) {
              width: 160px;
            }
          }
        }

        .price-bottom {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          margin-top: 9px;
          width: 100%;
          height: 38px;

          .price-item {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            align-items: center;
            height: 38px;

            &:nth-child(1),
            &:nth-child(3) {
              width: 80px;
            }
            &:nth-child(2) {
              width: 160px;
            }
          }
        }
      }
    }
  }
</style>
