mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-07 17:32:25 +08:00
需求变更进行调整
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<!-- 顶部tab切换 -->
|
||||
<view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index"
|
||||
:class="['tab-item', activeTab === tab.value ? 'active' : '']" @click="activeTab = tab.value">
|
||||
:class="['tab-item', activeTab === tab.value ? 'active' : '']" @click="onTabClick(tab.value)">
|
||||
{{ tab.label }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
<!-- 右侧金额 + 图标 -->
|
||||
<view class="right">
|
||||
<view class="amount" :class="item.inOutType === '收' ? 'income' : 'expense'">
|
||||
{{ item.inOutType === '收' ? '+' : '-' }}{{ item.itemAmount.toFixed(2) }}
|
||||
<view class="amount" :class="item.inOutType === '支' ? 'income' : 'expense'">
|
||||
{{ item.inOutType === '支' ? '+' : '-' }}{{ formatMoney(item.itemAmount) }}
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="32" color="#ccc"></u-icon>
|
||||
</view>
|
||||
@@ -71,14 +71,14 @@
|
||||
pageSize:10,
|
||||
flowList: [],
|
||||
loadStatus: 'loadmore',
|
||||
activeTab: 'in', // 默认显示“收”
|
||||
activeTab: '收', // 默认显示“收”
|
||||
tabs: [{
|
||||
label: '收入',
|
||||
value: 'in'
|
||||
value: '支'
|
||||
},
|
||||
{
|
||||
label: '支出',
|
||||
value: 'out'
|
||||
value: '收'
|
||||
},
|
||||
],
|
||||
// 年份筛选相关
|
||||
@@ -109,6 +109,10 @@
|
||||
computed: {
|
||||
},
|
||||
methods: {
|
||||
onTabClick(val) {
|
||||
this.activeTab = val
|
||||
this.resetAndLoad()
|
||||
},
|
||||
fetchPayRecord() {
|
||||
if (this.loadStatus !== 'loadmore') return;
|
||||
this.loadStatus = 'loading';
|
||||
@@ -122,7 +126,6 @@
|
||||
WT:this.$getToken()
|
||||
}).then(res => {
|
||||
const rows = res.data.result || [];
|
||||
console.log(rows)
|
||||
if (this.pageNo === 1) this.flowList = [];
|
||||
this.flowList = this.flowList.concat(rows);
|
||||
if (rows.length < this.pageSize) {
|
||||
@@ -146,10 +149,14 @@
|
||||
this.showYearPicker = false;
|
||||
this.resetAndLoad();
|
||||
},
|
||||
formatMoney(val) {
|
||||
if (!val && val !== 0) return '—';
|
||||
return '¥' + Number(val).toFixed(2);
|
||||
},
|
||||
resetAndLoad(){
|
||||
// 重新加载数据
|
||||
this.loadStatus = 'loadmore';
|
||||
this.pageNo = 1;
|
||||
this.flowList = [];
|
||||
this.fetchPayRecord();
|
||||
},
|
||||
loadMore() {
|
||||
|
||||
Reference in New Issue
Block a user