dcc
2024-06-13 24e2c4a6983d3ed1c67080b460f7e28f5e2e55f9
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
<template>
  <div id="OrderDataPage">
    <div class="order-data">
      <div class="flex items-center text-32 mb-10 c2cColor pl-4">
        <span class="title" :style="{ 'color': detail.direction === 'buy' ? '#2EBD85' : '#E35461' }">
          {{ detail.direction === 'buy' ? $t('购买') : $t('卖出') }}
        </span>
        <span class="mx-4">{{ detail.symbol && detail.symbol.toUpperCase() }}</span>
        <img class="w-10 h-10" src="~@/assets/image/c2c/U1.png" alt="">
      </div>
      <van-cell-group>
        <van-cell :title="$t('总额')">
          <template #default>
            <h2 class="font-bold text-36">{{ currencySymbol }} {{ detail.amount }}</h2>
          </template>
        </van-cell>
        <van-cell :title="$t('单价')">
          <template #default>
            <span>{{ currencySymbol }} </span>
            <span>{{ detail.symbolValue }}</span>
          </template>
        </van-cell>
        <van-cell :title="$t('数量')"
          :value="`${detail.symbol == 'usdt' ? Math.floor(detail.coinAmount * 100) / 100 : Math.floor(detail.coinAmount * 1000000) / 1000000} ${detail.symbol && detail.symbol.toUpperCase()}`" />
        <slot name="default"></slot>
        <van-cell class="order-number flex items-center">
          <template #title>
            <div class="w-24">{{ $t('订单号') }}</div>
          </template>
          <template #value>
            <div class="flex justify-end items-center">
              <span class="mr-3">{{ detail.orderNo }}</span>
              <img class="relative  w-8 h-8" src="~@/assets/image/c2c/Group1168.png" alt="" @click="copy(detail.orderNo)">
            </div>
          </template>
        </van-cell>
        <van-cell v-if="detail.createTime" :title="$t('创建时间')" :value="detail.createTime" />
        <van-cell v-if="detail.sellerName">
          <template #title>
            <span>{{ clientType }}</span>
          </template>
          <template #default>
            <span class="mr-5">{{ sellerName }}</span>
            <van-icon class="font-bold text-grey" name="arrow" />
          </template>
        </van-cell>
      </van-cell-group>
    </div>
  </div>
</template>
 
<script>
import {
  mapState,
  mapGetters
} from "vuex";
import { Cell, CellGroup, Icon, showToast } from "vant"
 
export default {
  name: "OrderDate",
  // props: ['count', 'totalPrice', 'orderNumber', 'sellerName', 'createOrderTime'],
  props: {
    clientType: {
      default: '卖家昵称'
    },
    detail: {
      type: Object,
      default() {
        return {}
      }
    },
    // // count: {},
    // totalPrice: {},
    // // orderNumber: {},
    // sellerName: {},
    // createOrderTime: {},
    // unitPrice: {
    //   // required: true,
    // }
  },
  filters: {
    format(time) {
      const _time = new Date(time)
      return [_time.getFullYear(), _time.getMonth() + 1, _time.getDate()].join('/') + ' ' + [(_time.getHours() + '').padStart(2, '0'), (_time.getMinutes() + '').padStart(2, '0'), (_time.getSeconds() + '').padStart(2, '0')].join(":")
    }
  },
  methods: {
    copy(text) {
      // 复制
      if (!text) {
        return
      }
      navigator.clipboard.writeText(text).then(() => {
        showToast(this.$t('复制成功'));
      })
    },
  },
  computed: {
    ...mapState('home', ['currency']),
    ...mapGetters('c2c', ['currencySymbol'])
  },
  components: {
    [Cell.name]: Cell,
    [CellGroup.name]: CellGroup,
    [Icon.name]: Icon,
  }
}
</script>
 
<style lang="scss" scoped>
#OrderDataPage {
  font-size: 30px;
 
  :deep(.van-cell) {
    margin-bottom: 46px;
  }
 
  :deep(.order-number) {
    .van-cell__title {
      flex: inherit;
    }
  }
 
  .order-data {
 
    :deep(.van-cell-group, .van-cell) {
      margin-bottom: 46px;
      background: $main_background;
      color: $text_color;
    }
 
    :deep(.van-cell__value) {
      color: $text_color;
    }
  }
}
</style>