| | |
| | | orderHold.length }})</span></div> |
| | | <div class="px-2 ml-12 py-2 flex items-center textColor1y text-28" @click="tabClick('2')" |
| | | :class="type == '2' ? 'active-line' : ''">{{ $t('当前委托') }}</div> |
| | | <div class="px-2 ml-12 py-2 flex items-center textColor1 text-28" @click="tabClick('5')" |
| | | :class="type == '5' ? 'active-line' : ''">{{ $t('历史仓位') }}</div> |
| | | </template> |
| | | <template v-else> |
| | | <div class="px-2 py-2 flex items-center textColor1 text-28" @click="tabClick('3')" |
| | |
| | | :class="type == '4' ? 'active-line' : ''">{{ $t('历史仓位') }}</div> |
| | | </template> |
| | | </div> |
| | | <img src="../../../assets/image/public/record.png" alt="record-img" class="w-16 h-9 pr-8 record-img" |
| | | @click="goHistory" /> |
| | | <!-- <img src="../../../assets/image/public/record.png" alt="record-img" class="w-16 h-9 pr-8 record-img" |
| | | @click="goHistory" /> --> |
| | | </div> |
| | | <!-- 永续--> |
| | | <template v-if="topIndex / 1 === 1"> |
| | |
| | | <!-- 持有仓位列表 --> |
| | | <div v-if="type == '2'"> |
| | | <PerpetualEntrustList :list-data="orderCur" @recall="$emit('recall', $event)"></PerpetualEntrustList> |
| | | </div> |
| | | <!-- 历史仓位列表 --> |
| | | <div v-if="type == '5'"> |
| | | <PerpetualHistoryPosition :list-data="perpetualHistroy" /> |
| | | <div class="text-grey text-center py-72 text-30" v-if="perpetualHistroy.length == 0">{{ $t('您目前没有持仓') }}</div> |
| | | </div> |
| | | </template> |
| | | <!-- 交割--> |
| | |
| | | <script> |
| | | import PerpetualEntrustList from '../perpetual-entrust-list/index.vue'; |
| | | import PerpetualPositionList from '../perpetual-position-list/index.vue'; |
| | | import PerpetualHistoryPosition from '../perpetual-history-position/index.vue'; |
| | | import futrueHoldList from '../deliveryContract/hold.vue' |
| | | import futrueHistroyPosition from '../deliveryContract/position.vue' |
| | | import { mapGetters } from 'vuex' |
| | |
| | | name: "perpetualOrder", |
| | | data() { |
| | | return { |
| | | type: '1', // 1:永续持有,2:永续当前,3:交割持有,4:交割历史 |
| | | type: '1', // 1:永续持有,2:永续当前,5:永续历史,3:交割持有,4:交割历史 |
| | | }; |
| | | }, |
| | | props: { |
| | |
| | | return [] |
| | | } |
| | | }, |
| | | perpetualHistroy: { |
| | | type: Array, |
| | | default() { |
| | | return [] |
| | | } |
| | | }, |
| | | price: { |
| | | type: [Number, String], |
| | | default: '0.00' |
| | | }, |
| | | symbolType: { |
| | | type: String, |
| | | default: 'cryptos' |
| | | }, |
| | | }, |
| | | watch: { |
| | |
| | | if (type === '4') { |
| | | this.$emit('tab', 'fetchFutrueHistory') |
| | | } |
| | | if (type === '5') { |
| | | this.$emit('tab', 'fetchPerpetualHistory') |
| | | } |
| | | // this.$emit(type) |
| | | }, |
| | | goHistory() { |
| | | if (this.userInfo.token) { |
| | | let type = 'cryptos' |
| | | if (this.$route.query.type) { |
| | | type = this.$route.query.type |
| | | } |
| | | const type = this.symbolType || 'cryptos' |
| | | const url = this.topIndex / 1 === 1 ? '/cryptos/perpetualHistory' : '/cryptos/deliveryContractHistory' |
| | | this.$router.push({ |
| | | path: url, query: { symbol: this.symbol, type: type } |
| | | path: url, query: { symbol: this.symbol, type } |
| | | }); |
| | | } else { |
| | | this.$router.push('/login') |
| | |
| | | |
| | | } |
| | | }, |
| | | components: { PerpetualEntrustList, PerpetualPositionList, futrueHistroyPosition, futrueHoldList }, |
| | | components: { PerpetualEntrustList, PerpetualPositionList, PerpetualHistoryPosition, futrueHistroyPosition, futrueHoldList }, |
| | | computed: { |
| | | ...mapGetters('user', ['userInfo']), |
| | | }, |