261 lines
8.6 KiB
Vue
Raw Normal View History

<template>
<view class="page">
<view style="background-color: #FFFFFF;border-radius: 0rpx 0rpx 44rpx 44rpx;padding: 30rpx 30rpx 40rpx 30rpx;">
<view class="section_1">
<view style="color: #FFFFFF;font-size: 26rpx;padding: 30rpx 30rpx 0rpx 30rpx;">当前余额</view>
<view style="display: flex;justify-content: space-between;align-items: center;padding: 30rpx;">
<view style="color: #FFFFFF;font-size: 60rpx;font-weight: 900;">
{{settleInfo.settled_amount?settleInfo.settled_amount:0}}</view>
<view @click="openUrl('/packageB/wallet/bank')">
<view
style="text-align: center;width: 169rpx;height: 70rpx;background: #BBFC5B;line-height: 70rpx;color: #3D3D3D;font-size: 32rpx;border-radius: 70rpx;">
提现</view>
</view>
</view>
<view style="color: #FFFFFF;font-weight: 400;font-size: 26rpx;padding-left: 30rpx;">
<text>预计待入账</text>
<text
style="padding-left: 20rpx;">{{settleInfo.expected_incoming_amount?settleInfo.expected_incoming_amount:0}}</text>
<text style="padding: 0rpx 20rpx;">|</text>
<text>累计收益</text>
<text
style="padding-left: 20rpx;">{{settleInfo.accumulated_incoming_amount?settleInfo.accumulated_incoming_amount:0}}</text>
</view>
</view>
</view>
<view
style="background-color: #FFFFFF;border-radius:44rpx;padding:45rpx 30rpx;margin-top: 30rpx;">
<view style="display: flex;gap: 70rpx;padding-bottom: 40rpx;">
<view @click="openTab(0)">
<view :class="tabIndex==0?'act':'no_act'">收益明细</view>
<view v-if="tabIndex==0"
style="width: 60rpx;height: 10rpx;background-color: #BBFC5B;margin: 0 auto;margin-top: 20rpx;">
</view>
</view>
<view @click="openTab(1)">
<view :class="tabIndex==1?'act':'no_act'">提现明细</view>
<view v-if="tabIndex==1"
style="width: 60rpx;height: 10rpx;background-color: #BBFC5B;margin: 0 auto;margin-top: 20rpx;">
</view>
</view>
</view>
<view v-if="tabIndex==0" v-for="item in list">
<view style="display: flex;justify-content: space-between;align-items: center;">
<view>
<view style="font-size: 30rpx;color: #3D3D3D;font-weight: 600;">{{item.detail.title}}</view>
<view style="font-size: 26rpx;color: #9C9C9C;font-weight: 400;margin: 30rpx 0rpx;">
<text v-if="item.status==3">{{formatTimestamp(item.settletime)}}</text>
<text v-if="item.status==2">{{formatTimestamp(item.createtime)}}</text>
</view>
<view style="font-size: 25rpx;color: #FF4810;font-weight: 400;">[ 活动订单总金额x{{item.fee_scale*100}}%平台费率=待入账金额 ]
</view>
</view>
<view style="text-align: center;">
<view>+{{item.settle_price}}</view>
<view v-if="item.status==2"
style="background: #E6EEFF;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;margin-top: 20rpx;">
<view style="color: #2F78CD;font-size: 22rpx;line-height: 32rpx;">待入账</view>
</view>
<view v-if="item.status==3"
style="background: #EAF8EB;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;margin-top: 20rpx;">
<view style="color: #2BA635;font-size: 22rpx;line-height: 32rpx;">已入账</view>
</view>
</view>
</view>
<view style="background: #F0F0F0;width: 100%;height: 1px;margin: 40rpx 0rpx;"></view>
</view>
<view v-if="tabIndex==1" v-for="item in list">
<view style="display: flex;justify-content: space-between;align-items: center;">
<view>
<view style="font-size: 30rpx;color: #3D3D3D;font-weight: 600;">工商银行0514</view>
<view style="font-size: 26rpx;color: #9C9C9C;font-weight: 400;margin: 30rpx 0rpx;">2025.05.25
14:35:36</view>
</view>
<view style="text-align: center;">
<view>+55.00</view>
<view v-if="item.status==1"
style="background: #E6EEFF;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;">
<view style="color: #2F78CD;font-size: 22rpx;line-height: 32rpx;">审核中</view>
</view>
<view v-if="item.status==3"
style="background: #F8EAEA;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;">
<view style="color: #A62B2B;font-size: 22rpx;line-height: 32rpx;">失败</view>
</view>
<view v-if="item.status==2 && item.withdrawal_status==3"
style="background: #EAF8EB;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;">
<view style="color: #2BA635;font-size: 22rpx;line-height: 32rpx;">已打款</view>
</view>
<view v-if="item.status==2 && item.withdrawal_status==2"
style="background: #FFF3ED;width: 90rpx;height: 32rpx;border-radius: 4rpx 4rpx 4rpx 4rpx;text-align: center;margin: 0 auto;">
<view style="color: #FF783A;font-size: 22rpx;line-height: 32rpx;">打款中</view>
</view>
</view>
</view>
<view style="font-weight: 400;color: #3D3D3D;font-size: 24rpx;background: #EEEEEE;border-radius: 6rpx;padding: 30rpx 20rpx;">
银行卡异常无法打款金额已返还账户
</view>
<view style="background: #F0F0F0;width: 100%;height: 1px;margin: 40rpx 0rpx;"></view>
</view>
<u-loadmore style="margin-bottom: 60rpx;" :status="loadStatus" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
tabIndex: 0,
page: 1,
list: [],
settleInfo: {},
loadStatus: 'loading',
}
},
onLoad() {
this.getSyList();
},
onShow() {
this.token = uni.getStorageSync('token');
if (this.token) {
this.getUserInfo();
}
},
onReachBottom() {
this.page += 1;
if (this.tabIndex == 0) {
this.getSyList();
} else {
this.getTxList();
}
},
methods: {
openTab(index) {
this.loadStatus = 'loading';
this.page = 1;
this.tabIndex = index;
this.list=[];
if (index == 0) {
this.getSyList();
} else {
this.getTxList();
}
},
getSyList() {
uni.$u.http
.get("/api/school.newactivity.settle_log/settle_log", {
params: {
page: this.page,
limit: 10,
status:'2,3'
},
})
.then((res) => {
if (res.code == 1) {
this.list.push(...res.data.list);
if (res.data.list.length < 10) {
this.loadStatus = 'nomore';
}
} else {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
}
})
},
getTxList(){
uni.$u.http
.get("/api/school.newactivity.settle_log/withdrawal_log", {
params: {
page: this.page,
limit: 10,
},
})
.then((res) => {
if (res.code == 1) {
this.list.push(...res.data.list);
if (res.data.list.length < 10) {
this.loadStatus = 'nomore';
}
} else {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
}
})
},
// 获取个人信息
getUserInfo() {
uni.$u.http.get('/api/user/index', {}).then(res => {
if (res.code == 1) {
uni.setStorageSync('userInfo', res.data.user_info)
uni.setStorageSync('settleInfo', res.data.settle_info)
uni.setStorageSync('activityInfo', res.data.activity_info)
this.settleInfo= res.data.settle_info;
} else {
uni.showToast({
title: '登陆失败',
icon: 'error',
duration: 2000
})
}
}).catch(error => {
console.log('error', error);
this.showPopup = false
uni.showToast({
title: '登陆失败',
icon: 'error',
duration: 2000
})
})
},
formatTimestamp(timestamp) {
const date = new Date(timestamp * 1000); // 10位时间戳需要乘以1000
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
},
openUrl(url){
uni.navigateTo({
url:url
})
},
}
}
</script>
<style scoped lang="scss">
.page {
font-family: PingFang SC, PingFang SC;
background: #f7f7f7;
min-height: 100vh;
}
.section_1 {
width: 100%;
height: 264rpx;
background: url(@/static/wallet.png);
background-size: 100% 100%;
}
.no_act {
font-size: 30rpx;
font-weight: 600;
color: #9C9C9C;
}
.act {
font-size: 34rpx;
color: #323232;
font-weight: 600;
}
</style>