Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsalesProgram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4eae3da0
authored
Oct 12, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
福利中心
parent
9956ccc5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
2 deletions
pages/person/welfare/index.js
project.config.json
pages/person/welfare/index.js
View file @
4eae3da0
...
@@ -12,13 +12,22 @@ Page({
...
@@ -12,13 +12,22 @@ Page({
data
:
{
data
:
{
integralsList
:
{},
integralsList
:
{},
integral
:
''
,
integral
:
''
,
code
:
''
code
:
''
,
token
:
''
,
user_id
:
''
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
let
token
=
options
.
token
;
let
user_id
=
options
.
user_id
;
this
.
setData
({
token
:
token
,
user_id
:
user_id
});
},
},
...
@@ -82,7 +91,53 @@ Page({
...
@@ -82,7 +91,53 @@ Page({
* 获取数据
* 获取数据
*/
*/
getData
:
function
()
{
getData
:
function
()
{
//区分app拉起页面
if
(
this
.
data
.
token
)
{
wx
.
showNavigationBarLoading
();
wx
.
request
({
url
:
apis
.
integralsList
,
data
:
{
source
:
1
,
token
:
this
.
data
.
token
},
header
:
{
"Content-Type"
:
"applciation/json"
},
method
:
'GET'
,
success
:
(
res
)
=>
{
wx
.
hideNavigationBarLoading
();
if
(
res
.
data
.
errcode
===
0
)
{
//注入token
wx
.
setStorage
({
key
:
"access_token"
,
data
:
this
.
data
.
token
});
//注入用户id
wx
.
setStorage
({
key
:
"user_id"
,
data
:
this
.
data
.
user_id
});
this
.
setData
({
integralsList
:
res
.
data
.
data
,
integral
:
res
.
data
.
integral
,
code
:
res
.
data
.
code
});
}
else
{
wx
.
reLaunch
({
url
:
'/pages/person/auth/index'
,
});
}
},
fail
:
(
err
)
=>
{
}
})
}
else
{
http
.
getData
(
apis
.
integralsList
,
'GET'
,
null
,
(
res
)
=>
{
http
.
getData
(
apis
.
integralsList
,
'GET'
,
null
,
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
if
(
res
.
errcode
===
0
)
{
...
@@ -94,7 +149,7 @@ Page({
...
@@ -94,7 +149,7 @@ Page({
}
}
},
true
,
false
,
true
);
},
true
,
false
,
true
);
}
},
},
/**
/**
* 查看规则
* 查看规则
...
...
project.config.json
View file @
4eae3da0
...
@@ -347,6 +347,20 @@
...
@@ -347,6 +347,20 @@
"pathName"
:
"pages/person/helpfriend/index"
,
"pathName"
:
"pages/person/helpfriend/index"
,
"query"
:
"exchange_id=34"
,
"query"
:
"exchange_id=34"
,
"scene"
:
null
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/person/welfare/index"
,
"pathName"
:
"pages/person/welfare/index"
,
"query"
:
"token=21212"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"pages/person/welfare/index"
,
"pathName"
:
"pages/person/welfare/index"
,
"query"
:
"token= eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYXV0aGFwaS5pY3NhbGVzLmNvbS92MS9nZXR3eFVzZXJJbmZvIiwiaWF0IjoxNTcwODQzMDU0LCJleHAiOjE1NzA4NTM4NTQsIm5iZiI6MTU3MDg0MzA1NCwianRpIjoiWXMwdVRTalhnTVF6OWVRTSIsInN1YiI6MjAsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.ClJB0cBhwPar5LK_2TczezcX27n4enis4n_JtFS4wLc"
,
"scene"
:
null
}
}
]
]
}
}
...
...
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