Commit 209b9b69 by dazhou

新人福利弹框上架

parent cf725939
......@@ -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>
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment