交易所前端蓝色ui, 4.5 jiem
jhzh
2024-04-08 67357c691325dc3cf743267f1ef0e1f5c93d7528
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
<template>
  <div class="item-main" @click="gotoPage">
    <div class="flex justify-between items-center buy">
      <span class="us-buy">
        <span v-if="items.direction === 'buy'" style="color: #5eba89">{{ $t('购买') }}</span>
        <span v-else style="color: #e35461">{{ $t('出售') }}</span>
        {{ items.symbol }}
      </span>
      <span v-if="items.direction === 'buy'">
        <span
          :class="{ 'blue': items.state === '0', 'yellow': items.state === '1', 'red': items.state === '2' || items.state === '5', 'green': items.state === '3' }">{{
            arr[items.state / 1] }}</span>
        <van-icon name="arrow" />
      </span>
      <span v-else>
        <span
          :class="{ 'blue': items.state === '0', 'yellow': items.state === '1', 'red': items.state === '2' || items.state === '5', 'green': items.state === '3' }">{{
            arr1[items.state / 1] }}</span>
        <van-icon name="arrow" />
      </span>
    </div>
    <div class="flex justify-between items-center price-i">
      <span>{{ $t('单价') }} {{ items.currency || currency.currency_symbol }} {{ items.symbol_value }}</span>
      <span style="color: #b8bcc5">{{ items.time }}</span>
    </div>
    <div class="flex justify-between items-center price-i pd-32">
      <span>{{ $t('数量') }} {{ (items.coin_amount / 1).toFixed(items.symbol === 'USDT' ? 2 : 4) }} {{ items.symbol
      }}</span>
      <span class="textColor" style="font-weight: bold">{{ items.currency }}
        {{ (items.symbol_value * items.coin_amount / 1).toFixed(2) }}</span>
    </div>
    <div class="niu flex items-center">
      <van-badge v-if="items.msg" :content="items.msg">
        <img src="@/assets/image/Subtract.png" class="mr-20" alt="" />
      </van-badge>
      <img v-else src="@/assets/image/Subtract.png" class="mr-20" alt="" />
      {{ items.c2c_user_nick_name }}
      <!-- <img src="@/assets/image/up.png" alt="" />
      资金安全 -->
    </div>
  </div>
</template>
 
<script>
import { mapState } from "vuex";
import { Icon, Badge } from 'vant'
 
export default {
  props: ['items'],
  data() {
    return {
      arr: [this.$t('未付款'), this.$t('已付款'), this.$t('申诉中'), this.$t('已完成'), this.$t('已取消'), this.$t('已超时')],
      arr1: [this.$t('等待付款'), this.$t('待确认'), this.$t('申诉中'), this.$t('已完成'), this.$t('已取消'), this.$t('已超时')],
    }
  },
  computed: {
    ...mapState('home', ['currency'])
  },
  methods: {
    gotoPage() { // 去到相应的页面
      // console.log(this.items)
      // this.$store.commit('c2c/SET_ADV_ID',this.items.id)
      this.$store.commit('c2c/SET_ORDER_NO', this.items.order_no)
      // return
      if (this.items.direction === 'buy') {
        if (this.items.state / 1 === 0 || this.items.state / 1 === 5) { // 未付款
          this.$router.push(`/orderGeneration`)
        } else if (this.items.state / 1 === 1) { // 已付款
          this.$router.push('/paymentDetail')
        } else { /// 111  其他
          this.$router.push('/tradeOrderDetail')
        }
      } else {
        if (this.items.state / 1 === 0 || this.items.state / 1 === 5) { // 未付款
          this.$router.push(`/sellGenerate`)
        } else if (this.items.state / 1 === 1) { // 已付款
          this.$router.push(`/confirmedPaid`)
          // this.$router.push('/paymentDetail?order_no=' + this.items.order_no)
        } else { /// 111  其他
          this.$router.push('/tradeOrderDetail')
        }
      }
    }
  },
  components: {
    [Icon.name]: Icon,
    [Badge.name]: Badge,
  },
}
</script>
 
<style lang="scss" scoped>
.item-main {
  padding: 42px 0 66px;
  margin: 0 30px;
  font-size: 28px;
  color: #868d9a;
 
  @include themify() {
    border-bottom: 1px solid themed("line_color");
  }
 
  .buy {
    margin-bottom: 40px;
    font-size: 32px;
 
    .us-buy {
      color: #fff;
    }
  }
 
  .price-i {
    margin-bottom: 28px;
  }
 
  .pd-32 {
    margin-bottom: 32px;
  }
 
  .niu {
    width: 200px;
    height: 57px;
    overflow: hidden;
 
    @include themify() {
      background: themed("tab_background");
    }
 
    border-radius: 50px;
    font-size: 22px;
    padding: 0 20px;
 
    img {
      width: 30px;
      height: 30px;
      margin-top: 6px;
    }
  }
}
 
::v-deep {
  .van-badge--fixed {
    top: 80%;
  }
}
 
.blue {
  color: #1D91FF;
}
 
.green {
  color: #2EBD85;
}
 
.red {
  color: #E35461
}
 
.yellow {
  color: #E2AE27;
}
</style>