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
1972d9a3
Commit
1972d9a3
authored
Nov 06, 2020
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新人福利弹框下架
parent
5fbcbc13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
build/precache-manifest.28c3e8bd2b8eb6d14403a6baf15f0f29.js
+0
-0
src/components/Index/index.js
+30
-29
No files found.
build/precache-manifest.28c3e8bd2b8eb6d14403a6baf15f0f29.js
0 → 100644
View file @
1972d9a3
This diff is collapsed.
Click to expand it.
src/components/Index/index.js
View file @
1972d9a3
...
...
@@ -13,7 +13,8 @@ import { connect } from "react-redux"
import
TopSwiper
from
"./TopSwiper"
// import ExpandActiveToast from './expandActiveToast'
import
AllCourseNavigation
from
"./all-course"
import
{
UserGift
}
from
"src/common"
//tan框
// import { UserGift } from "src/common"
// const animateTypes = Swiper.animateTypes
...
...
@@ -67,7 +68,7 @@ class Index extends Component {
}
componentWillMount
()
{
this
.
showUserGiftFun
()
//
this.showUserGiftFun()
}
userStatus
=
()
=>
{
...
...
@@ -79,7 +80,7 @@ class Index extends Component {
this
.
setState
({
isShowUserGift
:
false
,
})
Toast
.
info
(
"新人大礼包已领取成功!"
,
2
)
//
Toast.info("新人大礼包已领取成功!", 2)
}
else
{
this
.
setState
({
isShowUserGift
:
false
,
...
...
@@ -89,31 +90,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
=
()
=>
{
...
...
@@ -250,9 +251,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