From fcb00a66b4053550b473a29d7299c7a4737eea75 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 14:41:04 +0800
Subject: [PATCH] 翻译

---
 src/components/perpetual-history-position/index.vue |   45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/components/perpetual-history-position/index.vue b/src/components/perpetual-history-position/index.vue
index 3a8bd09..0643341 100644
--- a/src/components/perpetual-history-position/index.vue
+++ b/src/components/perpetual-history-position/index.vue
@@ -5,7 +5,7 @@
       <div class="list">
         <div class="list-h">
           <div>
-            <span class="currency">{{ $t("买入") }}</span>
+            <span class="currency" :class="{ 'text-red': item.direction !== 'buy' }">{{ item.direction === 'buy' ? "Long" : "Short" }}</span>
             <span>{{ item.name }}</span>
           </div>
           <div class="state">{{ $t("成交") }}</div>
@@ -27,8 +27,8 @@
             <div class="list-value">{{ item.volume_open }}</div>
           </div>
           <div class="list-b">
-            <div>{{ $t("最新成交") }}({{ item.symbol.toUpperCase() }})</div>
-            <div class="list-value">{{ item.volume_open }}</div>
+            <div>{{ $t("杠杆") }}</div>
+            <div class="list-value">{{ item.lever_rate }}</div>
           </div>
           <div class="list-b">
             <div>{{ $t("成交额") }}(USDT)</div>
@@ -66,25 +66,19 @@
           </div>
           <div class="list-b">
             <div>{{ $t("盈利率") }}</div>
-            <div
-              class="list-value"
-              :class="{
-                'text-green': item.profit / 1 > 0,
-                'text-red': item.profit / 1 < 0,
-              }"
-            >
+            <div class="list-value" :class="{
+              'text-green': item.profit / 1 > 0,
+              'text-red': item.profit / 1 < 0,
+            }">
               {{ calculateProfitRate(item) }}
             </div>
           </div>
           <div class="list-b">
             <div>{{ $t("盈利") }}</div>
-            <div
-              class="list-value"
-              :class="{
-                'text-green': item.profit / 1 > 0,
-                'text-red': item.profit / 1 < 0,
-              }"
-            >
+            <div class="list-value" :class="{
+              'text-green': item.profit / 1 > 0,
+              'text-red': item.profit / 1 < 0,
+            }">
               {{ item.profit }}
             </div>
           </div>
@@ -201,11 +195,8 @@
   },
   methods: {
     calculateProfitRate(item) {
-      if (!item.trade_avg_price || !item.close_avg_price) return "--";
-      const profitRate = (
-        ((item.close_avg_price - item.trade_avg_price) / item.trade_avg_price) *
-        100
-      ).toFixed(2);
+      // if (!item.trade_avg_price || !item.close_avg_price) return "--";
+      const profitRate = ((item.profit / item.deposit_open) * 100).toFixed(2);
       return profitRate + "%";
     },
     handleText(state) {
@@ -270,9 +261,11 @@
 
 .asset-list {
   width: 100%;
+
   @include themify() {
     color: themed("text_color1");
   }
+
   .list {
     background: #212121;
     box-sizing: border-box;
@@ -281,27 +274,32 @@
     border-radius: 2.3rem;
     position: relative;
   }
+
   .list-h {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 2rem;
     color: #d1cdcd;
+
     .currency {
       font-size: 2.2rem;
       font-weight: 600;
       color: #1cd36d;
     }
+
     span {
       font-size: 1.6rem;
       font-weight: 600;
       // color: #fff;
     }
   }
+
   .list-item {
     display: flex;
     flex-wrap: wrap;
     margin-top: 2.3rem;
+
     .list-b {
       display: flex;
       flex-direction: column;
@@ -313,6 +311,7 @@
       // margin-right: 1.4rem;
       box-sizing: border-box;
       color: #d1cdcd;
+
       .list-value {
         width: 100%;
         color: #fff;
@@ -326,6 +325,7 @@
     }
   }
 }
+
 .kline {
   width: 100%;
   height: 1px;
@@ -335,6 +335,7 @@
 .text-red {
   color: #ff0000 !important;
 }
+
 .text-green {
   color: #1cd36d !important;
 }

--
Gitblit v1.9.3