Commit e98165f0 by wangshuo

活动结束返回首页

parents e41cb0ed 8e8c6e9a
...@@ -38,6 +38,7 @@ class Landing extends Component { ...@@ -38,6 +38,7 @@ class Landing extends Component {
} }
componentDidMount() { componentDidMount() {
this.getStage();
this.fetchPageData() this.fetchPageData()
window.showFollowAlert = this.remind.bind(this, 'create') window.showFollowAlert = this.remind.bind(this, 'create')
document.title = '七月在线年终大回馈,幸运宝箱随你开,100%有奖!' document.title = '七月在线年终大回馈,幸运宝箱随你开,100%有奖!'
...@@ -64,8 +65,23 @@ class Landing extends Component { ...@@ -64,8 +65,23 @@ class Landing extends Component {
this.shareTipPopup && this.shareTipPopup.remove() this.shareTipPopup && this.shareTipPopup.remove()
} }
createMeta = (title, dec, imgname) => { // 获取活动以及宝箱的阶段
let meta = document.createElement('meta') getStage = () => {
http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data
if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
} else {
Toast.info(msg, 2)
}
})
}
createMeta = (title,dec,imgname) => {
let meta = document.createElement('meta');
meta.setAttribute('name', 'description') meta.setAttribute('name', 'description')
meta.setAttribute('itemprop', 'description') meta.setAttribute('itemprop', 'description')
meta.setAttribute('content', dec) meta.setAttribute('content', dec)
......
...@@ -309,6 +309,10 @@ class MyTreasure extends Component { ...@@ -309,6 +309,10 @@ class MyTreasure extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if (data.treasure_stage === 0) { if (data.treasure_stage === 0) {
this.startCountDown() this.startCountDown()
......
...@@ -110,6 +110,10 @@ export default class index extends Component { ...@@ -110,6 +110,10 @@ export default class index extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data const {code, data, msg} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({ this.setState({
activity_stage: data.activity_stage, activity_stage: data.activity_stage,
......
...@@ -46,6 +46,11 @@ class YarnWish extends Component { ...@@ -46,6 +46,11 @@ class YarnWish extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
this.setState({ this.setState({
activityStage: data.activity_stage // 0-不在活动时间 1-预热 2-正式 3-返场 activityStage: data.activity_stage // 0-不在活动时间 1-预热 2-正式 3-返场
}) })
......
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