From 836a56418f932086e4221cb6c5e6a56f1c0dfecf Mon Sep 17 00:00:00 2001
From: 李 <344137771@qq.com>
Date: Fri, 22 May 2026 15:07:30 +0800
Subject: [PATCH] 1

---
 src/views/trade/index.vue |   39 ++++++++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue
index 7d4f090..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)">
@@ -13,17 +14,16 @@
     <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">
+    <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>&nbsp;
         <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">
@@ -77,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">
@@ -237,6 +237,7 @@
       })
     }
     return {
+      leverRate: 100,
       quote: {},
       initTimer: null,
       keyIndex: 0,
@@ -305,10 +306,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 +318,10 @@
     })
   },
   methods: {
+	  
     ...mapActions('home', [SET_COIN_LIST]),
     onUpdate(symbol) { // 更新
+		this.keyIndex += 1
       this.currentType = 'long'
       this.symbol = symbol
       this.closeSocket()
@@ -367,6 +370,10 @@
       this[this.curTab](this.symbol)
       _initOpen({ symbol: this.symbol }).then(data => {
         this.initOpen = data
+      })
+      // 平仓/撤单后刷新永续余额
+      _futrueOrderInit(this.symbol).then(data => {
+        this.initFutrue = data
       })
     },
     handleClickShowMore() {
@@ -492,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
@@ -538,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
@@ -715,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;
@@ -749,6 +763,10 @@
 #cryptos {
   background: $mainbgWhiteColor;
   $inp-b: #f7f7f7;
+
+  .trade-content-bg {
+    background: #fff;
+  }
 
   :deep(.textColor) {
     color: $log-c;
@@ -845,6 +863,7 @@
     border-top-left-radius: 20px;
     border-top-right-radius: 20px;
     box-sizing: border-box;
+    background-color: #fff;
   }
 
 
@@ -908,8 +927,6 @@
   .my-swipe {
     width: 100%;
   }
-
-  .my-swipe .van-swipe-item {}
 
   .line {
     height: 13px;

--
Gitblit v1.9.3