Commit 08a9975e by zhanghaozhe

Merge branch '2020-717-formal' into dev

parents ba82555e 2deb35ad
...@@ -30,6 +30,7 @@ class Anniversary2020 extends Component { ...@@ -30,6 +30,7 @@ class Anniversary2020 extends Component {
4.每人只能当1次队员哦 4.每人只能当1次队员哦
` `
drawTimer = null drawTimer = null
hasMore = true
state = { state = {
//静态数据 //静态数据
...@@ -113,9 +114,6 @@ class Anniversary2020 extends Component { ...@@ -113,9 +114,6 @@ class Anniversary2020 extends Component {
this.getBulletScreenData() this.getBulletScreenData()
this.getRankList() this.getRankList()
this.getStageCourses('zero') this.getStageCourses('zero')
if (!this.props.user.hasError) {
this.getPrizeRecords()
}
if (this.store.session.get('toInvitation') && !this.props.user.hasError) { if (this.store.session.get('toInvitation') && !this.props.user.hasError) {
this.getFollowStaus() this.getFollowStaus()
this.store.session.remove('toInvitation') this.store.session.remove('toInvitation')
...@@ -250,9 +248,9 @@ class Anniversary2020 extends Component { ...@@ -250,9 +248,9 @@ class Anniversary2020 extends Component {
} }
getPrizeRecords = (() => { getPrizeRecords = (() => {
let hasMore = true, isFetching = false let isFetching = false
return () => { return () => {
if (isFetching || !hasMore) { if (isFetching || !this.hasMore) {
return return
} }
isFetching = true isFetching = true
...@@ -261,7 +259,7 @@ class Anniversary2020 extends Component { ...@@ -261,7 +259,7 @@ class Anniversary2020 extends Component {
const {code, msg, data} = res.data const {code, msg, data} = res.data
if (code === 200) { if (code === 200) {
if (isEmpty(data)) { if (isEmpty(data)) {
hasMore = false this.hasMore = false
} }
const _records = Array.isArray(data) ? data : [] const _records = Array.isArray(data) ? data : []
this.setState(state => { this.setState(state => {
...@@ -422,10 +420,8 @@ class Anniversary2020 extends Component { ...@@ -422,10 +420,8 @@ class Anniversary2020 extends Component {
} }
draw = debounce((i) => { draw = debounce((i) => {
if (i !== 4) { const {activityData, prizeData, isDrawing} = this.state
return if (i !== 4 || isDrawing || prizeData.odd_times === 0 || activityData.stage === 4) {
}
if (this.state.isDrawing) {
return return
} }
this.startDraw() this.startDraw()
...@@ -451,6 +447,8 @@ class Anniversary2020 extends Component { ...@@ -451,6 +447,8 @@ class Anniversary2020 extends Component {
} else { } else {
Toast.info(msg) Toast.info(msg)
} }
}).catch(e => {
Toast.fail('操作频繁,请稍后再试')
}) })
} }
...@@ -498,11 +496,7 @@ class Anniversary2020 extends Component { ...@@ -498,11 +496,7 @@ class Anniversary2020 extends Component {
isGotoLogin = () => { isGotoLogin = () => {
const {user, history} = this.props const {user, history} = this.props
if (user.hasError) { if (user.hasError) {
if (browser.isWeixin) {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(window.location.href + "?aa=bb") + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
} else {
history.push('/passport') history.push('/passport')
}
return true return true
} }
return false return false
...@@ -726,6 +720,7 @@ class Anniversary2020 extends Component { ...@@ -726,6 +720,7 @@ class Anniversary2020 extends Component {
return return
} }
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
this.getPrizeRecords()
this.setState({ this.setState({
isShowPrizesRecords: true, isShowPrizesRecords: true,
}, () => { }, () => {
...@@ -785,8 +780,13 @@ class Anniversary2020 extends Component { ...@@ -785,8 +780,13 @@ class Anniversary2020 extends Component {
<div className="invite"> <div className="invite">
{ {
activityData.stage === 1 ? <button className={'invite'}>715日开始</button> : activityData.stage === 1 ? <button className={'invite'}>715日开始</button> :
<Link to={'/anniversary_2020/invitation'} onClick={() => { <Link to={'/anniversary_2020/invitation'} onClick={(e) => {
if (user.hasError) {
e.preventDefault()
history.push('/passport')
} else {
this.store.session.set('toInvitation', '1') this.store.session.set('toInvitation', '1')
}
}}> }}>
<button className={'invite'}>邀请好友加入队伍</button> <button className={'invite'}>邀请好友加入队伍</button>
</Link> </Link>
...@@ -815,7 +815,12 @@ class Anniversary2020 extends Component { ...@@ -815,7 +815,12 @@ class Anniversary2020 extends Component {
: <> : <>
{ {
activityData.practice_num activityData.practice_num
? <Link to={'/anniversary_2020/question/1'}> ? <Link to={'/anniversary_2020/question/1'} onClick={(e) => {
if (user.hasError) {
e.preventDefault()
history.push('/passport')
}
}}>
<div className="btn"> <div className="btn">
<button><i></i>开始练习</button> <button><i></i>开始练习</button>
</div> </div>
...@@ -824,7 +829,9 @@ class Anniversary2020 extends Component { ...@@ -824,7 +829,9 @@ class Anniversary2020 extends Component {
<button><i></i>开始练习</button> <button><i></i>开始练习</button>
</div> </div>
} }
< div className="chance">今日剩余<span>{activityData.practice_num}</span>次</div> {
!user.hasError && <div className="chance">今日剩余<span>{activityData.practice_num}</span>次</div>
}
</> </>
} }
</div> </div>
...@@ -1106,8 +1113,10 @@ class Anniversary2020 extends Component { ...@@ -1106,8 +1113,10 @@ class Anniversary2020 extends Component {
<i className={'iconfont iconiconfront-2 close'} onClick={() => { <i className={'iconfont iconiconfront-2 close'} onClick={() => {
this.records.removeEventListener('scroll', this.handleRecordsScroll) this.records.removeEventListener('scroll', this.handleRecordsScroll)
document.body.style.overflow = 'auto' document.body.style.overflow = 'auto'
this.hasMore = true
this.setState({ this.setState({
isShowPrizesRecords: false, isShowPrizesRecords: false,
prizeRecordsPagination: 0
}); });
}}></i> }}></i>
</div> </div>
...@@ -1157,7 +1166,7 @@ function WinPrize({name, close, info}) { ...@@ -1157,7 +1166,7 @@ function WinPrize({name, close, info}) {
<div className="modal win-prize"> <div className="modal win-prize">
<div className="title">恭喜您</div> <div className="title">恭喜您</div>
<div className="des">抽中了XXX<span className={'name'}>{name}</span></div> <div className="des">抽中了XXX<span className={'name'}>{name}</span></div>
<div className="contact">{info}</div> <div className="contact">{/*{info}*/}请添加客服微信号:********请添加客服微信号:</div>
<button onClick={close}>我知道了</button> <button onClick={close}>我知道了</button>
</div> </div>
</div> </div>
......
...@@ -863,6 +863,10 @@ ...@@ -863,6 +863,10 @@
} }
} }
a{
text-decoration: underline;
}
td:nth-of-type(1) { td:nth-of-type(1) {
font-size: 16px; font-size: 16px;
...@@ -1055,12 +1059,10 @@ ...@@ -1055,12 +1059,10 @@
.contact { .contact {
width: 250px; width: 250px;
height: 40px; padding: 12px 10px;
margin-bottom: 40px; margin-bottom: 40px;
line-height: 40px;
border: 1px solid rgba(221, 221, 221, 1); border: 1px solid rgba(221, 221, 221, 1);
color: #271BD3; color: #271BD3;
text-align: center;
} }
button { button {
......
...@@ -25,16 +25,6 @@ class Question extends Component { ...@@ -25,16 +25,6 @@ class Question extends Component {
} }
componentDidMount() { componentDidMount() {
const {history, user} = this.props
if (user.hasError) {
if (browser.isWeixin) {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(url + "&aa=bb").toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
} else {
history.push('/passport')
}
return
}
if (this.props.cache.recommends.length === 0) { if (this.props.cache.recommends.length === 0) {
this.getQuestion() this.getQuestion()
} }
......
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