From c6ccd498aa419327de7c64e03f989964eeb5d278 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 16:26:11 +0800
Subject: [PATCH] 退出二次确认

---
 src/components/Transform/trade-order-area/index.vue |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/components/Transform/trade-order-area/index.vue b/src/components/Transform/trade-order-area/index.vue
index 5117d66..769022b 100644
--- a/src/components/Transform/trade-order-area/index.vue
+++ b/src/components/Transform/trade-order-area/index.vue
@@ -39,7 +39,10 @@
       <input :placeholder="$t('数量')" class=" w-full h-70 border-none textColor font-28" v-model="form.volume"
         @input="onInput" />
       <span class="textColor font-28">{{ symbol.toLocaleUpperCase() }}</span>
-      <span @click="fillAllBalance" class="cursor-pointer text-blue-500 " style="padding: 0 10px;">{{ $t('全部') }}</span>
+      <span @click="fillAllBalance" class="cursor-pointer text-blue-500"
+        style="padding: 0 10px;width: 80px;text-align: right;">{{
+          $t('全部')
+        }}</span>
     </div>
     <div v-if="isTotal" class="h-70 lh-70 inputBackground  mb-36 flex justify-center px-16">
       <input :placeholder="$t('总额')" class=" w-full h-70 border-none textColor font-28" v-model="form.total"
@@ -218,13 +221,17 @@
           this.form.volume = Math.floor(sum * 100000) / 100000;
           this.onInput();
         } else {
-          let sum = parseFloat(this.initClose.volume)
-          this.form.volume = (Math.floor(sum * (val / 100) * 100000)) / 100000
+          let sum = parseFloat(this.initClose.volume) || 0;
+          console.log('sum1: ', sum, this.initClose.volume)
+          this.form.volume = (Math.floor(sum * (val / 100) * 100000)) / 100000;
+          this.onInput();
+
         }
       } else {
         if (this.currentType == 'open') {
           this.form.total = this.initOpen.volume * (val / 100)
         } else {
+          console.log('volume1: ', this.initClose.volume)
           this.form.total = Math.floor((this.initClose.volume * (val / 100) * parseFloat(this.form.price)) * 1000) / 1000
         }
       }
@@ -240,7 +247,7 @@
       } else {
         vol = this.initClose.volume / 1
       }
-      this.options.max = Number(vol.toFixed(3))
+      this.options.max = vol ? Number(vol.toFixed(3)) : 0
       if (this.options.max > 0) {
         this.options.disabled = false
       } else {
@@ -257,7 +264,7 @@
           this.form.volume = maxSum
         }
       } else {
-        if (this.form.volume * 1 / 1 > this.options.max / 1) {
+        if (!isNaN(this.options.max) && this.form.volume * 1 > this.options.max) {
           this.form.volume = this.options.max / 1
         }
       }

--
Gitblit v1.9.3