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

111 lines
2.5 KiB

10 months ago
<template>
<view class="recharge">
<view class="recharge-bd">
<view class="item" v-for="item in list" :key="i">
10 months ago
<view class="l">
<view class="a">提现</view>
<view class="b">{{item.created_at}}</view>
10 months ago
</view>
<view class="r">
<view class="a">-{{item.money}}</view>
<view class="b">{{item.status==0?'待审核':item.status==1?'提现成功':'提现失败'}}</view>
10 months ago
</view>
</view>
</view>
</view>
</template>
<script>
import * as wallet from '@/api/wallet'
10 months ago
export default {
data() {
return {
list:[]
10 months ago
}
},
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)
});
}
console.log(res.data.list.data)
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: 20rpx;
overflow: hidden;
&-bd{
padding: 0 30rpx;
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;
}
.l{
flex: 1;
.a{
padding: 20rpx 0;
font-size: 28rpx;
font-weight: 400;
color: #595959;
}
.b{
font-size: 28rpx;
font-weight: 400;
color: #A3A3A3;
}
}
.r{
flex: 1;
text-align: right;
.a{
font-size: 40rpx;
font-weight: 500;
color: #414141;
}
.b{
font-size: 28rpx;
font-weight: 400;
color: #A3A3A3;
}
}
}
}
}
</style>