Commit d4404183 by wangshuo

返场

parent f41f4c8f
...@@ -48,7 +48,11 @@ class FormalDraw extends Component { ...@@ -48,7 +48,11 @@ class FormalDraw extends Component {
if (code == 200) { if (code == 200) {
const {today} = data.value const {today} = data.value
const oneDay = data.list.filter(item => item.date === data.value.today) const oneDay = data.list.filter(item => item.date === data.value.today)
const activeIndex = oneDay[0]['son'].findIndex(item => item.status == 3) let activeIndex = 0;
if(oneDay.length > 0) {
activeIndex = oneDay[0]['son'].findIndex(item => item.status == 3)
}
this.setState({ this.setState({
tabs: data.list.map(item => ({title: item.date})), tabs: data.list.map(item => ({title: item.date})),
today, today,
......
...@@ -144,10 +144,10 @@ class BlessingPreheat extends Component { ...@@ -144,10 +144,10 @@ class BlessingPreheat extends Component {
componentDidMount() { componentDidMount() {
const _this = this; const _this = this;
this.fetchUserBlessing() this.fetchUserBlessing()
setTimeout(function(){ // setTimeout(function(){
// 这里有获取ID的步骤,由于运营过多的调整,导致顺序不定,所以包含ID的title必须要放到判断中(防止出现多个title),设置定时器是因为如果返回较慢 获取不到ID导致报错 // // 这里有获取ID的步骤,由于运营过多的调整,导致顺序不定,所以包含ID的title必须要放到判断中(防止出现多个title),设置定时器是因为如果返回较慢 获取不到ID导致报错
_this.setInitialNavActiveStatus() // _this.setInitialNavActiveStatus()
}, 0); // }, 50);
window.addEventListener('scroll', throttle(this.calcNavActive, 100)) window.addEventListener('scroll', throttle(this.calcNavActive, 100))
if (is_weixin()) { if (is_weixin()) {
wxShare({ wxShare({
...@@ -313,7 +313,7 @@ class BlessingPreheat extends Component { ...@@ -313,7 +313,7 @@ class BlessingPreheat extends Component {
SendMessageToApp("toQualityCourse"); SendMessageToApp("toQualityCourse");
} }
} }
this.setState({ this.setState(()=>({
isSign: !!data.today_signed, isSign: !!data.today_signed,
isFormal: data.is_activity, isFormal: data.is_activity,
onlyShow: data.onlyShow, onlyShow: data.onlyShow,
...@@ -324,7 +324,8 @@ class BlessingPreheat extends Component { ...@@ -324,7 +324,8 @@ class BlessingPreheat extends Component {
buyBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.buy_course) ? data.types_total_blessing_value.buy_course : 0, buyBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.buy_course) ? data.types_total_blessing_value.buy_course : 0,
inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0, inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0,
}) })
}) }));
this.setInitialNavActiveStatus()
if (data.is_login === 1) { if (data.is_login === 1) {
this.handleToSign() this.handleToSign()
} }
...@@ -648,7 +649,7 @@ class BlessingPreheat extends Component { ...@@ -648,7 +649,7 @@ class BlessingPreheat extends Component {
<ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: onlyShow ? '30px 0 10px' : '60px 0 10px'}}/> <ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: onlyShow ? '30px 0 10px' : '60px 0 10px'}}/>
{ {
onlyShow ? ( onlyShow ? (
<p>活动已结束</p> <p className='active_over'>活动已结束</p>
) : null ) : null
} }
<div className="formal-draw-btns"> <div className="formal-draw-btns">
...@@ -664,7 +665,7 @@ class BlessingPreheat extends Component { ...@@ -664,7 +665,7 @@ class BlessingPreheat extends Component {
<ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '30px 0 15px'}}/> <ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '30px 0 15px'}}/>
{ {
onlyShow ? ( onlyShow ? (
<p>活动已结束</p> <p className='active_over'>活动已结束</p>
) : null ) : null
} }
<Link className="blessing__sort" to="/blessingRank"></Link> <Link className="blessing__sort" to="/blessingRank"></Link>
...@@ -742,7 +743,7 @@ class BlessingPreheat extends Component { ...@@ -742,7 +743,7 @@ class BlessingPreheat extends Component {
<ListHeader id={'ai-test'} text="全国AI工程师水平测试" styles={{margin: '30px 0 15px'}}/> <ListHeader id={'ai-test'} text="全国AI工程师水平测试" styles={{margin: '30px 0 15px'}}/>
{ {
onlyShow ? ( onlyShow ? (
<p>活动已结束</p> <p className='active_over'>活动已结束</p>
) : null ) : null
} }
<div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}> <div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}>
......
#blessing-preheat { #blessing-preheat {
background: #5327FA; background: #5327FA;
padding-bottom: 30px; padding-bottom: 30px;
.active_over {
font-size: 20px;
color: #fff604;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 10px;
}
} }
.test__record { .test__record {
......
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