| | |
| | | <assets-head :title="$t('交易记录')" /> |
| | | <div class="content"> |
| | | <van-tabs v-model="active" class="w-full px-32 box-border" sticky @click="changeType"> |
| | | |
| | | <van-tab :title="$t('当前委托')" class="font-30"> |
| | | <div class="all-select flex justify-end"> |
| | | <div class="select-box flex" @click.stop="isAll = !isAll"> |
| | | <div class="flex-1 font-24"> |
| | | {{ symbol.toUpperCase() }}/USDT |
| | | {{ symbolname }} |
| | | </div> |
| | | <van-icon name="arrow-down" /> |
| | | <div class="select-data" v-if="isAll"> |
| | | <div class="select-item font-24" @click.stop="selectItem(item)" |
| | | v-for="(item, index) in currencyList" :key="index">{{ item.symbol.toUpperCase() }}/USDT |
| | | v-for="(item, index) in currencyList" :key="index">{{ item.symbolFullName }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="all-select flex justify-end"> |
| | | <div class="select-box flex" @click.stop="isAll = !isAll"> |
| | | <div class="flex-1"> |
| | | {{ symbol.toUpperCase() }}/USDT |
| | | {{ symbolname }} |
| | | </div> |
| | | <van-icon name="arrow-down" /> |
| | | <div class="select-data" v-if="isAll"> |
| | |
| | | <div class="all-select flex justify-end"> |
| | | <div class="select-box flex" @click.stop="isAll = !isAll"> |
| | | <div class="flex-1"> |
| | | {{ symbol.toUpperCase() }}/USDT |
| | | {{ symbolname }} |
| | | </div> |
| | | <van-icon name="arrow-down" /> |
| | | <div class="select-data" v-if="isAll"> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import assetsHead from "@/components/assets-head"; |
| | | import { Tabs, Tab, DropdownMenu, DropdownItem } from 'vant'; |
| | |
| | | import historyItem from '@/components/history-item' |
| | | import TradeApi from "@/API/trading.js"; |
| | | import { _getCoins, _getHomeList } from '@/API/home.api' |
| | | import { setStorage } from "@/utils/utis"; |
| | | export default { |
| | | props: { |
| | | |
| | |
| | | mounted() { |
| | | this.getCoins() |
| | | this.symbol = this.$route.params.symbol |
| | | this.getOrderList(this.type) |
| | | this.symbolname = this.$route.query.name |
| | | this.getOrderList(this.type,this.symbol) |
| | | this.getCoinPrce(this.symbol) |
| | | }, |
| | | computed: { |
| | |
| | | this.coinPrice = res[0].close |
| | | }) |
| | | }, |
| | | getOrderList(type) { |
| | | getOrderList(type,symbol) { |
| | | this.entrustList = [] |
| | | TradeApi.tradeRecord({ |
| | | page_no: 1, |
| | | symbol: this.symbol, |
| | | symbol: symbol, |
| | | type: type |
| | | }).then(res => { |
| | | console.log(res.data) |
| | |
| | | } else { |
| | | this.type = 'opponent' |
| | | } |
| | | this.getOrderList(this.type); |
| | | this.getOrderList(this.type,this.symbol); |
| | | }, |
| | | cancelOrder(order) { |
| | | TradeApi.tradeCancel({ |
| | | order_no: order, |
| | | }).then(res => { |
| | | this.$toast(this.$t('成功')); |
| | | this.getOrderList(this.type) |
| | | this.getOrderList(this.type,this.symbol) |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | //选择币种 |
| | | selectItem(item) { |
| | | this.symbol = item.symbol |
| | | this.getOrderList() |
| | | this.symbolname = item.symbolFullName |
| | | this.getOrderList(this.type,item.symbol) |
| | | this.getCoinPrce(item.symbol) |
| | | this.isAll = false |
| | | } |