From 9a9d832dbd364557e070abcd9a7779a2c6c07ffb Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Tue, 20 Jan 2026 17:35:13 +0800
Subject: [PATCH] 1
---
src/views/trade/index.vue | 56 +++++++++++++++++++++-----------------------------------
1 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue
index 7d4f090..b82074f 100644
--- a/src/views/trade/index.vue
+++ b/src/views/trade/index.vue
@@ -13,7 +13,6 @@
<ContractHeader :symbol="symbol" :range="range" :selectIndex="selectIndex" :symbolName="symbolName"
:balance="userInfo.balance" @tab="onTopTab" @update-coin="onUpdate">
</ContractHeader>
-
<!-- <Head :symbolObj="symbolObj"></Head> -->
<div :key="symbol" class="pb-108 no_touch">
@@ -77,14 +76,14 @@
</div>
</section>
<div class=" rounded-view" key="x">
- <PerpetualOpen class="pl-30 pr-30" :key="keyIndex + 'a'" :selectIndex="selectIndex" :symbol="symbol"
+ <PerpetualOpen :key="keyIndex + 'a'" :selectIndex="selectIndex" :symbol="symbol"
:green-data="bids" :red-data="asks" :price="price" :init-open="initOpen" :init-close="initClose"
:init-futrue="initFutrue" :currentType="currentType" @changeValueBack="changeValueBack"
@changeCurrentType="changeCurrentType" @ordered="onOrdered">
</PerpetualOpen>
<!-- <div class="line"></div> -->
<!-- 委托/持仓-->
- <PerpetualOrder class="pl-30 pr-30" :key="keyIndex + 'b'" :symbol="symbol" :order-cur="orderCur"
+ <PerpetualOrder :key="keyIndex + 'b'" :symbol="symbol" :order-cur="orderCur"
:order-hold="orderHold" :topIndex="selectIndex" :futrue-hold="futrueHold" :futrue-histroy="futrueHistroy"
@tab="onTab" @recall="onRecall">
</PerpetualOrder>
@@ -144,14 +143,14 @@
</div>
</div>
</section>
- <div class=" rounded-view" key="y">
- <PerpetualOpen class="pl-30 pr-30" :key="keyIndex + 'c'" :selectIndex="selectIndex" :symbol="symbol"
+ <div class="rounded-view" key="y">
+ <PerpetualOpen :key="keyIndex + 'c'" :selectIndex="selectIndex" :symbol="symbol"
:green-data="bids" :red-data="asks" :price="price" :init-open="initOpen" :init-close="initClose"
:init-futrue="initFutrue" @ordered="onOrdered" @changeValueBack="changeValueBack">
</PerpetualOpen>
<!-- <div class="line"></div> -->
<!-- 委托/持仓-->
- <PerpetualOrder class="pl-30 pr-30" :key="keyIndex + 'd'" :symbol="symbol" :order-cur="orderCur"
+ <PerpetualOrder :key="keyIndex + 'd'" :symbol="symbol" :order-cur="orderCur"
:order-hold="orderHold" :price="price" :topIndex="selectIndex" :futrue-hold="futrueHold"
:futrue-histroy="futrueHistroy" @tab="onTab" @recall="onRecall">
</PerpetualOrder>
@@ -305,10 +304,10 @@
}
},
async created() {
-
if (this.$route.query.type) {
this.type = this.$route.query.type
}
+ this.keyIndex += 1
await this.SET_COIN_LIST(this.type)
_getBalance().then(data => { // 获取用户余额
this.$store.commit('user/SET_USERINFO', { balance: data.money })
@@ -317,8 +316,10 @@
})
},
methods: {
+
...mapActions('home', [SET_COIN_LIST]),
onUpdate(symbol) { // 更新
+ this.keyIndex += 1
this.currentType = 'long'
this.symbol = symbol
this.closeSocket()
@@ -492,6 +493,8 @@
}
},
startDeepSocket() {
+ this.asks = []
+ this.bids = []
this.sockets.deep = new WebSocket(`${WS_URL}/3/${this.symbol}`)
this.sockets.deep.onmessage = (evt) => {
const { data } = evt
@@ -716,8 +719,8 @@
@import "@/assets/init.scss";
.trade_new {
- color: $log-c;
- background: $mainbgWhiteColor;
+ // color: $log-c;
+ // background: $mainbgWhiteColor;
min-height: 100vh;
padding: 1.4rem 1.4rem 7rem 1.4rem;
@@ -747,23 +750,11 @@
}
#cryptos {
- background: $mainbgWhiteColor;
+ // background: $mainbgWhiteColor;
$inp-b: #f7f7f7;
:deep(.textColor) {
color: $log-c;
- }
-
- :deep(.long) {
- color: $log-c !important;
- background: $bg_yellow;
- border-radius: 5rem;
- }
-
- :deep(.short) {
- color: $log-c !important;
- background: $bg_yellow;
- border-radius: 5rem;
}
:deep(.poecs) {
@@ -774,20 +765,15 @@
background: $inp-b;
}
- :deep(.greyBg) {
- background: $inp-b;
- }
+ // :deep(.greyBg) {
+ // background: $inp-b;
+ // }
- :deep(.option-box) {
- background: $inp-b;
- box-shadow: 0px 0px 0.1875rem 0.1875rem $inp-b;
- color: $log-c !important;
- }
-
- :deep(.select-box) {
- background: $inp-b;
- color: $log-c !important;
- }
+ // :deep(.option-box) {
+ // background: $inp-b;
+ // box-shadow: 0px 0px 0.1875rem 0.1875rem $inp-b;
+ // color: $log-c !important;
+ // }
:deep(.rounded-lg) {
background: $inp-b;
--
Gitblit v1.9.3