Commit 283015f2 by FE

Merge branch '00' into pre

parents bec3cef4 f60103b5
......@@ -116,6 +116,15 @@ class Landing extends Component {
})
}
handleToMyTreasure = () => {
this.joinSuccessPopup && this.joinSuccessPopup.remove()
if(getParam('version')) {
history.push(`/year/yearTreasure?id=${id}&version=${getParam('version')}`)
}else {
history.push(`/year/yearTreasure?id=${id}`)
}
}
joinSuccess = ({id, status, my_team: {team_num, lack_member, is_team, treasure_code}}) => {
const {history} = this.props
this.joinSuccessPopup = Popup({
......@@ -139,10 +148,7 @@ class Landing extends Component {
? <img style={{width: '150px', marginTop: '23px'}}
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/PC/treasure-box.png"
alt=""
onClick={() => {
this.joinSuccessPopup && this.joinSuccessPopup.remove()
history.push(`/year/yearTreasure?id=${id}`)
}}
onClick={this.handleToMyTreasure}
/>
: is_team
? <button type='button'
......
......@@ -40,17 +40,16 @@ class MyTreasure extends Component {
}
componentDidMount() {
const { isEnd } = this.state;
const { userInfo, history } = this.props;
if(!userInfo.uid) {
history.push('/passport');
}
if (isEnd) {
this.startCountDown();
}
this.fetchMyTreasure();
this.fetchActivityStatus();
}
componentWillReceiveProps(nextProp) {
const { history } = this.props;
const { userInfo } = nextProp;
if(!userInfo.uid) {
history.push('/passport');
}
}
// 页面加载时,初始化当前需要绑定手机号的奖品名字
......@@ -292,8 +291,10 @@ class MyTreasure extends Component {
http.get(`${API.home}/activity/stage`).then(res => {
const { code, data } = res.data;
if (code === 200) {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if(data.treasure_stage === 0) {
this.startCountDown();
}
this.setState({
isEnd: data.treasure_stage === 0
});
......@@ -328,7 +329,11 @@ class MyTreasure extends Component {
// 邀请好友
handleToInvite = (treasure_code) => {
const { history } = this.props;
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1`);
if(getParam('version')){
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1&version=${getParam('version')}`);
}else {
history.push(`/activity/newyear-2019/landing?treasure_code=${treasure_code}&origin=1`);
}
}
// 组队开宝箱
......@@ -549,12 +554,17 @@ class MyTreasure extends Component {
</Mask>
</div>
}
<div className="activity-rule__header">
<i className="activity-rule__decorate"></i>
<h2 className="activity-rule__title">活动规则</h2>
<i className="activity-rule__decorate"></i>
</div>
<div className="activity-rule__body" dangerouslySetInnerHTML={{__html: rule}}></div>
{
rule &&
<>
<div className="activity-rule__header">
<i className="activity-rule__decorate"></i>
<h2 className="activity-rule__title">活动规则</h2>
<i className="activity-rule__decorate"></i>
</div>
<div className="activity-rule__body" dangerouslySetInnerHTML={{__html: rule}}></div>
</>
}
</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