Commit 64ab5a81 by zhanghaozhe

Merge branch '00' into dev

parents 0f9cdcfa 6b78adcf
...@@ -118,7 +118,7 @@ class Landing extends Component { ...@@ -118,7 +118,7 @@ class Landing extends Component {
}) })
} }
joinSuccess = ({id, status, my_team: {team_num, lack_member, is_team}}) => { 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({
title: <div className={'join-success'}> title: <div className={'join-success'}>
...@@ -132,7 +132,7 @@ class Landing extends Component { ...@@ -132,7 +132,7 @@ class Landing extends Component {
status === 2 status === 2
? '组队成功,恭喜你获得一个宝箱!' ? '组队成功,恭喜你获得一个宝箱!'
: is_team : is_team
? `您的${<span>{team_num}</span>}号队伍还差${<span>{lack_member}</span>}人即可获得宝箱` ? <>您的{<span>{team_num}</span>}号队伍还差{<span>{lack_member}</span>}人即可获得宝箱</>
: '自己当队长,宝箱内有专属奖品哦~' : '自己当队长,宝箱内有专属奖品哦~'
} }
</div> </div>
...@@ -147,18 +147,22 @@ class Landing extends Component { ...@@ -147,18 +147,22 @@ class Landing extends Component {
/> />
: is_team : is_team
? <button type='button' ? <button type='button'
onClick={this.inviteMembers.bind(this, this.state.teamData['my_team']['treasure_code'])}>继续组队</button> onClick={this.inviteMembers.bind(this, treasure_code)}>继续组队</button>
: <button type="button" onClick={this.createMyTeam}>创建我的队伍</button> : <button type="button" onClick={this.createMyTeam}>创建我的队伍</button>
} }
</div>, </div>,
closeIcon: this.closeIcon, closeIcon: this.closeIcon,
close: () => { close: () => {
this.fetchPageData() this.fetchPageData()
this.getFollowStatus()
.then(isFollow => {
!isFollow && this.remind('join', getParam('treasure_code'))
})
} }
}) })
} }
inviteMembers = (treasure_code) => { inviteMembers = treasure_code => {
const {history, match, user, location} = this.props const {history, match, user, location} = this.props
if (browser.isWeixin) { if (browser.isWeixin) {
wxShare({ wxShare({
...@@ -171,19 +175,23 @@ class Landing extends Component { ...@@ -171,19 +175,23 @@ class Landing extends Component {
sessionStorage.setItem('showShareTip', '1') sessionStorage.setItem('showShareTip', '1')
history.replace(`${match.path}?treasure_code=${treasure_code}&origin=${1}`) history.replace(`${match.path}?treasure_code=${treasure_code}&origin=${1}`)
this.createTeamSuccessPopup && this.createTeamSuccessPopup.remove() && (this.createTeamSuccessPopup = null) this.createTeamSuccessPopup && this.createTeamSuccessPopup.remove() && (this.createTeamSuccessPopup = null)
this.joinSuccessPopup && this.joinSuccessPopup.remove() && (this.joinSuccessPopup = null)
this.fetchPageData({treasure_code, origin: 1}) this.fetchPageData({treasure_code, origin: 1})
this.setState({
isCaptain: true
})
} }
createTeamSuccess = (member, team_num, lack_member, treasure_code) => { getFollowStatus = () => http.get(`${API.home}/sys/user/isFollowWeChat`)
let isFollow = false
this.joinSuccessPopup && this.joinSuccessPopup.remove() && (this.joinSuccessPopup = null)
http.get(`${API.home}/sys/user/isFollowWeChat`)
.then(res => { .then(res => {
const {errno, status} = res.data const {code, data} = res.data
if (errno === 0 && status === 1) { return code === 200 && data['is_follow']
isFollow = true
}
}) })
createTeamSuccess = (member, team_num, lack_member, treasure_code) => {
this.joinSuccessPopup && this.joinSuccessPopup.remove() && (this.joinSuccessPopup = null)
this.getFollowStatus()
.then(isFollow => {
this.createTeamSuccessPopup = Popup({ this.createTeamSuccessPopup = Popup({
title: '创建成功', title: '创建成功',
className: 'landing-create-success', className: 'landing-create-success',
...@@ -218,6 +226,8 @@ class Landing extends Component { ...@@ -218,6 +226,8 @@ class Landing extends Component {
} }
} }
}) })
})
} }
remind = (type = 'create', treasure_code) => { remind = (type = 'create', treasure_code) => {
...@@ -239,7 +249,7 @@ class Landing extends Component { ...@@ -239,7 +249,7 @@ class Landing extends Component {
<div className="des">长按识别/扫码 关注【七月在线】服务号即可预约</div> <div className="des">长按识别/扫码 关注【七月在线】服务号即可预约</div>
</div>, </div>,
close: () => { close: () => {
history.replace(`${match.path}?treasure_code=${treasure_code}&origin=1`) // history.replace(`${match.path}?treasure_code=${treasure_code}&origin=1`)
this.fetchPageData({ this.fetchPageData({
treasure_code, treasure_code,
origin: '1' origin: '1'
...@@ -290,7 +300,10 @@ class Landing extends Component { ...@@ -290,7 +300,10 @@ class Landing extends Component {
closable: false, closable: false,
close: () => { close: () => {
sessionStorage.removeItem('showShareTip') sessionStorage.removeItem('showShareTip')
this.remind() this.getFollowStatus()
.then(isFollow => {
!isFollow && this.remind('create', getParam('treasure_code'))
})
} }
}) })
} }
...@@ -473,7 +486,7 @@ class Landing extends Component { ...@@ -473,7 +486,7 @@ class Landing extends Component {
</button> </button>
} }
{ {
prize_info && !activityEnd && !isCaptain && <div className="certainly-prompt"> prize_info && prize_info.length !== 0 && !activityEnd && !isCaptain && <div className="certainly-prompt">
{prize_info[0].stage_no}次必中 {prize_info[0].name} {prize_info[0].stage_no}次必中 {prize_info[0].name}
</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