Commit b6337ef1 by LiuJunYi

活动详情页,微信授权

parent 09e842df
......@@ -30,6 +30,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// 检查用户是否登陆
this.checkUserLogin()
if (options.id) {
this.setData({
id: options.id
......@@ -38,6 +40,26 @@ Page({
},
/**
* 用户资料授权
*/
checkUserLogin: function (callback) {
if (app.globalData.userInfo == null) {
api.me.info().then(res => {
if (res.code == 0) {
app.globalData.userInfo = res.data
} else {
setTimeout(() => {
wx.navigateTo({
url: '/pages/auth/index',
})
}, 800)
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment