优化财务管理功能
This commit is contained in:
parent
b42e74a2ac
commit
87e39b4d30
@ -95,7 +95,7 @@
|
||||
|
||||
<script>
|
||||
import { accountLogLists, accountLogListsMonth } from "@/api/pay.js"
|
||||
import { Toast } from '@/libs/uniApi.js'
|
||||
import { Toast } from '@/libs/uniApi.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -106,30 +106,29 @@ export default {
|
||||
billListMonth: [],
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
limit: 25,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'nomore'
|
||||
nomoreText: '没有更多账单了~~',
|
||||
status: 'loadmore'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// console.log(this.userInfo);
|
||||
this.userInfo = this.$store.state.app.userInfo;
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: '#ffffff',
|
||||
backgroundColor: '#3175f9'
|
||||
})
|
||||
this.loadBill()
|
||||
},
|
||||
onShow() {
|
||||
this.loadBill()
|
||||
// console.log(this.userInfo);
|
||||
this.userInfo = this.$store.state.app.userInfo;
|
||||
},
|
||||
computed:{
|
||||
eyeType(){
|
||||
return this.$store.state.config.eyeType;
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
this.loadBill()
|
||||
},
|
||||
methods: {
|
||||
naviTo(url) {
|
||||
url ?
|
||||
@ -140,17 +139,25 @@ export default {
|
||||
updateEye(){
|
||||
this.$store.commit('SET_EYE_TYPE')
|
||||
},
|
||||
// 选择日账单月账单
|
||||
changeBillType(type){
|
||||
this.current = type;
|
||||
if(type==1)this.loadBillMonth();
|
||||
},
|
||||
async loadBill(){
|
||||
if(this.loadConfig.status=="nomore")return;
|
||||
this.loadConfig.status="loading"
|
||||
let res = await accountLogLists({
|
||||
type: 'um',//账户余额
|
||||
page_no: 1,
|
||||
page_size: 10
|
||||
type: 'um', //账户余额
|
||||
page_no: this.loadConfig.page,
|
||||
page_size: this.loadConfig.page_size
|
||||
});
|
||||
console.log(res);
|
||||
this.loadConfig.status="loadmore"
|
||||
if(res.data.lists.length<this.loadConfig.limit){
|
||||
this.loadConfig.status="nomore"
|
||||
}else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.billList = [...this.billList, ...res.data.lists];
|
||||
},
|
||||
async loadBillMonth(){
|
||||
|
@ -24,7 +24,7 @@
|
||||
<view class="item">
|
||||
<view class="text">
|
||||
支出总金额(元)
|
||||
<view class="price">0.00</view>
|
||||
<view class="price">{{disbursement}}</view>
|
||||
</view>
|
||||
<view class="tips">
|
||||
平台支出:{{terraceIncome.count}}元({{terraceIncome.num}}笔)
|
||||
@ -74,19 +74,19 @@
|
||||
},
|
||||
loadConfig:{
|
||||
page: 1,
|
||||
limit: 15,
|
||||
limit: 25,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'nomore'
|
||||
nomoreText: '没有更多账单了~~',
|
||||
status: 'loadmore'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
onLoad() {
|
||||
this.initDate()
|
||||
this.loadBill()
|
||||
},
|
||||
onShow() {},
|
||||
computed:{
|
||||
nowYMD(){
|
||||
let m = this.nowDate.m<10?'0'+this.nowDate.m:this.nowDate.m;
|
||||
@ -144,13 +144,25 @@
|
||||
};
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadBill()
|
||||
},
|
||||
methods: {
|
||||
async loadBill() {
|
||||
if(this.loadConfig.status=="nomore")return;
|
||||
this.loadConfig.status="loading"
|
||||
let res = await accountLogLists({
|
||||
type: 'um', //账户余额
|
||||
page_no: 1,
|
||||
page_size: 10
|
||||
page_no: this.loadConfig.page,
|
||||
page_size: this.loadConfig.page_size,
|
||||
time: this.nowYMD
|
||||
});
|
||||
this.loadConfig.status="loadmore"
|
||||
if(res.data.lists.length<this.loadConfig.limit){
|
||||
this.loadConfig.status="nomore"
|
||||
}else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.billList = [...this.billList, ...res.data.lists];
|
||||
},
|
||||
initDate(){
|
||||
@ -161,11 +173,13 @@
|
||||
},
|
||||
// 选择日期
|
||||
changeDate(e) {
|
||||
console.log(e);
|
||||
this.nowDate.y = e.year;
|
||||
this.nowDate.m = +e.month;
|
||||
this.nowDate.d = e.date;
|
||||
|
||||
this.loadConfig.page = 1;
|
||||
this.loadConfig.status = 'loadmore';
|
||||
this.billList = [];
|
||||
this.loadBill();
|
||||
},
|
||||
// 选择月份
|
||||
bindDateChangeMonth(e){
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
<script>
|
||||
import { recharge, payWay, payPrepay, wechatJsConfig, payStatus } from "@/api/pay.js"
|
||||
import { userInfo } from "@/api/oaUser.js"
|
||||
import { debounce, throttle } from 'lodash'
|
||||
import { Toast } from '@/libs/uniApi.js'
|
||||
export default {
|
||||
@ -122,8 +123,11 @@
|
||||
from: data.from,
|
||||
}).then((status)=>{
|
||||
uni.showToast({
|
||||
icon:status.data.pay_status?'success':'error',
|
||||
title: status.data.pay_status?'支付成功!':'支付失败!'
|
||||
icon:status.data.pay_status?'success':'none',
|
||||
title: status.data.pay_status?'支付成功':'支付失败'
|
||||
})
|
||||
userInfo().then(user=>{
|
||||
this.$store.commit('setUserInfo', user.data);
|
||||
})
|
||||
})
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user