| | |
| | | <!-- 委托/持仓--> |
| | | <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"> |
| | | </PerpetualOrder> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- 委托/持仓--> |
| | | <PerpetualOrder class="pl-8 pr-8" :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"> |
| | | :futrue-histroy="futrueHistroy" :perpetual-histroy="perpetualHistroy" :symbol-type="type" @tab="onTab" |
| | | @recall="onRecall"> |
| | | </PerpetualOrder> |
| | | </div> |
| | | </div> |
| | |
| | | bids: initArr, // 买单 |
| | | orderCur: [], // 当前委托 |
| | | orderHold: [], // 持有仓位 |
| | | perpetualHistroy: [], // 永续历史 |
| | | futrueHold: [], // 交割持仓 |
| | | futrueHistroy: [], // 交割历史 |
| | | sockets: { |
| | |
| | | this.type = this.$route.query.type |
| | | } |
| | | await this.SET_COIN_LIST(this.type) |
| | | // _getBalance().then(data => { // 获取用户余额 |
| | | // this.$store.commit('user/SET_USERINFO', { balance: data.money }) |
| | | // // const { money } = data |
| | | // // this.balance = money |
| | | // }) |
| | | if (this.userInfo.token) { |
| | | this.getBalance() |
| | | this.timerMoeny = setInterval(() => { |
| | |
| | | type: 'orders', |
| | | page_no: 1 |
| | | }).then(data => { |
| | | // if (typeof this.timer === 'string') { |
| | | // this.timer = null |
| | | // return |
| | | // } |
| | | this.orderCur = data |
| | | }) |
| | | }, 1000) |
| | |
| | | }) |
| | | this.timer = setInterval(() => { |
| | | contractOrder(obj).then(data => { |
| | | // if (typeof this.timer === 'string') { |
| | | // this.timer = null |
| | | // return |
| | | // } |
| | | // this.orderHold = data |
| | | this.orderHold = data.sort(this.sortData); |
| | | }) |
| | |
| | | }) |
| | | this.timer = setInterval(() => { |
| | | _futrueOrderList(symbol, 'orders', 1, 'cryptos').then(data => { |
| | | // if (typeof this.timer === 'string') { |
| | | // this.timer = null |
| | | // return |
| | | // } |
| | | // this.futrueHold = data |
| | | this.futrueHold = data.sort(this.sortData); |
| | | }) |
| | |
| | | // this.clearTimeout() |
| | | }) |
| | | }, |
| | | fetchPerpetualHistory(symbol) { // 永续历史仓位 |
| | | if (this.userInfo.token) { |
| | | contractOrder({ |
| | | symbol, |
| | | type: 'hisorders', |
| | | page_no: 1, |
| | | symbolType: this.type || 'cryptos' |
| | | }).then(data => { |
| | | this.perpetualHistroy = data || [] |
| | | }) |
| | | } |
| | | }, |
| | | init(symbol) { // 初始化页面 |
| | | this.symbol = symbol |
| | | this.fetchQoutes(symbol) |