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/entrust-item/index.vue     |    6 +++---
 src/views/my/newindex.vue                           |   24 +++++++++++++++++-------
 src/components/Transform/trade-order-area/index.vue |   17 ++++++++++++-----
 src/main.js                                         |    2 ++
 src/views/cryptos/DeliveryContractHistory/index.vue |    2 +-
 src/views/cryptos/TradeRecord/index.vue             |    2 +-
 src/i18n/cn.js                                      |    2 ++
 src/i18n/en.js                                      |    2 ++
 src/i18n/zhcn.js                                    |    2 ++
 9 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/src/components/Transform/entrust-item/index.vue b/src/components/Transform/entrust-item/index.vue
index 5179cde..8ad1cf7 100644
--- a/src/components/Transform/entrust-item/index.vue
+++ b/src/components/Transform/entrust-item/index.vue
@@ -44,9 +44,9 @@
         <button v-if="state == 'submitted'" class="ml-19 order-btn border-none h-54 lh-54 cancel-btn greyBg textColor"
           @click.stop="cancelSingle(entrust.order_no)">
           {{ $t('撤单') }}</button>
-        <button v-if="state == 'created'" class="ml-19 order-btn border-none h-54 lh-54 cancel-btn text-green greyBg">{{
+        <button v-if="state == 'created'" class="ml-19 order-btn border-none h-54 lh-54 cancel-btn text-green">{{
           $t('已完成') }}</button>
-        <button v-if="state == 'canceled'" class="ml-19 order-btn border-none h-54 lh-54 cancel-btn greyBg textColor">{{
+        <button v-if="state == 'canceled'" class="ml-19 order-btn border-none h-54 lh-54 cancel-btn textColor">{{
           $t('canceled') }}</button>
       </div>
     </div>
@@ -97,7 +97,7 @@
   }
 }
 </script>
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 @import "@/assets/init.scss";
 
 #cryptos {
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
         }
       }
diff --git a/src/i18n/cn.js b/src/i18n/cn.js
index 4bffaa9..6c71206 100644
--- a/src/i18n/cn.js
+++ b/src/i18n/cn.js
@@ -2789,4 +2789,6 @@
     "兑换": "兌換",
     "k线图获取失败": "k線圖獲取失敗",
     "当前币对不存在": "當前幣對不存在",
+    "确认退出": "確認退出",
+    "确定要退出登录吗?": "確認要退出登錄嗎?"
 }
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 0d47725..6676e25 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -2765,4 +2765,6 @@
     "兑换": "Exchange",
     "k线图获取失败": "Kline chart fetch failed",
     "当前币对不存在": "Current currency pair does not exist",
+    "确认退出": "Confirm exit",
+    "确定要退出登录吗?": "Confirm to exit login?"
 }
\ No newline at end of file
diff --git a/src/i18n/zhcn.js b/src/i18n/zhcn.js
index 867a629..6cbdd19 100644
--- a/src/i18n/zhcn.js
+++ b/src/i18n/zhcn.js
@@ -2770,4 +2770,6 @@
     "兑换": "兑换",
     "k线图获取失败": "k线图获取失败",
     "当前币对不存在": "当前币对不存在",
+    "确认退出": "确认退出",
+    "确定要退出登录吗?": "确定要退出登录吗?"
 }
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 947c03e..e878f57 100644
--- a/src/main.js
+++ b/src/main.js
@@ -9,6 +9,7 @@
 import i18n from '@/i18n'
 import '@/assets/remNew.js'
 import 'vant/es/toast/style';
+import { Dialog } from 'vant';
 import router from '@/router'
 import pinia from '@/store'
 import store from '@/store/store'
@@ -25,5 +26,6 @@
 app.use(router)
 app.use(pinia)
 app.use(store)
+app.use(Dialog)
 
 app.mount('#app')
diff --git a/src/views/cryptos/DeliveryContractHistory/index.vue b/src/views/cryptos/DeliveryContractHistory/index.vue
index 1652476..024ed95 100644
--- a/src/views/cryptos/DeliveryContractHistory/index.vue
+++ b/src/views/cryptos/DeliveryContractHistory/index.vue
@@ -171,7 +171,7 @@
   :deep(.van-tab--active) {
     background: $btn_main;
     border-radius: 5px;
-    color: $text_color !important;
+    color: #fff !important;
   }
 
   :deep(.van-tabs__nav) {
diff --git a/src/views/cryptos/TradeRecord/index.vue b/src/views/cryptos/TradeRecord/index.vue
index 3c1a383..b99f22a 100644
--- a/src/views/cryptos/TradeRecord/index.vue
+++ b/src/views/cryptos/TradeRecord/index.vue
@@ -179,7 +179,7 @@
     :deep(.van-tab--active) {
       background: $btn_main;
       border-radius: 5px;
-      color: $text_color !important;
+      color: #fff !important;
     }
 
     :deep(.van-tabs__wrap) {
diff --git a/src/views/my/newindex.vue b/src/views/my/newindex.vue
index c67deee..bdadfab 100644
--- a/src/views/my/newindex.vue
+++ b/src/views/my/newindex.vue
@@ -67,7 +67,7 @@
 import { useUserStore } from '@/store/user';
 import { useI18n } from "vue-i18n";
 import useClipboard from "vue-clipboard3";
-import { showToast } from "vant";
+import { showConfirmDialog } from 'vant';
 import addBankIcon from '@/assets/image/userCenter/addBank.png'
 import kycHighStatusIcon from '@/assets/image/userCenter/kycHighStatus.png'
 import store from '@/store/store'
@@ -196,12 +196,22 @@
 
 })
 const loginOut = () => {
-  _logOut({
-    token: userStore.userInfo.token
-  }).then(res => {
-    userStore.userInfo = {}
-    store.state.user.userInfo = {}
-    router.push('/login')
+  showConfirmDialog({
+    title: `${t('确认退出')}`,
+    message: `${t('确定要退出登录吗?')}`
+  }).then(() => {
+    _logOut({
+      token: userStore.userInfo.token
+    }).then(res => {
+      userStore.userInfo = {}
+      store.state.user.userInfo = {}
+      router.push('/login')
+    })
+      .catch(err => {
+        // showFailToast(`${t('退出失败,请重试')}`)
+      })
+  }).catch(() => {
+    // 用户取消操作
   })
 }
 const getIdentify = () => {

--
Gitblit v1.9.3