修改物业费数据展示不全的问题

This commit is contained in:
赵毅 2025-12-02 09:27:49 +08:00
parent ca7806578b
commit 730eac05b7
2 changed files with 80 additions and 8 deletions

View File

@ -1,5 +1,6 @@
page {
background-color: #f6f7fb;
padding-bottom: 0rpx;
}
.header {
@ -145,3 +146,11 @@ page {
color: #999999;
margin-top: 10rpx;
}
/* 加载更多提示样式 */
.load-more {
padding: 30rpx 0;
text-align: center;
font-size: 28rpx;
color: #999999;
}

View File

@ -54,6 +54,11 @@
<view v-else>
<view class="no-record">暂无变动记录</view>
</view>
<!-- 加载更多提示 -->
<view v-if="records.length > 0" class="load-more">
<text v-if="loading">加载中...</text>
<text v-else-if="!hasMore">没有更多数据了</text>
</view>
</view>
</view>
</view>
@ -74,6 +79,8 @@ export default {
itemType: '',
page_num: 1,
page_size: 10,
loading: false,
hasMore: true
}
},
onLoad(options) {
@ -84,7 +91,27 @@ export default {
this.photoVal = options.type == 1 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//user_wallet1.png' : (options.type == 2 ? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//user_wallet2.png' : 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com//user_wallet3.png');
this.itemObj = JSON.parse(options.item);
this.itemType = options.type;
this.balance = options.type == 1 ? this.itemObj.points : (options.type == 2 ? this.itemObj.property_housing_fund : 0)
this.balance = options.type == 1 ? this.itemObj.points : (options.type == 2 ? this.itemObj.property_housing_fund : 0);
this.page_num = 1;
this.records = [];
this.hasMore = true;
this.getWalletInfo();
},
//
onPullDownRefresh() {
this.page_num = 1;
this.records = [];
this.hasMore = true;
this.getWalletInfo().then(() => {
uni.stopPullDownRefresh();
});
},
//
onReachBottom() {
if (this.loading || !this.hasMore) return;
this.page_num++;
this.getWalletInfo();
},
methods: {
@ -95,18 +122,54 @@ export default {
},
//
getWalletInfo() {
if (this.loading) return Promise.resolve();
this.loading = true;
const params = {
page_num: this.page_num,
page_size: this.page_size,
}
const requestPromise = new Promise((resolve, reject) => {
if (this.itemType == 1) {
request(apiArr.getPoints, 'POST', params, { silent: false }).then(res => {
this.records = res.rows;
this.handleResponse(res);
resolve();
}).catch(err => {
reject(err);
})
} else if (this.itemType == 2) {
request(apiArr.getAccumulationFund, 'POST', params, { silent: false }).then(res => {
this.records = res.rows;
this.handleResponse(res);
resolve();
}).catch(err => {
reject(err);
})
} else {
resolve();
}
});
requestPromise.finally(() => {
this.loading = false;
});
return requestPromise;
},
//
handleResponse(res) {
if (res && res.rows) {
if (this.page_num === 1) {
//
this.records = res.rows;
} else {
//
this.records = [...this.records, ...res.rows];
}
//
this.hasMore = res.rows.length >= this.page_size;
}
}
}