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
<template>
    <div class="Record pb-12">
        <fx-header fixed>
            <template #title>{{ $t("rechargeWithRecord") }}</template>
        </fx-header>
        <div class="tab-fixed">
            <van-tabs v-model:active="active" @click-tab="onClickTab">
                <van-tab v-for="(item, index) in tabList" :key="index" :title="item.name">
                </van-tab>
            </van-tabs>
        </div>
        <div class="list-wrap px-8 pt-8">
            <div class="tab-wrap flex px-4 mt-5">
                <div class="tab-item mr-4" :class="[selectIndexActive === index ? 'active' : '']"
                    v-for="(item, index) in tabListTwo" :key="index" @click="changeCoin(index)">{{ item }}</div>
            </div>
            <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :pulling-text="t('下拉即可刷新')"
                :loosing-text="t('释放即可刷新')" :loading-text="t('加载中...')">
                <div v-if="noData" class="pt-20 text-center">
                    {{ $t('noData') }}
                </div>
                <template v-else>
                    <van-list v-model:loading="loading" :finished="finished" :loading-text="$t('loading')"
                        :finished-text="$t('noMore')" @load="onLoad">
                        <ul>
                            <li class="px-4 mt-10" v-for="(item, _index) in list" :key="_index" @click="openDetails(item)">
                                <div class="flex  justify-between">
                                    <div class="type">{{ selectIndexActive == 0 ? item.currency : item.coin }}</div>
                                    <div class="money"> {{ item.amount }}</div>
                                </div>
                                <div class="flex mt-1 justify-between">
                                    <div class="time">{{ selectIndexActive == 0 ? item.create_time : item.createtime }}
                                    </div>
                                    <div class="status flex" v-if="selectIndexActive == 1">
                                        <template v-if="item.status == 0">
                                            <div class="status-icon status-icon-color3 mr-2"></div>
                                            {{ $t('confirming') }}
                                        </template>
                                        <template v-if="item.status == 1">
                                            <div class="status-icon status-icon-color1 mr-2"></div>
                                            {{ $t('success') }}
                                        </template>
                                        <template v-if="item.status == 2">
                                            <div class="status-icon status-icon-color2 mr-2"></div>
                                            {{ $t('fail') }}
                                        </template>
                                    </div>
                                    <div class="status flex" v-else>
                                        <template v-if="item.state == 0">
                                            <div class="status-icon status-icon-color3 mr-2"></div>
                                            {{ $t('confirming') }}
                                        </template>
                                        <template v-if="item.state == 3">
                                            <div class="status-icon status-icon-color1 mr-2"></div>
                                            {{ $t('success') }}
                                        </template>
                                        <template v-if="item.state == 4">
                                            <div class="status-icon status-icon-color2 mr-2"></div>
                                            {{ $t('fail') }}
                                        </template>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </van-list>
                </template>
 
            </van-pull-refresh>
        </div>
    </div>
</template>
 
