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
209b9b69
Commit
209b9b69
authored
Jul 08, 2021
by
dazhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新人福利弹框上架
parent
cf725939
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
src/components/Index/index.js
+29
-29
No files found.
src/components/Index/index.js
View file @
209b9b69
...
...
@@ -16,7 +16,7 @@ import TeacherList from "./tercher"
import
Teaching
from
"./teaching"
//tan框
//
import { UserGift } from "src/common"
import
{
UserGift
}
from
"src/common"
// const animateTypes = Swiper.animateTypes
...
...
@@ -65,7 +65,7 @@ class Index extends Component {
}
componentWillMount
()
{
//
this.showUserGiftFun()
this
.
showUserGiftFun
()
}
userStatus
=
()
=>
{
...
...
@@ -77,7 +77,7 @@ class Index extends Component {
this
.
setState
({
isShowUserGift
:
false
,
})
//
Toast.info("新人大礼包已领取成功!", 2)
Toast
.
info
(
"新人大礼包已领取成功!"
,
2
)
}
else
{
this
.
setState
({
isShowUserGift
:
false
,
...
...
@@ -87,31 +87,31 @@ class Index extends Component {
})
}
//
showUserGiftFun = () => {
//
let newer_last_time = localStorage.getItem("newer_last_time") // 获取用户关闭大礼包的时间
//
let now_time = new Date().valueOf()
//
if (!newer_last_time || now_time - newer_last_time > 86400000) {
//
this.setState({
//
isShowUserGift: true,
//
})
//
} else {
//
this.setState({
//
isShowUserGift: false,
//
})
//
}
//
}
//
close = () => {
//
this.setState({
//
isShowUserGift: false,
//
})
//
let now_time = new Date().valueOf() // 获取当前时间
//
localStorage.setItem("newer_last_time", now_time) // 存储关闭时间
//
}
showUserGiftFun
=
()
=>
{
let
newer_last_time
=
localStorage
.
getItem
(
"newer_last_time"
)
// 获取用户关闭大礼包的时间
let
now_time
=
new
Date
().
valueOf
()
if
(
!
newer_last_time
||
now_time
-
newer_last_time
>
86400000
)
{
this
.
setState
({
isShowUserGift
:
true
,
})
}
else
{
this
.
setState
({
isShowUserGift
:
false
,
})
}
}
close
=
()
=>
{
this
.
setState
({
isShowUserGift
:
false
,
})
let
now_time
=
new
Date
().
valueOf
()
// 获取当前时间
localStorage
.
setItem
(
"newer_last_time"
,
now_time
)
// 存储关闭时间
}
//
get_newerModal = () => {
//
this.close()
//
this.props.history.push("/passport/login")
//
}
get_newerModal
=
()
=>
{
this
.
close
()
this
.
props
.
history
.
push
(
"/passport/login"
)
}
// 首页课程
getIndexData
=
()
=>
{
...
...
@@ -257,9 +257,9 @@ class Index extends Component {
/
>
)}
{
/* {
this.state.isShowUserGift && (
{
this
.
state
.
isShowUserGift
&&
(
<
UserGift
close
=
{
this
.
close
}
get_newerModal
=
{
this
.
get_newerModal
}
/
>
)}
*/
}
)}
<
/div
>
)
}
...
...
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