需求变更进行调整

This commit is contained in:
2026-01-30 09:01:38 +08:00
parent 44a4b33502
commit 79a21ff0a5
30 changed files with 1482 additions and 1707 deletions

View File

@@ -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() {