Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wxapp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
wxapp
Commits
b6337ef1
Commit
b6337ef1
authored
Jan 05, 2019
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动详情页,微信授权
parent
09e842df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
pages/detail/index.js
+22
-0
No files found.
pages/detail/index.js
View file @
b6337ef1
...
@@ -30,6 +30,8 @@ Page({
...
@@ -30,6 +30,8 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 检查用户是否登陆
this
.
checkUserLogin
()
if
(
options
.
id
)
{
if
(
options
.
id
)
{
this
.
setData
({
this
.
setData
({
id
:
options
.
id
id
:
options
.
id
...
@@ -38,6 +40,26 @@ Page({
...
@@ -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
()
{
onReady
:
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment