feat: 添加最新预约加载骨架屏状态

This commit is contained in:
ws
2026-04-24 18:00:24 +08:00
parent c46ffcf567
commit bc665a5d82
4 changed files with 40 additions and 3 deletions
+5 -1
View File
@@ -6,7 +6,8 @@ Page({
data: {
isLoggedIn: false,
loginFailed: false,
latestRecord: null
latestRecord: null,
recordLoading: false
},
onLoad() {
@@ -53,6 +54,7 @@ Page({
},
async loadLatestRecord() {
this.setData({ recordLoading: true })
try {
const openid = app.globalData.userInfo.openid
const record = await appointmentDB.getLatest(openid)
@@ -64,6 +66,8 @@ Page({
} catch (err) {
console.error('加载最新预约失败', err)
this.setData({ latestRecord: null })
} finally {
this.setData({ recordLoading: false })
}
},