暂时提交
This commit is contained in:
@@ -47,9 +47,9 @@ export default {
|
||||
},
|
||||
async onShow() {
|
||||
try {
|
||||
await this.$checkToken(this.$getToken())
|
||||
this.checkOaAuth()
|
||||
this.fetchMessageList()
|
||||
// await this.$checkToken(this.$getToken())
|
||||
// this.checkOaAuth()
|
||||
// this.fetchMessageList()
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
@@ -96,32 +96,70 @@ export default {
|
||||
}
|
||||
},
|
||||
fetchMessageList(){
|
||||
// ✅ 正确判断加载状态
|
||||
if (this.loadStatus !== 'more') return;
|
||||
this.loadStatus = 'loading';
|
||||
|
||||
let url = '/message/queryPage'
|
||||
this.$u.post(url, {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize
|
||||
}, {
|
||||
WT: this.$getToken()
|
||||
}).then(res => {
|
||||
const rows = res.data.result || [];
|
||||
if (this.pageNo === 1) this.flowList = [];
|
||||
this.flowList = this.flowList.concat(rows);
|
||||
|
||||
// ✅ 判断是否还有更多
|
||||
if (rows.length < this.pageSize) {
|
||||
this.loadStatus = 'nomore';
|
||||
} else {
|
||||
this.pageNo++;
|
||||
this.loadStatus = 'more';
|
||||
|
||||
// TODO: 接口联调时取消注释,删除 mock 数据
|
||||
// let url = '/message/queryPage'
|
||||
// this.$u.post(url, {
|
||||
// pageNo: this.pageNo,
|
||||
// pageSize: this.pageSize
|
||||
// }, {
|
||||
// WT: this.$getToken()
|
||||
// }).then(res => {
|
||||
// const rows = res.data.result || [];
|
||||
// if (this.pageNo === 1) this.flowList = [];
|
||||
// this.flowList = this.flowList.concat(rows);
|
||||
// if (rows.length < this.pageSize) {
|
||||
// this.loadStatus = 'nomore';
|
||||
// } else {
|
||||
// this.pageNo++;
|
||||
// this.loadStatus = 'more';
|
||||
// }
|
||||
// }).catch(err => {
|
||||
// console.log("获取消息列表失败:", err)
|
||||
// this.loadStatus = 'more';
|
||||
// })
|
||||
|
||||
// Mock 静态数据
|
||||
const mockData = [
|
||||
{
|
||||
id: '1',
|
||||
icon: '/static/icon/msg-1.png',
|
||||
title: '账单提醒',
|
||||
desc: '您有一笔租金待支付,请及时处理',
|
||||
time: '2026-06-27 10:30',
|
||||
read: false
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
icon: '/static/icon/msg-2.png',
|
||||
title: '合同签署',
|
||||
desc: '您的租赁合同已生成,请尽快签署',
|
||||
time: '2026-06-26 14:20',
|
||||
read: false
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
icon: '/static/icon/msg-1.png',
|
||||
title: '缴费成功',
|
||||
desc: '您已成功缴纳5月份租金2500元',
|
||||
time: '2026-06-25 09:15',
|
||||
read: true
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
icon: '/static/icon/msg-2.png',
|
||||
title: '预约确认',
|
||||
desc: '您预约的看房申请已确认,管家将联系您',
|
||||
time: '2026-06-24 16:45',
|
||||
read: true
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log("获取消息列表失败:", err)
|
||||
this.loadStatus = 'more'; // ✅ 异常恢复
|
||||
})
|
||||
];
|
||||
|
||||
if (this.pageNo === 1) this.flowList = [];
|
||||
this.flowList = this.flowList.concat(mockData);
|
||||
this.loadStatus = 'nomore';
|
||||
},
|
||||
loadMore() {
|
||||
this.fetchMessageList()
|
||||
|
||||
Reference in New Issue
Block a user