From e01cee0f0c5c5c2eb2d8595eadb3c7a9df2a37fc Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Wed, 21 Jan 2026 16:37:01 +0800
Subject: [PATCH] 1
---
src/components/Transform/trade-order-area/index.vue | 46 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/src/components/Transform/trade-order-area/index.vue b/src/components/Transform/trade-order-area/index.vue
index 1681343..1a4c523 100644
--- a/src/components/Transform/trade-order-area/index.vue
+++ b/src/components/Transform/trade-order-area/index.vue
@@ -26,6 +26,11 @@
<div class="h-70 lh-70 inputBackground mb-25 flex justify-center px-16 textColor2">
<span>{{ title }}</span>
</div>
+
+ <!-- <template v-if="initClose.status / 1 === 0">
+ <div class="flex justify-center items-center h-66 buy-item">{{ $t('停牌中,禁止交易') }}</div>
+ </template> -->
+ <!-- <template v-else> -->
<div class="flex total-list">
<div class="total-div" :class="[!isTotal ? 'active-bg' : '']" @click="checkIsTotal(false)">
{{ $t('数量') }}
@@ -37,7 +42,7 @@
<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.volume"
@input="onInput" />
- <span class="textColor font-28">{{ symbol.toLocaleUpperCase() }}</span>
+ <span class="textColor font-28">{{ strToArr(symbolName.toLocaleUpperCase(), '/')[0] }}</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"
@@ -60,8 +65,11 @@
<p class="text-grey" v-if="this.currentType === 'open'">{{ $t('可用') }}<span class="textColor ml-8">
{{ initOpen.volume }} USDT</span>
</p>
- <p class="text-grey" v-else>{{ $t('可卖') }}<span class="textColor ml-8">{{ initClose.volume }} {{
- symbol.toLocaleUpperCase() }}</span></p>
+ <p class="text-grey" v-else>{{ $t('可卖') }}
+ <span class="textColor ml-8">
+ {{ initClose.volume }} {{ strToArr(symbolName.toLocaleUpperCase(), '/')[0] }}
+ </span>
+ </p>
</div>
<van-icon name="add-o" @click="$router.push('/cryptos/exchangePage')" class="font-30 add-icon" />
<!-- <img @click="$router.push('/exchange/exchangePage')" src="@/assets/image/public/switch.png" class="w-24 h-24" /> -->
@@ -71,7 +79,7 @@
:class="currentType === 'open' ? 'bg-green' : 'bg-red'" @click="order()">
{{ currentType == 'open' ? $t('买入') : $t('卖出') }}
</div>
-
+ <!-- </template> -->
</div>
</template>
@@ -81,7 +89,9 @@
import 'vue-slider-component/theme/default.css'
import { _getBalance } from "@/service/user.api.js";
import TradeApi from "@/service/trading.js";
+import { strToArr } from '@/utils/utis'
import { mapGetters } from "vuex";
+import { getStorage, setStorage } from '@/utils/index.js';
// import PopupConfirmOrder from '@/components/popup-confirm-order'
export default {
name: "perpetualPosition",
@@ -95,7 +105,7 @@
type: String,
default: ''
},
- symbol: {
+ symbolName: {
type: String,
default: ''
},
@@ -127,6 +137,8 @@
this.title = this.selectData[0].title
this.type = this.selectData[0].type
this.form.order_price_type = 'opponent'
+ // 检查是否有从其他页面传递的卖出参数
+ this.checkSellParams()
},
watch: {
initOpen: { // 处理滚动条初始值
@@ -182,8 +194,26 @@
this.title = this.selectData[0].title
this.type = this.selectData[0].type
this.form.order_price_type = 'opponent'
+ // 检查是否有从其他页面传递的卖出参数
+ this.checkSellParams()
},
methods: {
+ strToArr,
+ // 检查是否有从其他页面传递的卖出参数
+ checkSellParams() {
+ const sellParams = getStorage('tradeSellParams')
+ if (sellParams && sellParams.mode === 'close' && sellParams.volume) {
+ // 切换到卖出模式
+ this.changeTab('close')
+ // 设置数量
+ this.$nextTick(() => {
+ this.form.volume = sellParams.volume
+ this.isTotal = false
+ })
+ // 清除存储的参数
+ window.localStorage.removeItem('tradeSellParams')
+ }
+ },
checkIsTotal(val) {
this.isTotal = val
this.percentageVal = 0
@@ -521,7 +551,7 @@
}
.option-box>div:hover {
- background-color: rgba($color: $bg_yellow, $alpha: 0.6);
+ background-color: rgba($color: $bg_yellow, $alpha: 0.6);
}
.num-text-color {
@@ -556,6 +586,7 @@
.inputBackground {
border-radius: 2.5rem;
+
input {
background: transparent !important;
}
@@ -576,7 +607,7 @@
display: flex;
- color: $text_color;
+ color: $text_color3;
font-size: 26px;
align-items: center;
@@ -594,6 +625,7 @@
.active-bg {
background: $input_background;
border-radius: 2.5rem;
+ color: $text_color;
}
.buyandSell {
--
Gitblit v1.9.3