Commit 283015f2 by FE

Merge branch '00' into pre

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