Files
xdd-uniapp-new/pkg_user/views/withdrawalLog.vue
T

106 lines
2.4 KiB
Vue

<template>
<scroll-view class="scroll-body" scroll-y @scrolltolower="scrollToLower" v-if="ready">
<view v-for="(group,gIndex) in list" :key="gIndex">
<view style="padding: 24rpx 32rpx 20rpx">
<view style="color:#333333;font-size: 28rpx">{{ group.month }}</view>
<view style="margin-top: 10rpx;color:#999999;font-size: 24rpx">提现{{ group.amount }}</view>
</view>
<view class="logs">
<view class="item flex jc-between" v-for="(item,index) in group['extracts']" :key="index">
<view class="flex">
<image style="width: 48rpx;height: 48rpx" :src="webUrl+'/20240106215333263739.png'" mode="scaleToFill"/>
<view style="margin-left: 10rpx;">
<view style="color:#333333;font-size: 32rpx;">提现
<text class="state-red"
:class="{'state-gray':item['status']===-1,'state-green':item['status']===1}">
({{ item['status'] === -1 ? '提现失败' : item['status'] === 1 ? '已提现' : '提现中' }})
</text>
</view>
<view style="margin-top: 10rpx;color:#666666;font-size: 28rpx">{{ item.createTime }}</view>
</view>
</view>
<view style="color:#E92727;font-size: 32rpx;">{{ item['extractPrice'] }}</view>
</view>
</view>
</view>
</scroll-view>
</template>
<script>
import {payoutLog} from "@/api/user";
export default {
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
ready: false,
list: [],
page: 1,
}
},
mounted() {
this.fetchData()
this.ready = true
},
methods: {
async fetchData() {
const res = await payoutLog(this.page)
if (res.success) {
let count = 0
for (let i = 0; i < res.data.length; i++) {
count++
this.list.push(res.data[i])
}
if (count < 10 && this.page === 1) this.scrollToLower()
}
},
scrollToLower() {
this.page++
this.fetchData()
}
}
}
</script>
<style scoped lang="less">
view {
line-height: 1;
}
.scroll-body {
height: 100vh;
}
.logs {
padding: 0 32rpx;
background: #FFFFFF;
.item {
padding: 20rpx 0 26rpx;
border-bottom: 1rpx solid #ECECEE;
}
.item:last-child {
border: none;
}
.state-red {
color: #FD5749;
}
.state-gray {
color: #B3AFAF;
}
.state-green {
color: #2DBA7B;
}
}
</style>