From 9d7de030d38f8d71fdf54ddfe26e46e71f17e9c0 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Sat, 20 Sep 2025 15:21:43 +0800
Subject: [PATCH] 1

---
 src/views/home/components/HomeRight.vue |   47 +++++++++++++++++++++++++++++------------------
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/src/views/home/components/HomeRight.vue b/src/views/home/components/HomeRight.vue
index 74b1e4d..f103f2e 100644
--- a/src/views/home/components/HomeRight.vue
+++ b/src/views/home/components/HomeRight.vue
@@ -45,16 +45,17 @@
         <div class="value">
           {{ obj.type | currencySymbol }}
           {{ (obj.nowPrice * bform.num) | _toLocaleString }}
-          <div v-if="obj.type == 'US'">
-            ≈ MX$ {{ (obj.nowPrice * bform.num * utm) | _toLocaleString }}
-          </div>
+          <!-- <div v-if="obj.type != $mc">
+            ≈ $
+            {{ (obj.nowPrice * bform.num * rate(obj.type)) | _toLocaleString }}
+          </div> -->
         </div>
       </div>
 
       <div class="info_item flex-between">
         <div class="label">{{ $t("hj48") }}</div>
         <div class="value">
-          {{ moneyData.symbol }} {{ moneyData.availableBalance }}
+          {{ CurrentMoneyData.symbol }} {{ CurrentMoneyData.availableBalance }}
         </div>
       </div>
 
@@ -103,9 +104,10 @@
         <div class="value">
           {{ obj.type | currencySymbol }}
           {{ (obj.nowPrice * sform.num) | _toLocaleString }}
-          <div v-if="obj.type == 'US'">
-            ≈ MX$ {{ (obj.nowPrice * sform.num * utm) | _toLocaleString }}
-          </div>
+          <!-- <div v-if="obj.type != $mc">
+            ≈ $
+            {{ (obj.nowPrice * sform.num * rate(obj.type)) | _toLocaleString }}
+          </div> -->
         </div>
       </div>
 
@@ -143,7 +145,7 @@
         100: "100%",
       },
       depositAmount: "", // 存款金额
-      moneyData: {}, // 账户金额
+      moneyData: [], // 账户金额
       pages: {}, // 已购买股票信息
     };
   },
@@ -157,6 +159,18 @@
       default: null,
     },
   },
+  computed: {
+    // 当前账户金额
+    CurrentMoneyData() {
+      let obj = {};
+      this.moneyData.forEach((i) => {
+        if (i.accectType == this.obj.type) {
+          obj = i;
+        }
+      });
+      return obj;
+    },
+  },
   watch: {
     obj: {
       handler(val) {
@@ -167,15 +181,10 @@
     },
     // 通过进度条来计算数量
     bVal(val) {
-      if (this.obj.type == "US")
-        this.bform.num = Math.floor(
-          (this.moneyData.availableBalance * (val / 100)) /
-            (this.obj.nowPrice * this.utm)
-        );
-      else
-        this.bform.num = Math.floor(
-          (this.moneyData.availableBalance * (val / 100)) / this.obj.nowPrice
-        );
+      this.bform.num = Math.floor(
+        (this.CurrentMoneyData.availableBalance * (val / 100)) /
+          this.obj.nowPrice
+      );
     },
     sVal(val) {
       this.sform.num = Math.ceil(this.pages.orderNum * (val / 100));
@@ -200,7 +209,7 @@
     async getMoney() {
       let data = await api.getMoney();
       if (data.status === 0) {
-        this.moneyData = data.data[0];
+        this.moneyData = data.data;
       }
     },
     // 买卖,买:0,卖:1
@@ -215,6 +224,7 @@
       if (data.status === 0) {
         this.$message.success(data.msg);
         this.getMoney();
+        this.$emit("Refresh");
       } else {
         this.$message.error(data.msg);
       }
@@ -239,6 +249,7 @@
       if (data.status == 0) {
         this.$message.success(data.msg);
         this.getInfoSite();
+        this.$emit("Refresh");
       }
     }),
   },

--
Gitblit v1.9.3