Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
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
baiguangyao
mr-julyedu
Commits
880ef959
Commit
880ef959
authored
Nov 02, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新popup通用组件
parent
89ff55f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
94 deletions
+13
-94
src/components/blessingPreheat/index.js
+13
-94
No files found.
src/components/blessingPreheat/index.js
View file @
880ef959
...
...
@@ -85,58 +85,6 @@ class BlessingPreheat extends Component {
isApp
:
false
}
}
constructor
(
props
)
{
super
(
props
)
this
.
navTop
=
183
this
.
prevY
=
0
this
.
state
=
{
userInfoList
:
[],
// userInfoList: [{
// token:'fcfef221e60ab7a2-92a80d5d30196999',
// uid:'545292',
// uname:'xzhtest2',
// avatar_file:''
// }],
isRule
:
false
,
isCourse
:
false
,
inviteVisible
:
false
,
joinLotteryVisible
:
false
,
timelineShareVisible
:
false
,
showRecordList
:
false
,
isFormal
:
false
,
// 1正式 0 预热
shareMark
:
false
,
userInfo
:
{},
isSign
:
false
,
navs
:
[
{
text
:
'积福气'
,
id
:
'lucky-value'
},
{
text
:
'幸运大抽奖'
,
id
:
'lucky-draw'
},
{
text
:
'预付定金'
,
id
:
'deposit'
},
{
text
:
'精品特惠'
,
id
:
'best-courses'
},
{
text
:
'AI测试'
,
id
:
'ai-test'
},
{
text
:
'大咖直播'
,
id
:
'live'
},
],
index
:
0
,
userHasError
:
props
.
user
.
hasError
}
}
componentDidMount
()
{
this
.
fetchUserBlessing
()
...
...
@@ -165,35 +113,33 @@ class BlessingPreheat extends Component {
}
}
// 获取app登录数据
// 获取app登录数据
loginInfo
=
(
result
)
=>
{
this
.
setState
({
userInfoList
:
result
},
()
=>
{
if
(
this
.
state
.
userInfoList
.
length
)
{
if
(
this
.
state
.
userInfoList
.
length
)
{
this
.
props
.
startFetchUser
()
this
.
appLogin
()
}
})
}
// 保存cookie
// 保存cookie
appLogin
=
()
=>
{
let
expires
=
addDays
(
new
Date
(),
90
)
this
.
state
.
userInfoList
.
map
((
item
,
index
)
=>
{
Toast
.
info
(
item
.
uid
)
cookie
.
set
(
"token"
,
item
.
token
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
});
cookie
.
set
(
"plat"
,
item
.
plat
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
});
cookie
.
set
(
"uid"
,
item
.
uid
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
});
cookie
.
set
(
"uname"
,
item
.
uname
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
});
cookie
.
set
(
"avatar_file"
,
item
.
avatar_file
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
});
});
cookie
.
set
(
"token"
,
item
.
token
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"plat"
,
item
.
plat
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"uid"
,
item
.
uid
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"uname"
,
item
.
uname
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
cookie
.
set
(
"avatar_file"
,
item
.
avatar_file
,
{
expires
,
path
:
'/'
,
domain
:
'.julyedu.com'
})
})
if
(
cookie
.
get
(
"token"
)
&&
cookie
.
get
(
"uid"
))
{
this
.
fetchUserBlessing
();
this
.
fetchUserBlessing
()
this
.
setState
({
isApp
:
true
})
...
...
@@ -267,8 +213,8 @@ class BlessingPreheat extends Component {
return
findIndex
(
navs
,
item
=>
item
.
id
===
str
)
}
fetchUserBlessing
()
{
const
{
userInfo
}
=
this
.
state
;
fetchUserBlessing
=
()
=>
{
const
{
userInfo
}
=
this
.
state
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
alert
(
code
)
...
...
@@ -342,7 +288,7 @@ class BlessingPreheat extends Component {
}
}
// 邀请好友注册
// 邀请好友注册
handleToShowInvite
=
()
=>
{
const
isLogin
=
!
this
.
props
.
user
.
hasError
if
(
isLogin
)
{
...
...
@@ -480,38 +426,12 @@ class BlessingPreheat extends Component {
userInfo
,
isRule
,
isCourse
,
inviteUrl
,
inviteVisible
,
isFormal
,
isServer
,
serverUrl
,
isSign
,
showRecordList
,
shareMark
,
index
,
isApp
}
=
this
.
state
;
const
{
history
}
=
this
.
props
;
const
isLogin
=
!
this
.
props
.
user
.
hasError
return
(
<
div
id
=
{
'blessing-preheat'
}
>
<
Banner
isFormal
=
{
isFormal
}
navs
=
{
navs
}
toSection
=
{
this
.
toSection
}
index
=
{
index
}
/
>
render
()
{
const
{
navs
,
userInfo
,
isRule
,
isCourse
,
isFormal
,
isSign
,
showRecordList
,
shareMark
,
index
}
=
this
.
state
const
{
history
}
=
this
.
props
const
isLogin
=
!
this
.
props
.
user
.
hasError
...
...
@@ -523,7 +443,6 @@ class BlessingPreheat extends Component {
toSection
=
{
this
.
toSection
}
index
=
{
index
}
/
>
{
/* 积福气 */
}
<
ListHeader
id
=
{
'lucky-value'
}
text
=
"积福气,享受更多福利"
styles
=
{{
margin
:
'60px 0 15px'
}}
/
>
<
Link
className
=
"luck-draw__button"
to
=
"/blessingRank"
>
福气排行榜
><
/Link
>
...
...
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