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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<template>
  <div class="pb-12 order-submit">
    <!-- <fx-header @back="backFun">
 
    </fx-header> -->
    <van-nav-bar :left-arrow="true" @click-left="onClickLeft">
    </van-nav-bar>
    <van-loading color="#1194F7" v-if="isLoading" class="loading-box" />
    <div v-if="payInfo.uuid">
      <div class="order-top" v-if="payInfo.state == 0">
        <div class="order-top">
          <div class="title">{{ $t('orderGenerated') }}</div>
          <!-- <div class="text mt-2">{{ $t('pleaseAt') }} <span>{{ dayjs.duration(remainingTime, 'seconds').format('mm:ss')}}</span> {{ $t('paymentSeller')}}{{ payInfo.direction == 'recharge' ? $t('买家') : $t('卖家') }}</div> -->
          <div class="customer mt-5" @click="onRoute">
            <div class="flex">
              <div class="flex flex-1 service">
                <img class="serve" src="@/assets/image/order/serve.png" alt="" />
                <span class="mr-2 ml-2">{{ $t('onLineService') }}</span>
                <img class="gold" src="@/assets/image/order/gold.png" alt="" />
              </div>
              <div>
                <div class="support-box">
                  <img src="@/assets/image/order/contact.png" alt="" class="contact-icon" />
                  <span>{{ $t('contactService') }}</span>
                </div>
              </div>
            </div>
            <!-- <div class="flex step mt-5"> -->
              <!-- <img class="success mr-1" src="@/assets/image/order/success.png" alt="" /> -->
              {{ $t('Payconfidence') }}
              <!-- {{ payInfo.direction == 'recharge' ? $t('买家') : $t('卖家') }} {{ payInfo.currency }} {{ $t('已存入交易所账户,请放心付款')}} -->
            <!-- </div> -->
            <div class="flex mt-5">
              <div class="flex step flex-1">
                <img class="mr-2" src="@/assets/image/order/success.png" alt="" />
                {{ $t('customerSupport') }}
              </div>
              <div class="pr-2">
                <van-icon name="arrow" size="16" color="#9399A4" />
              </div>
            </div>
          </div>
        </div>
        <div class="px-4 py-4 flex quxiao" v-if="payInfo.state == 4">{{ $t('Cancelled') }} <img class="icon4" src="@/assets/image/Record/icon4.png" /></div>
        <div class="px-4 py-4" v-if="payInfo.state == 4">{{ $t('orderbeenCanceled') }}</div>
        <div class="height-line-1"></div>
        <div class="order-info">
          <div class="info-title pt-3 pb-3">{{ $t('purchasing') }} <span>USD</span></div>
          <div class="flex cell-item pt-3 pb-3">
            <div class="left-title">
              {{ $t('lumpSum') }}
            </div>
            <div class="money">
              {{ payInfo.currency }} {{ payInfo.amount }}
            </div>
          </div>
          <div class="flex cell-item pt-3 pb-3" v-if="payInfo.paramValue2">
            <div class="left-title">
              {{ $t('bankName') }}
            </div>
            <div class="white">
              {{ $t(payInfo.paramValue2) }}
            </div>
          </div>
          <div class="flex cell-item pt-3 pb-3" v-if="payInfo.paramValue1">
            <div class="left-title">
              {{ $t('accountAddress') }}
            </div>
            <div class="white">
              {{ $t(payInfo.paramValue1) }}
            </div>
          </div>
          <div class="flex cell-item pt-3 pb-3">
            <div class="left-title">
              {{ $t('orderNumber') }}
            </div>
            <div class="flex align-center" @click="copy">
              {{ payInfo.orderNo }}
              <img class="copy-img ml-1" src="@/assets/image/order/copy.png" alt="" />
            </div>
          </div>
        </div>
        <div class="height-line-1"></div>
        <div class="order-info">
          <div class="info-title pt-3 pb-3"><span>{{ $t('payType') }}</span></div>
          <div class="flex cell-item pt-3 pb-3">
            <div class="left-title payTitle">
              {{ $t('BankCard') }}
            </div>
          </div>
        </div>
        <div class="height-line-3"></div>
        <div class="flex but-wrap">
          <!-- <van-button class="w-full cancel-but" @click="cancelC2cOrderApply()">{{ $t('cancelOrder') }} </van-button> -->
          <van-button class="w-full submit-but" @click="onRoute" type="primary">{{ $t('toPay') }} </van-button>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script setup>
import fxKline from '@/components/fx-kline/index.vue'
import { ref, onMounted, watch, onUnmounted } from "vue";
import { useRoute, useRouter } from 'vue-router';
import { getc2cOrder, c2cOrderApply } from "@/service/recharge.api.js";
import {
  showToast
} from 'vant';
import useClipboard from "vue-clipboard3";
import { useI18n } from "vue-i18n";
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
dayjs.extend(duration);
 
