feat: 添加最新预约加载骨架屏状态
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user