<template>
  <!-- 杠杆 -->
  <div class="lever">
    <div class="asset-total">
      <div class="asset-title pf400 fs16 fc1F2937">杠杆总资产(USDT)</div>
      <div class="asset-number pf600 fs32 fc1F2937">1,125,158.00</div>
      <div class="asset-approximately pf400 fs16 fcDF384C">≈35,458.00</div>
      <div class="asset-revenue">
        <div class="asset-left">
          <div class="text pf400 fs12 fc6A7187">今日盈亏(USDT)</div>
          <div class="number pf400 fs16 fc061237">5,678.00</div>
        </div>
        <div class="asset-right">
          <div class="text pf400 fs12 fc6A7187">盈亏率(%)</div>
          <div class="number-two pf400 fs16 fc061237">0.10</div>
        </div>
      </div>
    </div>
    <div class="submit pf600 fs14 fcFFFFFF">交易</div>
    <div class="notifi-classifi">
      <div class="classifi-left">
        <div class="pf600 fs14 fc121212" @click="currentTab = 0">持有仓位(2)</div>
        <div class="sys-notifi pf600 fs14 fcA8A8A8" @click="currentTab = 1">
          当前委托(0)
        </div>
      </div>
      <div class="classifi-right pf600 fs14 fcA8A8A8">
        <img src="@/assets/icon/index/history.svg" alt="" />全部
      </div>
    </div>
    <div class="owner-cangwei" v-if="currentTab == 0">
      <div class="details-item" v-for="(item, index) in 2" :key="index">
        <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">
            <div class="pf500 fs12 fc767676">2025-11-04, 16:30</div>
            <div class="pf500 fs12 fc767676">下单时间</div>
          </div>
        </div>
        <div class="item-line"></div>
        <div class="item-price">
          <div class="price-bottom">
            <div class="price-item">
              <div class="pf500 fs12 fcA8A8A8">倍数</div>
              <div class="pf500 fs12 fc333333">200X</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">0.215 USDT</div>
            </div>
          </div>
          <div class="submit pf600 fs14 fcFFFFFF">平仓</div>
        </div>
      </div>
    </div>
    <div class="current-weituo" v-if="currentTab == 1">
      <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">2025-11-04, 16:30</div>
            </div>
            <div class="price-item">
              <div class="pf500 fs12 fcA8A8A8">价格</div>
              <div class="pf500 fs12 fc333333">0.215 USDT</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
  import { ref } from "vue";

  const currentTab = ref(0);
</script>
<style lang="less" scoped>
  .lever {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;

    .asset-total {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      margin-top: 16px;
      width: 343px;

      .asset-title {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        height: 22px;

        .eye-close {
          margin-left: 5px;
          width: 16px;
          height: 16px;
        }
      }

      .asset-number {
        margin-top: 3px;
        height: 44px;
        line-height: 44px;
      }

      .asset-approximately {
        margin-top: 1px;
        height: 22px;
        line-height: 22px;
      }

      .asset-revenue {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 6px;
        height: 44px;

        .asset-left,
        .asset-right {
          height: 100%;

          .text {
            height: 20px;
            line-height: 20px;
            letter-spacing: 0.3px;
          }

          .number {
            margin-top: 3px;
            height: 24px;
            line-height: 24px;
          }

          .number-two {
            margin-top: 3px;
            height: 24px;
            line-height: 24px;
            text-align: end;
          }
        }
      }
    }

    .submit {
      margin-top: 16px;
      width: 311px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-radius: 100px;
      background: #df384c;
      letter-spacing: 0.2px;
    }

    .notifi-classifi {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      margin-top: 15px;
      width: 349px;
      height: 24px;

      .classifi-left {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: flex-end;
        height: 24px;

        .sys-notifi {
          margin-left: 29px;
        }
      }

      .classifi-right {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: end;
        height: 24px;

        img {
          margin-right: 4px;
        }
      }
    }

    .owner-cangwei {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      margin-top: 10px;
      width: 100%;

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

        .item-name {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          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 {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            align-items: flex-end;
            height: 40px;
          }
        }

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

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

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

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

        .submit {
          margin-top: 11px;
          width: 311px;
          height: 40px;
          line-height: 40px;
          text-align: center;
          border-radius: 100px;
          background: #df384c;
          letter-spacing: 0.2px;
        }
      }
    }

    .current-weituo {
      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: 110px;
        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;
              }
            }
          }
        }
      }
    }
  }
</style>
