From 1201bf91b3dcac3f5b69c755ff2e54c362956467 Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Mon, 09 Mar 2026 16:41:01 +0800
Subject: [PATCH] 1
---
src/views/trade/index.vue | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue
index 817e013..6bcd312 100644
--- a/src/views/trade/index.vue
+++ b/src/views/trade/index.vue
@@ -1,5 +1,6 @@
<template>
<div id="cryptos" class="trade_new">
+ <!-- 顶部导航与选择条已去掉 -->
<!-- <div class="flex justify-start items-center">
<img src="@/assets/image/icon_back.png" alt="" class="back mr-20" @click="$router.go(-1)">
@@ -15,14 +16,14 @@
</ContractHeader>
<!-- <Head :symbolObj="symbolObj"></Head> -->
- <div :key="symbol" class="pb-108 no_touch">
+ <div :key="symbol" class="pb-108 no_touch ">
<p class="status-info" v-if="chartData.market && chartData.market.status">
<span>{{ chartData.market.status && $t(chartData.market.status) }},</span>
<span class="time">{{ chartData.market.time_str }}</span>
<span>{{ chartData.market.time_zone && $t(chartData.market.time_zone) }}</span>
</p>
<div :class="{ slide2: animated1 }" v-if="selectIndex === 1">
- <section class="value-container" v-if="showMore">
+ <section class="value-container trade-hide-stats" v-if="showMore">
<div class="flex-l">
<p class="first-line red">{{ formatMoney(chartData?.close) }}</p>
<p class="second-line">
@@ -76,21 +77,21 @@
</div>
</section>
<div class=" rounded-view" key="x">
- <PerpetualOpen class="pl-30 pr-30" :key="keyIndex + 'a'" :selectIndex="selectIndex" :symbol="symbol"
+ <PerpetualOpen class="pl-30 pr-30" style="background-color: #fff;border-radius: 20px;" :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 class="pl-30 pr-30" style="background-color: #fff;" :key="keyIndex + 'b'" :symbol="symbol" :order-cur="orderCur"
:order-hold="orderHold" :topIndex="selectIndex" :futrue-hold="futrueHold" :futrue-histroy="futrueHistroy"
@tab="onTab" @recall="onRecall">
</PerpetualOrder>
</div>
</div>
<div :class="{ slide1: animated2 }" v-else>
- <section class="value-container" v-if="showMore">
+ <section class="value-container trade-hide-stats" v-if="showMore">
<div class="flex-l">
<p class="first-line red">{{ formatMoney(chartData?.close) }}</p>
<p class="second-line">
@@ -236,6 +237,7 @@
})
}
return {
+ leverRate: 100,
quote: {},
initTimer: null,
keyIndex: 0,
@@ -369,6 +371,10 @@
_initOpen({ symbol: this.symbol }).then(data => {
this.initOpen = data
})
+ // 平仓/撤单后刷新永续余额
+ _futrueOrderInit(this.symbol).then(data => {
+ this.initFutrue = data
+ })
},
handleClickShowMore() {
this.showMore = !this.showMore
@@ -493,6 +499,8 @@
}
},
startDeepSocket() {
+ this.asks = []
+ this.bids = []
this.sockets.deep = new WebSocket(`${WS_URL}/3/${this.symbol}`)
this.sockets.deep.onmessage = (evt) => {
const { data } = evt
@@ -539,7 +547,8 @@
initFun()
}, 600);
}
- if (type === 'futrue' || !type) {
+ // 购买/开仓/平仓后都刷新永续余额 initFutrue.amount
+ if (type === 'futrue' || type === 'close' || type === 'open' || type === 'long' || type === 'short' || !type) {
_futrueOrderInit(symbol).then(data => {
console.log(data, '数据9999')
this.initFutrue = data
@@ -716,11 +725,15 @@
<style lang="scss" scoped>
@import "@/assets/init.scss";
+.trade-hide-stats.value-container {
+ display: none;
+}
+
.trade_new {
color: $log-c;
background: $mainbgWhiteColor;
min-height: 100vh;
- padding: 1.4rem 1.4rem 7rem 1.4rem;
+ // padding: 1.4rem 1.4rem 7rem 1.4rem;
.back {
width: 2rem;
@@ -750,6 +763,10 @@
#cryptos {
background: $mainbgWhiteColor;
$inp-b: #f7f7f7;
+
+ .trade-content-bg {
+ background: #fff;
+ }
:deep(.textColor) {
color: $log-c;
@@ -846,6 +863,7 @@
border-top-left-radius: 20px;
border-top-right-radius: 20px;
box-sizing: border-box;
+ background-color: #fff;
}
@@ -909,8 +927,6 @@
.my-swipe {
width: 100%;
}
-
- .my-swipe .van-swipe-item {}
.line {
height: 13px;
--
Gitblit v1.9.3