You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news/user/rechargeList.vue

135 lines
3.0 KiB

10 months ago
<template>
<view class="recharge">
11 months ago
<view class="recharge-bd">
10 months ago
<view class="item" v-for="item in list" :key="i" v-if="list.length>0">
11 months ago
<view class="l">
<view class="a">提现</view>
<view class="b">{{item.created_at}}</view>
11 months ago
</view>
<view class="r">
<view class="a">-{{item.money?Number(item.money):item.money}}</view>
<view class="b">{{item.status==0?'待审核':item.status==1?'提现成功':'提现失败'}}</view>
11 months ago
</view>
</view>
10 months ago
</view>
<u-empty text="暂无数据显示哦~" v-if="list.length==0" mode="list"></u-empty>
10 months ago
</view>
</template>
<script>
10 months ago
import * as wallet from '@/api/wallet'
export default {
data() {
return {
list: []
}
},
onLoad() {
this.getRechargeList()
10 months ago
},
methods: {
getRechargeList() {
let that = this;
wallet.list()
.then(res => {
if (res.data.list.data.length == 0) {
res.data.list.data.forEach((elem) => {
elem.created_at = that.timestampToYds(elem.created_at)
});
}
that.list = res.data.list.data
})
.finally()
},
timestampToYds(timestamp) {
//时间戳为10位需*1000,为13位不需乘1000
let times = timestamp.length == 10 ? times * 1000 : timestamp;
var date = new Date(times);
let Y = date.getFullYear(),
M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1),
D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()),
h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()),
m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()),
s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' + s
10 months ago
},
}
}
</script>
<style lang="scss" scoped>
.recharge {
padding: 25rpx;
11 months ago
overflow: hidden;
10 months ago
&-bd {
padding: 0 28rpx;
10 months ago
background-color: #fff;
border-radius: 12rpx;
overflow: hidden;
.item {
padding: 20rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #F3F3F3;
&:first-child {
border-top-color: #fff;
11 months ago
}
10 months ago
.l {
flex: 1;
.a {
padding: 20rpx 0;
margin:0 6rpx;
10 months ago
font-size: 28rpx;
font-weight: 400;
color: #595959;
}
.b {
font-size: 28rpx;
font-weight: 400;
color: #A3A3A3;
margin:0 6rpx
10 months ago
}
11 months ago
}
10 months ago
.r {
flex: 1;
text-align: right;
.a {
font-size: 40rpx;
font-weight: 500;
color: #414141;
}
.b {
font-size: 28rpx;
font-weight: 400;
color: #A3A3A3;
}
}
11 months ago
}
}
}
10 months ago
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
image {
width: 114rpx;
height: auto;
margin-top: 200rpx;
}
}
11 months ago
</style>