jhzh
2024-09-23 e678ec74066a2c5b5b3b404d3344bffbd3cf59bd
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
<template>
    <!-- 提现历史 -->
    <div class="pl-30 pr-30">
        <div class="text-center recharge-text font-30">{{ $t('数字货币') }}</div>
<!--        <div class="flex justify-between mb82" v-for="(item,index) in list" :key="index" @click="onDetail(item)">-->
<!--            <div>-->
<!--                <div class="font-35">{{ item.coin }}</div>-->
<!--                <div class="text-grey font-30 mt20">{{ item.createTime }}</div>-->
<!--            </div>-->
<!--            <div>-->
<!--                <div class="font-35 text-right">{{ item.amount }}</div>-->
<!--                <div class="mt20">-->
<!--                    <div class="flex justify-end" v-if="item.status==0">-->
<!--                        <div class="common-round yellow-round"></div>-->
<!--                        <div class="text-grey font-30">{{ $t('审核中') }}</div>-->
<!--                    </div>-->
<!--                    <div class="flex" v-if="item.status==1">-->
<!--                        <div class="common-round green-round"></div>-->
<!--                        <div class="text-grey font-30">{{ $t('成功') }}</div>-->
<!--                    </div>-->
<!--                    <div class="flex" v-if="item.status==2">-->
<!--                        <div class="common-round red-round"></div>-->
<!--                        <div class="text-grey font-30">{{ $t('失败') }}</div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
      <van-pull-refresh v-model="isLoading" @refresh="onRefresh" :pulling-text="$t('下拉即可刷新')" :loosing-text="$t('释放即可刷新')" :loading-text="$t('加载中')">
        <div>
          <div v-if='noData' class="textColor">
            {{ $t('暂无数据') }}
          </div>
          <template v-else>
            <van-list
                :immediate-check="false"
                v-model="loading"
                :finished="finished"
                :finished-text="$t('已经全部加载完毕')"
                :offset="130"
                @load="onLoad"
                :loading-text="$t('加载中...')">
              <div class="flex justify-between mb82" v-for="(item,index) in list" :key="index" @click="onDetail(item)">
                <div>
                  <div class="font-35 textColor">{{ item.coin }}</div>
                  <div class="text-grey font-30 mt20">{{ item.createTime }}</div>
                </div>
                <div>
                  <div class="font-35 text-right textColor">{{ item.amount }}</div>
                  <div class="mt20">
                    <div class="flex justify-end" v-if="item.status==0">
                      <div class="common-round yellow-round"></div>
                      <div class="text-grey font-30">{{ $t('审核中') }}</div>
                    </div>
                    <div class="flex justify-end" v-if="item.status==1">
                      <div class="common-round green-round"></div>
                      <div class="text-grey font-30">{{ $t('成功') }}</div>
                    </div>
                    <div class="flex" v-if="item.status==2">
                      <div class="common-round red-round"></div>
                      <div class="text-grey font-30">{{ $t('失败') }}</div>
                    </div>
                  </div>
                </div>
              </div>
            </van-list>
          </template>
        </div>
      </van-pull-refresh>
    </div>
</template>
 
<script>
import AxiosWithdraw from "@/API/withdraw.js"
import { List,PullRefresh } from 'vant';
export default {
    name:"withdrawHistory",
    components: {
      [List.name]: List,
      [PullRefresh.name]:PullRefresh
    },
    data() {
        return {
          list:[],
          page:1,
          loading: false, // 当loading为true时,转圈圈
          finished: false,  // 数据是否请求结束,结束会先显示'已经全部加载完毕'
          noData:false ,// 如果没有数据,显示暂无数据
          isLoading:false,   // 下拉的加载图案
        }
    },
    mounted() {
        this.getList();
    },
    methods: {
        onDetail(item) {
            this.$router.push('/withdraw/withdrawDetail?order_no='+ item.order_no)
        },
        getList(isInit) {
            AxiosWithdraw.WithdrawList({
              page_no:this.page
            }).then((res)=>{
              this.isLoading = false
              if (res.code == 0) {
                this.loading = false;
                this.list = this.list.concat(res.data);
                // 如果没有数据,显示暂无数据
                if (this.list.length === 0 && this.page === 1) {
                  this.noData = true
                }
                // 如果加载完毕,显示没有更多了
                if (res.data.length < 8) {
                  console.log('sdjajajd')
                  this.finished = true
                }
                this.page++;
              }
            });
        },
        onLoad() {
          setTimeout(() => {
            this.getList();
          }, 500)
        },
        onRefresh () {
          this.list = []
          this.page = 1
          this.loading = true
          this.finished = false
          this.noData = false
          this.onLoad()
        }
    }
}
</script>
 
<style lang="scss" scoped>
@import "./history.scss";
 
</style>