liangjin
2021-03-22 39f63c38738cd40b142458708dee9bfbf8d1db1a
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
<!--
 * @Author: 小明丶
 * @Date: 2020-08-17 15:34:17
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-10-12 20:30:01
 * @Description: 
-->
<template>
    <div class="withdrawal-history-page">
        <v-navbar title="提现记录"></v-navbar>
        <div class="history-box">
            <van-list
              offset="50"
              :immediate-check="false"
              v-model="loading"
              :finished="finished"
              :error.sync="error"
              finished-text="没有更多了"
              error-text="加载失败,请稍后再试"
              @load="onLoad"
            >
                <div class="list-item" v-for="(item,index) in list" :key="index">
                    <div class="left">
                        <p>{{item.statusName}}</p>
                        <p>{{item.withdTime | dateFmt(item.withdTime)}}</p>
                    </div>
                    <div class="right">
                        <p>{{item.status==0?'':item.status==1?'':item.status==2?'+':''}}{{item.amount}}</p>
                        <p>{{item.settType=='01'?'银行卡':'支付宝'}}&nbsp;{{item.withdAccount}}</p>
                    </div> 
                </div>
            </van-list>
        </div>
    </div>
</template>
<script>
import dateFmt from "../../../../utils/date";
export default {
    data() {
        return {
            list:[],
            error:false,//加载错误
            loading: false,//加载中
            finished: false,//全部加载完成
            lastId:'',//最后一条Id
        }
    },
    filters: {
      dateFmt(val) {
        return dateFmt(val, "YYYY-MM-DD HH:mm");
      },
    },
    created(){
        this.onLoad()
    },
    methods:{
        onLoad(){
            this.loading = true
            this.$api.tltWalletWithdrawDetails({
                withdrawId:this.lastId
            }).then(res=>{
                if(res.body.items){
                    if(res.body.items.length < 10){
                        this.list = [...this.list,...res.body.items]
                        this.lastId = this.list[this.list.length-1].withdrawId
                        this.loading = false
                        this.finished = true
                    }else{
                        this.list = [...this.list,...res.body.items]
                        this.lastId = this.list[this.list.length-1].withdrawId
                        this.loading = false
                    }
                }else{
                    this.loading = false
                    this.finished = true
                }
            }).catch(err=>{
                this.error = true
            })
        }
    },
    
}
</script>
<style lang="less">
    .withdrawal-history-page{
        &{
            background: #F5F5F7;
            min-height: 100vh;
        }
        .history-box{
            margin-top: 10px;
            box-sizing: border-box;
            padding: 0 17px;
            background: #fff;
            .list-item{
                display: flex;
                border-bottom:1px solid #F1F1F1;
                padding: 16px 0;
                .left{
                    width: 40%;
                    p:nth-of-type(1){
                        margin-bottom: 10px;
                        font-size:14px;
                        font-family:PingFang SC;
                        font-weight:500;
                        color:rgba(51,51,51,1);
                    }
                    p:nth-of-type(2){
                        font-size:12px;
                        font-family:PingFang SC;
                        font-weight:500;
                        color:rgba(153,153,153,1);
                    }
                }
                .right{
                    width: 59%;
                    text-align: right;
                    p:nth-of-type(1){
                        margin-bottom: 10px;
                        font-size:16px;
                        font-family:PingFang SC;
                        font-weight:bold;
                        color:rgba(51,51,51,1);
                    }
                    p:nth-of-type(2){
                        font-size:12px;
                        font-family:PingFang SC;
                        font-weight:500;
                        color:rgba(153,153,153,1);
                    }
                }
            }
            .list-item:last-child{
                border-bottom:0;
            }
        }
    }
</style>