<script setup>
import { ref, reactive, onMounted, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { _foreignRechargeWith, _getRechargeList } from "@/service/recharge.api";
import { _withdrawList } from "@/service/withdraw.api";
import { useI18n } from "vue-i18n";
import { getStorage, setStorage } from '@/utils/index'
const { t } = useI18n()
 
const router = useRouter()
const route = useRoute()
let active = ref(0)
let selectIndexActive = ref(0)
const list = ref([]);
const loading = ref(false);
const refreshing = ref(false)
const noData = ref(false)
const finished = ref(false);
const id = ref(1)
const tabList = ref([
    {
        name: t('recharge'),
        direction: 'recharge'
    },
    {
        name: t('withdraw'),
        direction: 'withdraw'
    }
])
 
onMounted(() => {
    // console.log(getters)
    let recordId = getStorage('recordId')
    id.value = recordId
    if (id.value == 1 || id.value == 2) {
        active.value = 0
        if (id.value == 2) {
            selectIndexActive.value = 1
        } else {
            selectIndexActive.value = 0
        }
    } else {
        active.value = 1
        if (id.value == 4) {
            selectIndexActive.value = 1
        } else {
            selectIndexActive.value = 0
        }
    }
})
let currentTab = ref({
    name: t('recharge'),
    direction: 'recharge'
})
// const tabListTwo = [t('foreignCurrency'), t('digitalCurrency')]
const tabListTwo = [t('foreignCurrency')]
const page = ref(1)
const onClickTab = () => {
    currentTab.value = tabList.value[active.value]
    id.value = active.value
    if (active.value == 0) {
        if (selectIndexActive.value == 0) {
            setStorage('recordId', 1)
        } else {
            setStorage('recordId', 2)
        }
    } else {
        if (selectIndexActive.value == 0) {
            setStorage('recordId', 3)
        } else {
            setStorage('recordId', 4)
        }
    }
    onRefresh()
}
const changeCoin = (index) => {
    selectIndexActive.value = index
    if (active.value == 0) {
        if (selectIndexActive.value == 0) {
            setStorage('recordId', 1)
        } else {
            setStorage('recordId', 2)
        }
    } else {
        if (selectIndexActive.value == 0) {
            setStorage('recordId', 3)
        } else {
            setStorage('recordId', 4)
        }
    }
    onRefresh()
}
const onLoad = () => {
    // 异步更新数据
 
    if (selectIndexActive.value == 0) {
        foreignRechargeWith()
    } else {
        if (active.value == 0) {
            getRechargeList()
        } else {
            withdrawList()
        }
    }
 
}
const openDetails = (item) => {
    router.push('RecordDetails?orderNo=' + item.order_no + '&type=' + selectIndexActive.value +
        '&isCZ=' + active.value)
}
// 银行卡充值
const foreignRechargeWith = () => {
    _foreignRechargeWith({
        page_no: page.value,
        direction: tabList.value[active.value].direction
    }).then((res) => {
        list.value = []
        refreshing.value = false;
        // if (res.length < 8) {
        //     finished.value = true
        // }
 
        list.value = list.value.concat(res);
        loading.value = false;
        finished.value = true
        // 如果没有数据,显示暂无数据
        if (list.value.length === 0 && page.value === 1) {
            noData.value = true
        }
        page.value++;
    })
}
// usdt充值
const getRechargeList = () => {
    _getRechargeList({
        page_no: page.value
    }).then((res) => {
 
        list.value = []
        refreshing.value = false;
        // if (res.length < 8) {
        //     finished.value = true
        // }
        loading.value = false;
        finished.value = true
        list.value = list.value.concat(res);
        // 如果没有数据,显示暂无数据
        if (list.value.length === 0 && page.value === 1) {
            noData.value = true
        }
        page.value++;
    });
}
// usdt提现记录
const withdrawList = () => {
    _withdrawList({
        page_no: page.value
    }).then((res) => {
        refreshing.value = false;
        loading.value = false;
        list.value = list.value.concat(res);
        finished.value = true
        // 如果没有数据,显示暂无数据
        if (list.value.length === 0 && page.value === 1) {
            noData.value = true
        }
        // 如果加载完毕,显示没有更多了
        // if (res.length < 8) {
        //     finished.value = true
        // }
        page.value++;
    });
}
const onRefresh = () => {
    finished.value = false
    loading.value = true
    list.value = []
    page.value = 1
    noData.value = false
    onLoad()
 
}
</script>
<style lang="scss" scoped>
:deep(.van-tabs__line) {
    background: $btn_main;
}
 
:deep(.van-tab) {
    font-size: 16px;
}
 
:deep(.van-tabs__nav) {
    background: $select-bg;
}
 
:deep(.van-tab__text) {
    color: $text_color;
}
 
.Record {
    padding-top: var(--van-nav-bar-height);
    font-size: 14px;
}
 
.tab-fixed {
    // position: fixed;
    // top: var(--van-nav-bar-height);
    width: 100%;
    z-index: 2;
}
 
.tab-wrap {
    .tab-item {
        padding: 0 20px;
        height: 32px;
        text-align: center;
        line-height: 31px;
        color: $text_color1;
        border-radius: 20px;
        font-size: 14px;
    }
 
    .active {
        background: $btn_main;
        color: $main-btn-color;
    }
}
 
ul {
    li {
        .type {
            font-size: 18px;
        }
 
        .money {
            font-weight: bold;
            font-size: 16px;
        }
 
        .time {
            color: $dark-grey;
            font-size: 14px;
        }
 
        .status {
            color: $dark-grey;
            align-items: center;
            font-size: 14px;
        }
    }
}
 
 
.status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
 
.status-icon-color1 {
    background: $green;
}
 
.status-icon-color2 {
    background: #EA0F0F;
}
 
.status-icon-color3 {
    background: #F5D658;
}
</style>