const { toClipboard } = useClipboard();
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const showPopup = ref(false)
const orderNo = ref(null)
const onRoute = () => {
  // router.push('/order/success')
  router.push('/customerService?order_no=' + orderNo.value)
}
const onClickLeft = () => {
  router.push('/exchange/channel-in')
}
 
const payInfo = ref({})
const isLoading = ref(true)
const timer = ref(null)
const remainingTime = ref('')
 
onMounted(async () => {
  console.log(route.query.orderNo)
  if (route.query.orderNo) {
    orderNo.value = route.query.orderNo
    getc2cOrderDetails(orderNo.value)
  }
  timer.value = setInterval(() => {
    if (route.query.orderNo) {
      orderNo.value = route.query.orderNo
      getc2cOrderDetails(orderNo.value)
    }
  }, 3000)
 
})
 
const clearInterFn = (() => {
  clearInterval(timer.value)
  timer.value = null
})
 
onUnmounted(() => {
  clearInterFn()
})
 
//获取订单详情
const getc2cOrderDetails = (orderNo) => {
  getc2cOrder({ order_no: orderNo }).then((res) => {
    payInfo.value = res
    isLoading.value = false
    if (payInfo.value.state == 0) {
      remainingTime.value = res.autoCancelTimeRemain
    } else if (payInfo.value.state == 3) { //已完成
      router.push('/order/success?payInfo=' + JSON.stringify(payInfo.value))
    } else if (payInfo.value.state == 4) { //已取消
      showToast(t('订单已取消'))
      router.push('/exchange/channel-in')
    }
  })
 
}
//取消订单
const cancelC2cOrderApply = () => {
  c2cOrderApply({ order_no: orderNo.value }).then(() => {
    showToast(t('CancelSuccess'))
  })
}
const copy = async () => {
  try {
    await toClipboard(payInfo.value.orderNo);
    showToast(t('copySuccess'));
  } catch (e) {
    console.error(e);
  }
}
</script>
<style lang="scss" scoped>
.loading-box {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
}
 
.order-submit {
  color: $text_color;
  font-size: 15px;
 
  .order-top {
    padding: 20px 5px 20px 5px;
  }
 
  .title {
    font-size: 24px;
    color: $text_color;
  }
 
  .text {
    font-size: 12px;
 
    span {
      color: $active_line;
    }
  }
 
  .customer {
    background: $main2_background;
    border-radius: 10.0022px;
    padding: 20px 0 20px 20px;
    color: $text_color;
 
    .service {
      align-items: center;
 
      .serve {
        width: 19px;
 
      }
 
      .gold {
        width: 13px;
      }
 
      img {
        display: block;
      }
    }
 
    .support-box {
      position: relative;
      padding: 4px 8px 4px 16px;
      height: 32px;
      background-color: $tab_background;
      color: $text_color;
      font-size: 14px;
 
      &::before {
        content: '';
        position: absolute;
        left: -15px;
        top: 0;
        width: 16px;
        height: 32px;
        border-radius: 16px 0 0 16px;
        line-height: 32px;
        background-color: $tab_background;
      }
 
      .contact-icon {
        position: absolute;
        left: -6px;
        top: 6px;
        display: inline-block;
        width: 20px;
        height: 20px;
        margin-right: 6px;
      }
    }
 
    .step {
      align-items: center;
 
      img {
        width: 17px;
      }
    }
  }
 
  .order-info {
    padding: 20px 15px 20px 15px;
 
    .info-title {
      color: $green;
      font-size: 16px;
 
      span {
        color: $text_color;
      }
    }
 
    .cell-item {
      justify-content: space-between;
 
      .left-title {
        color: #8A919E;
      }
 
      .payTitle {
        padding-left: 10px;
        position: relative;
 
        &::after {
          position: absolute;
          left: 0;
          top: 6px;
          height: 14px;
          width: 3px;
          background: #E7BB41;
          content: '';
        }
      }
 
      .money {
        font-weight: bold;
        font-size: 18px;
        color: $text_color;
      }
 
      .copy-img {
        width: 13px;
      }
 
      .align-center {
        align-items: center;
      }
 
      .white {
        color: $text_color;
      }
    }
  }
 
  .height-line-1 {
    height: 10px;
    background: $input_background;
  }
 
  .height-line-3 {
    height: 4px;
    background: $selectSymbol_background;
  }
 
 
}
 
.but-wrap {
  padding: 40px 15px 50px 15px;
  justify-content: center;
 
  .submit-but {
    width: 240px;
    display: block;
    margin-left: 10px;
  }
 
  .cancel-but {
    width: 100px;
  }
}
 
.quxiao {
  align-items: center;
  color: $text_color;
}
 
.icon4 {
  width: 25px;
  height: 25px;
  margin-left: 10px;
}
 
:deep(.van-icon) {
  font-size: 18px;
  color: $text_color;
}
</style>