增加线上配置分享功能+用户后台登录,不影响首页渲染
This commit is contained in:
@@ -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: '访客预约'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user