From 03043192ddf00f9a36b7454799a9152cd1b50a0b Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:13:45 +0800
Subject: [PATCH] 1
---
src/views/cryptos/PerpetualContract/index.vue | 58 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/src/views/cryptos/PerpetualContract/index.vue b/src/views/cryptos/PerpetualContract/index.vue
index 8d0cf65..b5867b0 100644
--- a/src/views/cryptos/PerpetualContract/index.vue
+++ b/src/views/cryptos/PerpetualContract/index.vue
@@ -243,6 +243,8 @@
import { useUserStore } from "@/store/user";
const userStore = useUserStore();
const quotesStore = useQuotesStore()
+let timer = null // 底部持仓等的公用定时器
+let timer1 = null
var showLength = 7
export default {
@@ -292,8 +294,6 @@
initTimer: null,
keyIndex: 0,
timeout: null,
- timer: null, // 底部持仓等的公用定时器
- timer1: null,
balance: 0,
symbol: '',
price: '',
@@ -355,10 +355,11 @@
}
},
async created() {
-
if (this.$route.query.type) {
this.type = this.$route.query.type
}
+ this.symbol = this.$route.params.symbol
+
await this.SET_COIN_LIST(this.type)
// _getBalance().then(data => { // 获取用户余额
// this.$store.commit('user/SET_USERINFO', { balance: data.money })
@@ -369,7 +370,7 @@
this.getBalance()
this.timerMoeny = setInterval(() => {
this.getBalance()
- }, 3000)
+ }, 5000)
}
},
methods: {
@@ -425,7 +426,6 @@
symbolType: 'cryptos'
}
contractOrder(obj).then(data => {
-
this.orderHold = data
})
this[this.curTab](this.symbol)
@@ -443,16 +443,16 @@
if (this.selectIndex / 1 === 1) {
this.curTab = 'fetchOrderListHold'
this.animated2 = true
- this.timer1 = setTimeout(() => {
+ timer1 = setTimeout(() => {
this.animated2 = false
- clearTimeout(this.timer1)
- }, 1000)
+ clearTimeout(timer1)
+ }, 5000)
} else {
this.animated1 = true
- this.timer1 = setTimeout(() => {
+ timer1 = setTimeout(() => {
this.animated1 = false
- clearTimeout(this.timer1)
- }, 1000)
+ clearTimeout(timer1)
+ }, 5000)
}
this[this.curTab](this.symbol)
},
@@ -569,7 +569,7 @@
}).catch(err => {
this.initFunTimer1 = setTimeout(() => {
initFun()
- }, 1000);
+ }, 5000);
})
}
initFun()
@@ -585,7 +585,7 @@
}).catch(err => {
this.initFunTimer2 = setTimeout(() => {
initFun()
- }, 1000);
+ }, 5000);
})
}
this.initFunTimer2 = setTimeout(() => {
@@ -610,24 +610,24 @@
this.orderCur = data
})
this.clearTimer()
- this.timer = setInterval(() => {
+ timer = setInterval(() => {
_contractApplyOrderList({
symbol,
type: 'orders',
page_no: 1
}).then(data => {
- // if (typeof this.timer === 'string') {
- // this.timer = null
+ // if (typeof timer === 'string') {
+ // timer = null
// return
// }
this.orderCur = data
})
- }, 1000)
+ }, 5000)
}
},
fetchOrderListHold(symbol) { // 当前持仓
let obj = {
- symbol: symbol,
+ symbol: this.symbol,
type: 'orders',
page_no: 1,
symbolType: 'cryptos'
@@ -637,16 +637,16 @@
// this.orderHold = data
this.orderHold = data.sort(this.sortData);
})
- this.timer = setInterval(() => {
+ timer = setInterval(() => {
contractOrder(obj).then(data => {
- // if (typeof this.timer === 'string') {
- // this.timer = null
+ // if (typeof timer === 'string') {
+ // timer = null
// return
// }
// this.orderHold = data
this.orderHold = data.sort(this.sortData);
})
- }, 1000)
+ }, 5000)
}
},
fetchFutrueHoldList(symbol) { // 交割持仓
@@ -655,16 +655,16 @@
// this.futrueHold = data
this.futrueHold = data.sort(this.sortData);
})
- this.timer = setInterval(() => {
+ timer = setInterval(() => {
_futrueOrderList(symbol, 'orders', 1, 'cryptos').then(data => {
- // if (typeof this.timer === 'string') {
- // this.timer = null
+ // if (typeof timer === 'string') {
+ // timer = null
// return
// }
// this.futrueHold = data
this.futrueHold = data.sort(this.sortData);
})
- }, 1000)
+ }, 5000)
}
},
fetchFutrueHistory(symbol) { // 交割历史持仓
@@ -711,12 +711,12 @@
clearTimeout(this.initFunTimer2)
this.initFunTimer2 = null
}
- clearInterval(this.timer)
+ clearInterval(timer)
// if (isNeed) {
- // this.timer = ''
+ // timer = ''
// return
// }
- this.timer = null
+ timer = null
},
changeCurrentType(type) {
this.currentType = type
--
Gitblit v1.9.3