Commit d4404183 by wangshuo

返场

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