From dce10d37ad35efe8ed1d39d6e5fcf7e4904381df Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 12 Jun 2026 13:19:53 +0800
Subject: [PATCH] 1
---
src/views/trade/components/OptionsContract.vue | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/src/views/trade/components/OptionsContract.vue b/src/views/trade/components/OptionsContract.vue
index 5fef394..1df6498 100644
--- a/src/views/trade/components/OptionsContract.vue
+++ b/src/views/trade/components/OptionsContract.vue
@@ -43,7 +43,7 @@
<div class="line"></div>
<PerpetualOrder class="pl-8 pr-8" :key="keyIndex + 'b'" :symbol="symbol" :order-cur="orderCur"
:order-hold="orderHold" :topIndex="selectIndex" :futrue-hold="futrueHold" :futrue-histroy="futrueHistroy"
- @tab="onTab" @recall="onRecall" />
+ :perpetual-histroy="perpetualHistroy" :symbol-type="type" @tab="onTab" @recall="onRecall" />
</div>
</div>
@@ -85,8 +85,8 @@
<div class="px-2 ml-12 py-2 flex items-center textColor1 text-28" @click="onDeliveryTab('history')"
:class="deliveryPositionTab === 'history' ? 'active-line' : ''">{{ $t('历史仓位') }}</div>
</div>
- <img src="@/assets/image/public/record.png" alt="record-img" class="w-16 h-9 pr-8 record-img"
- @click="goDeliveryHistory" />
+ <!-- <img src="@/assets/image/public/record.png" alt="record-img" class="w-16 h-9 pr-8 record-img"
+ @click="goDeliveryHistory" /> -->
</div>
<template v-if="deliveryPositionTab === 'hold'">
<futrue-hold-list :price="price" :list-data="futrueHold" />
@@ -216,6 +216,7 @@
bids: initDepthArr(),
orderCur: [],
orderHold: [],
+ perpetualHistroy: [],
futrueHold: [],
futrueHistroy: [],
curTab: 'fetchOrderListHold',
@@ -290,6 +291,8 @@
symbol(val) {
if (val && val !== this._lastSymbol) {
this._lastSymbol = val
+ this.futrueHold = []
+ this.futrueHistroy = []
this.closeSocket()
this.init(val)
}
@@ -456,6 +459,7 @@
},
fetchOrderListCur(symbol) {
if (!this.userInfo || !this.userInfo.token) return
+ symbol = ''
const params = { symbol, type: 'orders', page_no: 1 }
_contractApplyOrderList(params).then(data => { this.orderCur = data || [] })
this.clearTimer()
@@ -465,6 +469,8 @@
},
fetchOrderListHold(symbol) {
if (!this.userInfo || !this.userInfo.token) return
+ symbol = ''
+
const symbolType = this.type || 'cryptos'
const obj = { symbol, type: 'orders', page_no: 1, symbolType }
contractOrder(obj).then(data => {
@@ -480,20 +486,30 @@
fetchFutrueHoldList(symbol) {
if (!this.userInfo || !this.userInfo.token) return
const symbolType = this.type || 'cryptos'
- _futrueOrderList(symbol, 'orders', 1, symbolType).then(data => {
+ const querySymbol = symbol || this.symbol || ''
+ _futrueOrderList(querySymbol, 'orders', 1, symbolType).then(data => {
this.futrueHold = (data || []).sort(this.sortData)
})
this.clearTimer()
this.timer = setInterval(() => {
- _futrueOrderList(symbol, 'orders', 1, symbolType).then(data => {
+ _futrueOrderList(querySymbol, 'orders', 1, symbolType).then(data => {
this.futrueHold = (data || []).sort(this.sortData)
})
}, 1000)
},
fetchFutrueHistory(symbol) {
const symbolType = this.type || 'cryptos'
- _futrueOrderList(symbol, 'hisorders', 1, symbolType).then(data => {
+ const querySymbol = symbol || this.symbol || ''
+ _futrueOrderList(querySymbol, 'hisorders', 1, symbolType).then(data => {
this.futrueHistroy = data || []
+ })
+ },
+ fetchPerpetualHistory(symbol) {
+ if (!this.userInfo || !this.userInfo.token) return
+ symbol = ''
+ const symbolType = this.type || 'cryptos'
+ contractOrder({ symbol, type: 'hisorders', page_no: 1, symbolType }).then(data => {
+ this.perpetualHistroy = data || []
})
},
init(symbol) {
@@ -502,10 +518,22 @@
this.fetchDeepData(symbol)
this.initParam(symbol)
this.clearTimer()
+ if ((this.selectIndex ?? 1) === 2) {
+ if (this.deliveryPositionTab === 'history') {
+ this.curTab = 'fetchFutrueHistory'
+ this.fetchFutrueHistory(symbol)
+ } else {
+ this.curTab = 'fetchFutrueHoldList'
+ this.fetchFutrueHoldList(symbol)
+ }
+ return
+ }
if (this.curTab === 'fetchOrderListHold') {
this.fetchOrderListHold(symbol)
+ } else if (typeof this[this.curTab] === 'function') {
+ this[this.curTab](symbol)
} else {
- this.fetchFutrueHoldList(symbol)
+ this.fetchOrderListHold(symbol)
}
},
closeSocket() {
--
Gitblit v1.9.3