增加线上配置分享功能+用户后台登录,不影响首页渲染

This commit is contained in:
chenglijuan
2026-05-20 14:24:54 +08:00
parent dbfc8011c4
commit 643f37b06e
8 changed files with 153 additions and 157 deletions
+20 -12
View File
@@ -34,20 +34,15 @@ Page({
},
onLoad() {
if (app.globalData.isLoggedIn) {
this._awaitLoginAndInit()
},
async _awaitLoginAndInit() {
const userInfo = await app.waitLogin(true)
if (userInfo) {
this.initPage()
} else if (app.globalData.loginFailed) {
this.showLoginTipAndGoBack()
} else {
// 登录异步未完成,等待回调
app.loginReadyCallback = (userInfo) => {
app.loginReadyCallback = null
if (userInfo) {
this.initPage()
} else {
this.showLoginTipAndGoBack()
}
}
this.showLoginTipAndGoBack()
}
},
@@ -292,5 +287,18 @@ Page({
console.error('提交预约失败', err)
wx.showToast({ title: '提交失败,请重试', icon: 'none' })
}
},
onShareAppMessage(res) {
return {
title: '访客预约',
path: '/pages/index/index'
}
},
onShareTimeline() {
return {
title: '访客预约'
}
}
})