新增账单详情功能
This commit is contained in:
parent
2ac2ad15c4
commit
60bafdfee8
@ -33,4 +33,9 @@ export const rechargeLists = (data) => oahttp.get('/recharge/lists', data)
|
||||
/**
|
||||
* 余额明细
|
||||
*/
|
||||
export const accountLogLists = (data) => oahttp.get('/account_log/lists', data)
|
||||
export const accountLogLists = (data) => oahttp.get('/account_log/lists', data)
|
||||
|
||||
/**
|
||||
* 月份统计
|
||||
*/
|
||||
export const accountLogListsMonth = (data) => oahttp.get('/account_log/year_count', data)
|
||||
|
@ -231,7 +231,7 @@
|
||||
}, {
|
||||
"path": "orderDetail/orderDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情",
|
||||
"navigationBarTitleText": "账单详情",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#3175f9",
|
||||
"navigationBarTextStyle": "white"
|
||||
|
@ -47,7 +47,8 @@
|
||||
<view :class="current==1?'active':''" @click="changeBillType(1)">月账单</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bill_list">
|
||||
<!-- 日账单 -->
|
||||
<view class="bill_list" v-show="current==0">
|
||||
<view class="card" v-for="(item, index) in billList" :key="index">
|
||||
<view class="top">
|
||||
<view class="blue">账单详情</view>
|
||||
@ -55,8 +56,8 @@
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="left">
|
||||
<view>收益金额(元){{item.change_amount}}</view>
|
||||
<view class="num"></view>
|
||||
<view>收益金额(元)</view>
|
||||
<view class="num">{{item.change_amount}}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>支出金额:{{item.change_amount_desc<0?item.change_amount:'0.00'}}</view>
|
||||
@ -64,8 +65,28 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
</view>
|
||||
<!-- 月账单 -->
|
||||
<view class="bill_list" v-show="current==1">
|
||||
<view class="card" v-for="(item, index) in billListMonth" :key="index">
|
||||
<view class="top">
|
||||
<view class="blue">账单详情</view>
|
||||
<view>账单日期:{{item.month}}</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="left">
|
||||
<view>收益金额(元)</view>
|
||||
<view class="num">{{item.income}}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>支出金额:{{item.expenditure>0?item.expenditure:'0.00'}}</view>
|
||||
<view>入账金额:{{item.income>0?item.income:'0.00'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore status="nomore" nomore-text="仅展示一年数据" />
|
||||
</view>
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
|
||||
<button class="btn">提现余额</button>
|
||||
</view>
|
||||
@ -73,7 +94,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { accountLogLists } from "@/api/pay.js"
|
||||
import { accountLogLists, accountLogListsMonth } from "@/api/pay.js"
|
||||
import { Toast } from '@/libs/uniApi.js'
|
||||
export default {
|
||||
data() {
|
||||
@ -82,6 +103,7 @@ export default {
|
||||
billTypeList:['日账单','月账单'],
|
||||
current: 0,
|
||||
billList: [],
|
||||
billListMonth: [],
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
@ -120,6 +142,7 @@ export default {
|
||||
},
|
||||
changeBillType(type){
|
||||
this.current = type;
|
||||
if(type==1)this.loadBillMonth();
|
||||
},
|
||||
async loadBill(){
|
||||
let res = await accountLogLists({
|
||||
@ -129,6 +152,14 @@ export default {
|
||||
});
|
||||
console.log(res);
|
||||
this.billList = [...this.billList, ...res.data.lists];
|
||||
},
|
||||
async loadBillMonth(){
|
||||
let res = await accountLogListsMonth();
|
||||
let list = [];
|
||||
for(let key in res.data){
|
||||
list.push(res.data[key])
|
||||
}
|
||||
this.billListMonth = list;
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
|
@ -10,15 +10,15 @@
|
||||
<uni-calendar :insert="true" @change="changeDate" :date="nowYMD" :showMonth="false"/>
|
||||
</view>
|
||||
<view class="detail">
|
||||
<uni-section class="title" titleFontSize="32rpx" title="账单明细 2023-7-24" type="line"></uni-section>
|
||||
<uni-section class="title" titleFontSize="32rpx" :title="'账单明细 '+ nowYMD" type="line"></uni-section>
|
||||
<view class="card">
|
||||
<view class="item">
|
||||
<view class="text">
|
||||
收益总金额(元)
|
||||
<view class="price">100.00</view>
|
||||
<view class="price">{{income}}</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
平台收益:100.00元(1笔)
|
||||
平台收益:{{terraceIncome.count}}元({{terraceIncome.num}}笔)
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
@ -27,13 +27,13 @@
|
||||
<view class="price">0.00</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
平台支出:0.00元(0笔)
|
||||
平台支出:{{terraceIncome.count}}元({{terraceIncome.num}}笔)
|
||||
</view>
|
||||
</view>
|
||||
<view class="all">
|
||||
<view>收益总金额(元):</view>
|
||||
<view class="price">
|
||||
100.00
|
||||
{{aggregateAmount}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -92,6 +92,56 @@
|
||||
let m = this.nowDate.m<10?'0'+this.nowDate.m:this.nowDate.m;
|
||||
let d = this.nowDate.d<10?'0'+this.nowDate.d:this.nowDate.d;
|
||||
return this.nowDate.y+'-'+m+'-'+d;
|
||||
},
|
||||
// 总收益
|
||||
aggregateAmount(){
|
||||
return (this.income>this.disbursement?this.income-this.disbursement:0).toFixed(2);
|
||||
},
|
||||
// 收益
|
||||
income(){
|
||||
let count = 0;
|
||||
this.billList.forEach(item=>{
|
||||
item.action==1?count+=+item.change_amount:null;
|
||||
})
|
||||
return count.toFixed(2);
|
||||
},
|
||||
// 平台收益
|
||||
terraceIncome(){
|
||||
let count = 0;
|
||||
let num = 0;
|
||||
this.billList.forEach(item=>{
|
||||
if(item.action==1&&item.change_type!==201){
|
||||
count+=+item.change_amount;
|
||||
num++;
|
||||
}
|
||||
})
|
||||
return {
|
||||
count: count.toFixed(2),
|
||||
num: num
|
||||
};
|
||||
},
|
||||
// 支出
|
||||
disbursement(){
|
||||
let count = 0;
|
||||
this.billList.forEach(item=>{
|
||||
item.action==2?count+=+item.change_amount:null;
|
||||
})
|
||||
return count.toFixed(2);
|
||||
},
|
||||
// 平台支出
|
||||
terraceDisbursement(){
|
||||
let count = 0;
|
||||
let num = 0;
|
||||
this.billList.forEach(item=>{
|
||||
if(item.action==2&&item.change_type!==201){
|
||||
count+=+item.change_amount;
|
||||
num++;
|
||||
}
|
||||
})
|
||||
return {
|
||||
count: count.toFixed(2),
|
||||
num: num
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -112,6 +162,10 @@
|
||||
// 选择日期
|
||||
changeDate(e) {
|
||||
console.log(e);
|
||||
this.nowDate.y = e.year;
|
||||
this.nowDate.m = +e.month;
|
||||
this.nowDate.d = e.date;
|
||||
|
||||
},
|
||||
// 选择月份
|
||||
bindDateChangeMonth(e){
|
||||
@ -156,7 +210,7 @@
|
||||
background-color: transparent;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.card {
|
||||
width: 694rpx;
|
||||
// height: 454rpx;
|
||||
@ -207,4 +261,67 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bill_list{
|
||||
// background-color: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.card{
|
||||
width: 694rpx;
|
||||
padding: 28rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 21rpx;
|
||||
.top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: #333333FF;
|
||||
line-height: 39rpx;
|
||||
.blue{
|
||||
width: 137rpx;
|
||||
height: 49rpx;
|
||||
background: #3274F9;
|
||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 39rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 28rpx;
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 160rpx;
|
||||
.left{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 39rpx;
|
||||
.num{
|
||||
font-size: 39rpx;
|
||||
font-weight: 500;
|
||||
color: #F02828;
|
||||
line-height: 39rpx;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
flex: 1;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
line-height: 39rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user