Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
2eaa7d13
Commit
2eaa7d13
authored
Sep 12, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报错
parent
c82e10b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
app.js
src/app.js
+1
-1
personCenter.js
src/component/personCenter/personCenter.js
+8
-11
No files found.
src/app.js
View file @
2eaa7d13
...
...
@@ -40,7 +40,7 @@ App({
onShow
:
function
(
options
=
{})
{
console
.
log
(
'app-onshow'
,
options
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
{
registerTime
=
''
}
=
baseUserInfo
.
member
const
registerTime
=
baseUserInfo
&&
baseUserInfo
.
member
&&
baseUserInfo
.
member
.
registerTime
||
''
// ios 兼容 是不是plus vip
let
currentEndTime
=
(
new
Date
(
registerTime
.
replace
(
/-/g
,
'/'
))).
getTime
();
// 过期时间
...
...
src/component/personCenter/personCenter.js
View file @
2eaa7d13
...
...
@@ -5,7 +5,7 @@ const envInfo = require('../../config/index').envInfo
Component
({
properties
:
{
currentHasUserInfo
:{
currentHasUserInfo
:
{
type
:
Boolean
,
type
:
false
},
...
...
@@ -54,34 +54,31 @@ Component({
_token
:
''
,
currentMobile
:
''
,
baseImgUrl
:
''
,
storgeUserInfo
:
wx
.
getStorageSync
(
'_baseUserInfo'
),
storgeUserInfo
:
wx
.
getStorageSync
(
'_baseUserInfo'
),
isPlusVip
:
false
,
currentPlusStyle
:
null
},
observers
:
{
'**'
:
function
(
e
)
{
'**'
:
function
(
e
)
{
// 每次 setData 都触发
},
},
attached
()
{
const
{
isPlusVip
,
imageUrl
}
=
app
.
globalData
const
{
personData
}
=
this
.
data
this
.
setData
({
personCenter
:
personData
,
baseImgUrl
:
imageUrl
,
isPlusVip
,
currentPlusStyle
:
isPlusVip
?
personData
.
plus
.
filter
(
item
=>
item
.
purchased
==
1
)[
0
]
:
personData
.
plus
.
filter
(
item
=>
item
.
purchased
==
0
)[
1
]
},()
=>
{
console
.
log
(
'aaaaaaaaaa'
,
this
.
data
.
currentPlusStyle
)
currentPlusStyle
:
isPlusVip
?
personData
.
plus
.
filter
(
item
=>
item
.
purchased
==
1
)[
0
]
:
personData
.
plus
.
filter
(
item
=>
item
.
purchased
==
0
)[
0
]
})
},
methods
:
{
_getUserInfo
(
res
=
{})
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'getAuth'
,
res
);
})
},
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'getAuth'
,
res
);
})
},
_userInfoChange
(
newVal
,
oldVal
)
{
if
(
newVal
!==
oldVal
)
{
this
.
setData
({
...
...
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