交易所前端蓝色ui, 4.5 jiem
lxf
2025-04-18 66a33e936d39ec4db7fdffed5d646e044ccc43e9
src/page/tradeRecord/index.vue
@@ -3,17 +3,16 @@
        <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>
@@ -25,7 +24,7 @@
                    <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">
@@ -42,7 +41,7 @@
                    <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">
@@ -63,7 +62,6 @@
        </div>
    </div>
</template>
<script>
import assetsHead from "@/components/assets-head";
import { Tabs, Tab, DropdownMenu, DropdownItem } from 'vant';
@@ -71,6 +69,7 @@
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: {
@@ -105,7 +104,8 @@
    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: {
@@ -122,11 +122,11 @@
                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)
@@ -144,22 +144,22 @@
            } 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
        }