创作者微信小程序端
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.
 
 
 
 

161 lines
3.3 KiB

<template>
<view class="container">
<uni-list
border-full
v-for="(item,index) in withdrawList" :key="index"
>
<uni-list-item
showArrow
clickable
:title="'订单号:'+item.orderId"
:note="item.createTime+'&'+item.channel+'&'+item.status"
:rightText="'¥'+item.amt"
@click="targetToDetail(item.orderId)">
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime
}}</view>
<view class="box-bot">
<view>
{{ setChannel(item.channel) }}
</view>
<view style="color: #4d6aff">
{{ setStatus(item.status)}}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list>
<view class="ivOver" v-if="flag">-----已经到底啦-----</view>
</view>
</template>
<script>
import {
getWithdrawList
} from '@/api/userInfo.js'
export default {
data() {
return {
withdrawList: [],
pageSize: 10,
pageNum: 1,
userInfo: {},
flag: false
}
},
created() {
const userInfoSync = uni.getStorageSync('userInfo')
this.userInfo = userInfoSync
this.getWithdrawList();
},
// 下拉刷新
onPullDownRefresh() {
this.pageNum = 1
this.withdrawList = []
this.getWithdrawList()
uni.stopPullDownRefresh()
},
// 上划加载更多
onReachBottom() {
if (this.withdrawList.length > this.pageSize*this.pageNum-1) {
this.flag = false;
this.pageNum += 1
this.getWithdrawList();
}else{
this.flag = true;
}
},
methods: {
// 查询提现记录列表
async getWithdrawList() {
const res = await getWithdrawList({
pageSize: this.pageSize,
pageNum: this.pageNum,
creatorId: this.userInfo.id
})
console.log('res', res)
if (res.data.code === 200) {
this.withdrawList.push(...res.data.rows)
} else {
uni.showModal({
content: '提现记录列表数据加载失败!',
showCancel: false
});
}
},
targetToDetail(orderId) {
console.log('orderId', orderId)
if (orderId) {
uni.navigateTo({
url: 'withdrawDetail?orderId=' + orderId,
});
}
},
setChannel(data){
if (data == "0") {
return "微信";
} else if (data == "1") {
return "银行卡";
} else if (data == "2") {
return "支付宝";
}
},
setStatus(data){
if (data == "0") {
return "待审核";
} else if (data == "1") {
return "提现中";
} else if (data == "2") {
return "提现成功";
} else if(data == "3"){
return "提现失败";
}else if(data == "4"){
return "审核拒绝";
}
}
}
}
</script>
<style lang="scss">
.uni-list-item__icon-img {
border-radius: 16rpx;
}
.ivOver{
width: 100%;
height:100rpx;
line-height: 100rpx;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.box {
display: flex;
padding-right: 16rpx;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.box-bot {
display: flex;
margin-top: 10rpx;
}
.box-bot view {
border-radius: 6rpx;
border: 2rpx solid #4d6aff;
padding: 4rpx 10rpx;
margin-right: 10rpx;
font-size: 24rpx;
}
.uni-list-item__content-title {
font-size: 28rpx;
color: #3b4144;
overflow: hidden;
}
</style>