Commit d877e94e by wangshuo

Merge branch '00' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 00

parents 3f63d5f9 954011c4
...@@ -28,13 +28,20 @@ class Landing extends Component { ...@@ -28,13 +28,20 @@ class Landing extends Component {
treasure_code: getParam('treasure_code'), treasure_code: getParam('treasure_code'),
activityEnd: false, activityEnd: false,
notices: [], notices: [],
rule: '' rule: '',
isCaptain: sessionStorage.getItem('status')
} }
componentDidMount() { componentDidMount() {
this.fetchPageData() this.fetchPageData()
} }
componentDidUpdate(prevProps) {
if(prevProps.user.hasError !== this.props.user.hasError && !this.props.user.hasError){
this.fetchPageData()
}
}
fetchPageData = ({origin = this.state.origin, treasure_code = this.state.treasure_code} = {}) => { fetchPageData = ({origin = this.state.origin, treasure_code = this.state.treasure_code} = {}) => {
http.post(`${API.home}/sys/treasure/team`, { http.post(`${API.home}/sys/treasure/team`, {
...@@ -51,6 +58,7 @@ class Landing extends Component { ...@@ -51,6 +58,7 @@ class Landing extends Component {
let searchParams = new URLSearchParams(window.location.search) let searchParams = new URLSearchParams(window.location.search)
if (searchParams.get('origin') === '1' && !browser.isWeixin) { if (searchParams.get('origin') === '1' && !browser.isWeixin) {
sessionStorage.setItem('isCaptain', '1')
searchParams.set('origin', '2') searchParams.set('origin', '2')
window.history.replaceState(null, '', `landing?${searchParams.toString()}`) window.history.replaceState(null, '', `landing?${searchParams.toString()}`)
} }
...@@ -157,7 +165,7 @@ class Landing extends Component { ...@@ -157,7 +165,7 @@ class Landing extends Component {
wxShare({ wxShare({
title: `@${user.data.username} 邀您一起组队拿豪礼!`, title: `@${user.data.username} 邀您一起组队拿豪礼!`,
desc: `加我我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`, desc: `加我我的队伍,机械键盘,纸质书籍等超多奖品等你拿!`,
link: encodeURIComponent(`${window.location.origin}/${location.pathname}?treasure_code=${treasure_code}&origin=2`), link: `${window.location.origin}/${location.pathname}?treasure_code=${treasure_code}&origin=2`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newIndex/community/tou5_bj.png' imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newIndex/community/tou5_bj.png'
}) })
} }
...@@ -334,7 +342,8 @@ class Landing extends Component { ...@@ -334,7 +342,8 @@ class Landing extends Component {
prize_info, prize_info,
my_team my_team
}, },
activityEnd activityEnd,
isCaptain
} = this.state } = this.state
/* /*
...@@ -355,9 +364,10 @@ class Landing extends Component { ...@@ -355,9 +364,10 @@ class Landing extends Component {
<img className='main-avatar' <img className='main-avatar'
src={head_img} alt=""/> src={head_img} alt=""/>
{ {
status === 1 && <div className="des">邀请好友加入队伍,开宝箱领取丰厚奖品~</div> status === 1
? <div className="des">邀请好友加入队伍,开宝箱领取丰厚奖品~</div>
: <div className="des">加入我的<span>{team_num}</span>号队伍,一起开宝箱领取丰厚奖品~</div>
} }
<div className="des">加入我的<span>{team_num}</span>号队伍,一起开宝箱领取丰厚奖品~</div>
<Prizes showSystemNotices={false}/> <Prizes showSystemNotices={false}/>
<BulletScreen/> <BulletScreen/>
<div className="group"> <div className="group">
...@@ -465,7 +475,7 @@ class Landing extends Component { ...@@ -465,7 +475,7 @@ class Landing extends Component {
</button> </button>
} }
{ {
prize_info && !activityEnd && <div className="certainly-prompt"> !isCaptain && prize_info && !activityEnd && <div className="certainly-prompt">
{prize_info.stage_no}次必中 {prize_info.name} {prize_info.stage_no}次必中 {prize_info.name}
</div> </div>
} }
...@@ -481,7 +491,9 @@ class Landing extends Component { ...@@ -481,7 +491,9 @@ class Landing extends Component {
</div> </div>
</BoxContainer> </BoxContainer>
<WhiteSpace size={'xl'}/> <WhiteSpace size={'xl'}/>
<YearCourse></YearCourse> {
isCaptain && <YearCourse/>
}
</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