1
PC-20250623MANY\Administrator
2025-07-22 9ec3bd6e8d7357927533d8966f882cb5d28b3e0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<template>
    <!-- 币币订单详情 -->
    <div class="tradeDetail">
        <assets-head :title="$t('订单详情')" />
        <div class="header pl-32 pr-32 text-center ">
            <!-- <div class="textColor">{{ $t('币种') }}</div> -->
            <!-- <div class="mt-28 textColor">{{ detail.symbol ? detail.symbol.toUpperCase() : '--' }}/USDT</div> -->
            <div class="mt-28 text-green">{{ detail.state ? handleText(detail.state) : '--' }}</div>
        </div>
        <div class="pl-32 pr-32 pt-80 pb-58">
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('操作') }}</div>
                <div class="textColor" :class="detail.offset == 'open' ? 'text-green' : 'text-red'">
                    {{ detail.order_price_type ? handleWord(detail.order_price_type, detail.offset) : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('成交价格') }}</div>
                <div class="textColor">{{ detail.close_price ? detail.close_price : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('成交时间') }}</div>
                <div class="textColor">{{ detail.close_time ? detail.close_time : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('手续费') }}</div>
                <div class="textColor">{{ detail.fee || '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('订单类型') }}</div>
                <div class="textColor">{{ detail.order_price_type ? handleType(detail.order_price_type) : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('限价') }}</div>
                <div class="textColor">{{ detail.price ? detail.price : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('订单号') }}</div>
                <div class="textColor">{{ detail.order_no ? detail.order_no : '--' }}</div>
            </div>
            <div class="flex justify-between pb-68">
                <div class="text-grey">{{ $t('委托时间') }}</div>
                <div class="textColor">{{ detail.create_time ? detail.create_time : '--' }}</div>
            </div>
        </div>
    </div>
</template>
 
<script>
import assetsHead from "@/components/assets-head";
import TradeApi from "@/API/trading.js";
import { getStorage } from "@/utils/utis";
export default {
    name: "orderDetail",
    data() {
        return {
            detail: {}
        }
    },
    components: {
        assetsHead,
    },
    methods: {
        handleText(state) {
            let str = '';
            if (state == 'submitted') {
                str = this.$t('已提交')
            } else if (state == 'canceled') {
                str = this.$t('已撤销')
            } else {
                str = this.$t('已完成')
            }
            return str;
        },
        handleType(type) {
            let str = '';
            if (type == 'limit') {
                str = this.$t('限价委托')
            } else {
                str = this.$t('市价委托')
            }
            return str;
        },
        handleWord(price_type, offset) {
            let a = ''
            let b = ''
            if (price_type === 'limit') {
                a = this.$t('限价')
            } else {
                a = this.$t('市价')
            }
            if (offset === 'open') {
                b = this.$t('买入')
            } else {
                b = this.$t('卖出')
            }
            return a + '/' + b
        },
        onClickLeft() {
            this.$router.go(-1);
        },
        fetchDetail(order_no) {
            TradeApi.tradeDetail({ order_no }).then(res => {
                this.detail = res.data
            })
        }
    },
    beforeRouteEnter(to, from, next) {
        const { query: { order_no } } = to
        next(vm => {
            vm.fetchDetail(order_no)
        })
    }
}
</script>
 
<style lang="scss" scoped>
.grey-line {
    background-color: #F5F5F5;
    height: 15px;
}
 
.tradeDetail {
    width: 100%;
    box-sizing: border-box;
    min-height: 100vh;
 
    @include themify() {
        background: themed("main_background");
    }
 
    .header {
        @include themify() {
            border-top: 1px solid themed("line_color");
        }
 
        padding-top: 42px;
    }
}
 
::v-deep .van-nav-bar {
    @include themify() {
        background: themed("main_background");
    }
}
 
::v-deep .van-nav-bar__title {
    @include themify() {
        color: themed("text_color");
    }
}
 
::v-deep .van-tabs__nav {
    @include themify() {
        background: themed("main_background");
    }
}
 
.text-green {
    color: #2EBD85 !important;
}
 
.text-red {
    color: #F6465D !important;
}
</style>