From 3003b7486ddeffd169f2b2f564fc0ff8c2c58bb3 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Tue, 22 Jul 2025 09:56:04 +0800
Subject: [PATCH] 1

---
 src/page/user/Warehouse/item.card.vue |  108 +++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 79 insertions(+), 29 deletions(-)

diff --git a/src/page/user/Warehouse/item.card.vue b/src/page/user/Warehouse/item.card.vue
index fc9362d..16654f9 100644
--- a/src/page/user/Warehouse/item.card.vue
+++ b/src/page/user/Warehouse/item.card.vue
@@ -2,59 +2,109 @@
   <div class="item-card-box">
     <div class="total-assets">
       <div class="left">
-        <div class="total-name">泰股總資產 ({{ activeObj.laber }})</div>
-        <div class="total-data">0.0000</div>
-        <div class="total-data-huansuan">≈ $0.0000</div>
+        <div class="total-name">
+          {{ activeObj.assname }} ({{ activeObj.symbolCode }})
+        </div>
+        <div class="total-data">
+          ₹{{ activeObj.totalMoney | _toLocaleString }}
+          <!-- {{ 10000000000000 | _toLocaleString }} -->
+        </div>
       </div>
-      <div class="right">全部平仓</div>
     </div>
 
     <div class="item-card-itembox">
       <div class="item">
-        <div class="itembox-data">-23.1689</div>
-        <div v-if="activeObj.laber !== 'USD'" class="number-text">
-          ≈ $0.0000
+        <div class="itembox-data">
+          ₹{{ activeObj.profitAndLoss | _toLocaleString }}
         </div>
-        <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+        <div class="itembox-name">
+          {{ $t("浮動盈虧") }} ({{ activeObj.symbolCode }})
+        </div>
       </div>
       <div class="item">
-        <div class="itembox-data">-23.1689</div>
-        <div v-if="activeObj.laber !== 'USD'" class="number-text">
-          ≈ $0.0000
+        <div class="itembox-data">
+          ₹{{ activeObj.availableBalance | _toLocaleString }}
         </div>
-        <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+        <div class="itembox-name">
+          {{ $t("可用資產") }} ({{ activeObj.symbolCode }})
+        </div>
       </div>
       <div class="item">
-        <div class="itembox-data">-23.1689</div>
-        <div v-if="activeObj.laber !== 'USD'" class="number-text">
-          ≈ $0.0000
+        <div class="itembox-data">
+          {{ activeObj.isZf === 1 ? "-" : "" }}
+          ₹{{ activeObj.cumulativeProfitAndLoss | _toLocaleString }}
         </div>
-        <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+        <div class="itembox-name">
+          {{ $t("累計盈虧") }} ({{ activeObj.symbolCode }})
+        </div>
       </div>
       <div class="item">
-        <div class="itembox-data">-23.1689</div>
-        <div v-if="activeObj.laber !== 'USD'" class="number-text">
-          ≈ $0.0000
+        <div class="itembox-data">
+          ₹{{ activeObj.freezeMoney | _toLocaleString }}
         </div>
-        <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+        <div class="itembox-name">
+          {{ $t("凍結資產") }} ({{ activeObj.symbolCode }})
+        </div>
       </div>
       <div class="item">
-        <div class="itembox-data">-23.1689</div>
-        <div v-if="activeObj.laber !== 'USD'" class="number-text">
-          ≈ $0.0000
+        <div class="itembox-data">
+          ₹{{ activeObj.handlingCharge | _toLocaleString }}
         </div>
-        <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+        <div class="itembox-name">
+          {{ $t("總手續費") }} ({{ activeObj.symbolCode }})
+        </div>
+      </div>
+      <div class="item">
+        <div class="itembox-data">
+          ₹{{ activeObj.amountToBeCovered | _toLocaleString }}
+        </div>
+
+        <div class="itembox-name">
+          {{ $t("待补金额") }} ({{ activeObj.symbolCode }})
+        </div>
       </div>
     </div>
+    <Dialog ref="closeAllDialog" :title="$t('一鍵平倉')" :confirm="confirm">
+      <template v-slot:center>
+        <div>{{ $t("您確定一鍵平倉所有訂單嗎?") }}</div>
+      </template>
+    </Dialog>
   </div>
 </template>
 
 <script>
+import Dialog from "@/components/Dialog";
+import { allsell } from "../../../axios/api";
+
 export default {
+  components: { Dialog },
   props: {
     activeObj: {
       type: Object,
       default: {},
+    },
+    itemClick: {
+      type: Function,
+      default: () => {},
+    },
+  },
+  methods: {
+    async confirm() {
+      console.log(this.activeObj.laber);
+      const res = await allsell({ stockType: this.activeObj.laber });
+      if (res.status === 0) {
+        this.itemClick();
+        this.$refs.closeAllDialog.show = false;
+      }
+    },
+
+    closeAll() {
+      this.$refs.closeAllDialog.show = true;
     },
   },
 };
@@ -70,7 +120,7 @@
   margin-top: 0.42667rem;
   padding: 0.32rem 0.4rem;
   box-sizing: border-box;
-  background-color: #ff5b96;
+  background-color: #03a7ef;
   color: #fff;
   .total-assets {
     display: flex;
@@ -122,10 +172,10 @@
   display: flex;
   flex-wrap: wrap; /* 自动换行 */
   .item {
-    width: 33%;
+    width: 50%;
     // height: 20px;
-    min-width: 33%;
-    max-width: 33%;
+    min-width: 50%;
+    max-width: 50%;
     // background-color: #fff;
     .itembox-data {
       font-style: normal;
@@ -154,4 +204,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3