| | |
| | | <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> |
| | | |
| | |
| | | <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" /> |
| | |
| | | bids: initDepthArr(), |
| | | orderCur: [], |
| | | orderHold: [], |
| | | perpetualHistroy: [], |
| | | futrueHold: [], |
| | | futrueHistroy: [], |
| | | curTab: 'fetchOrderListHold', |
| | |
| | | symbol(val) { |
| | | if (val && val !== this._lastSymbol) { |
| | | this._lastSymbol = val |
| | | this.futrueHold = [] |
| | | this.futrueHistroy = [] |
| | | this.closeSocket() |
| | | this.init(val) |
| | | } |
| | |
| | | fetchFutrueHoldList(symbol) { |
| | | if (!this.userInfo || !this.userInfo.token) return |
| | | const symbolType = this.type || 'cryptos' |
| | | symbol = '' |
| | | _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(() => { |
| | | symbol = '' |
| | | _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' |
| | | symbol = '' |
| | | _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) { |
| | |
| | | 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() { |