10.10综合交易所原始源码_移动端
admin
2026-01-06 04d8c6bfd48267c7b2eaccaa03170618d83e4cbd
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
166
167
168
<template>
  <!-- 币币订单详情 -->
  <div id="cryptos">
    <div class="tradeDetail">
      <assets-head :title="$t('订单详情')" />
      <div class="header pl-8 pr-8 text-center ">
        <div class="textColor">{{ $t('tradingAssets') }}</div>
        <div class="mt-7 textColor">{{ detail.name ? detail.name.toUpperCase() : '--' }}</div>
        <div class="mt-7 text-green">{{ detail.state ? handleText(detail.state) : '--' }}</div>
      </div>
      <div class="pl-8 pr-8 pt-10 pb-14">
        <div class="flex justify-between pb-16">
          <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-16">
          <div class="text-grey">{{ $t('成交价格') }}</div>
          <div class="textColor">{{ detail.close_price ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16" v-if="detail.offset != 'open' ">
          <div class="text-grey">{{ $t('卖出价') }}</div>
          <div class="textColor">{{ detail.close_price ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16" v-if="detail.offset != 'open' ">
          <div class="text-grey">{{ $t('成本价') }}</div>
          <div class="textColor">{{ detail.costPrice ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16" v-if="detail.offset != 'open' ">
          <div class="text-grey">{{ $t('盈利金额') }}</div>
          <div :class="detail.profitLoss < 0 ? 'text-down' : 'text-up'">{{ detail.profitLoss ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16" v-if="detail.offset != 'open' ">
          <div class="text-grey">{{ $t('盈利比例') }}</div>
          <div :class="detail.profitLoss < 0 ? 'text-down' : 'text-up'">{{ detail.profitLossPercentage ?? '--' }}%</div>
        </div>
        <div class="flex justify-between pb-16">
          <div class="text-grey">{{ $t('数量') }}</div>
          <div class="textColor">{{ detail.symbolValue ??  '--' }}</div>
        </div>
 
        <div class="flex justify-between pb-16">
          <div class="text-grey">{{ $t('总金额') }}</div>
          <div class="textColor">{{ detail.totalMoney ??  '--' }}</div>
        </div>
 
        <div class="flex justify-between pb-16">
          <div class="text-grey">{{ $t('手续费') }}</div>
          <div class="textColor">{{ detail.fee ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16">
          <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-16">
          <div class="text-grey">{{ $t('限价') }}</div>
          <div class="textColor">{{ detail.price ?? '--' }}</div>
        </div>
        <div class="flex justify-between pb-16">
          <div class="text-grey">{{ $t('订单号') }}</div>
          <div class="textColor">{{ detail.order_no ? detail.order_no : '--' }}</div>
        </div>
        <div class="flex justify-between pb-16">
          <div class="text-grey">{{ $t('委托时间') }}</div>
          <div class="textColor">{{ detail.create_time ? detail.create_time : '--' }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import assetsHead from "@/components/Transform/assets-head/index.vue";
import TradeApi from "@/service/trading.js";
export default {
  name: "symbolOrderDetail",
  data() {
    return {
      detail: {}
    }
  },
  components: {
    assetsHead,
  },
  methods: {
    handleText(state) {
      let str = '';
      if (state == 'submitted') {
        str = this.$t('submitted')
      } else if (state == 'canceled') {
        str = this.$t('canceled')
      } 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
      })
    }
  },
  beforeRouteEnter(to, from, next) {
    const { query: { order_no } } = to
    next(vm => {
      vm.fetchDetail(order_no)
    })
  }
}
</script>
 
<style lang="scss" scoped>
#cryptos {
  font-size: 32px;
 
  .grey-line {
    background-color: $light-grey;
    height: 15px;
  }
 
  .tradeDetail {
    width: 100%;
    box-sizing: border-box;
    min-height: 100vh;
 
 
    .header {
      padding-top: 42px;
    }
  }
 
 
  .text-green {
    color: $green !important;
  }
 
  .text-red {
    color: $red !important;
  }
}
</style>