Commit b91f6919 by wangshuo

Merge branch '11-11-formal' into dev

parents a2761e81 f18b9d30
#main-banner{
overflow: auto;
margin-bottom: 70px;
.banner{
width: 375px;
height: 183px;
......
......@@ -77,13 +77,21 @@ class FormalDraw extends Component {
draw = id => {
let {surplus, is_prize, hot_value} = this.state.userValue
if(hot_value<50){
if (hot_value < 50) {
Toast.info('你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧', 2, null, false)
} else if(is_prize == 1){
Toast.info('你已参与当前时段抽奖', 2, null, false)
} else if(surplus<1){
} else if (is_prize == 1) {
Toast.info('你已参与当前时段抽奖', 2, () => {
this.requestDraw(id)
}, false)
} else if (surplus < 1) {
Toast.info('你的抽奖次数已用光,快去积攒福气值可获得更多抽奖机会', 2, null, false)
} else {
this.requestDraw(id)
}
}
requestDraw = id => {
let {surplus} = this.state.userValue
http.post(`${API.home}/sys/activity/prize`, {
id
}).then(res => {
......@@ -111,7 +119,7 @@ class FormalDraw extends Component {
)
})
this.setState({
userValue: {...this.state.userValue, ...{surplus: --surplus}}
userValue: {...this.state.userValue, ...{surplus: --surplus}, ...{is_prize: 1}}
})
})
} else {
......@@ -119,7 +127,6 @@ class FormalDraw extends Component {
}
})
}
}
lotteryFunc = (status, id) => {
const {hasError} = this.props.user
......@@ -184,7 +191,16 @@ class FormalDraw extends Component {
{
list.map((listItem, index) => {
return (
<div className="content" key={index}>
<div className={`content ${today === userValue.today ? 'current':''}`} key={index}>
{
(isLogin && (today === userValue.today))
?
<div className="prize_number_con">
当日剩余抽奖次数:
<span className={'prize__number'}>{userValue.surplus}</span>
</div>
: ""
}
<div className="title">
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-left.png"
alt=""/>
......@@ -199,6 +215,7 @@ class FormalDraw extends Component {
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-right.png"
alt=""/>
</div>
{
isLogin ?
<div className="progress-bar">
......@@ -224,14 +241,14 @@ class FormalDraw extends Component {
statusContent = (
<>
<span>已结束</span>
<Link to={`/prize-winner-list?tid=${item.id}`}>查看中奖记录</Link>
<Link to={`/prize-winner-list?tid=${item.id}`}>查看中奖名单</Link>
</>
)
break
case 3:
statusContent = (
<>
<div>参与抽奖</div>
<div>立即抽奖</div>
<div>{item.num}人正在参与</div>
</>
)
......
......@@ -85,6 +85,7 @@
.content {
position: relative;
.title {
display: flex;
justify-content: center;
......@@ -126,6 +127,26 @@
}
}
.prize_number_con {
width:280px;
height:30px;
background:rgba(255,255,255,1);
border-radius:15px;
font-size:14px;
font-weight:400;
color:rgba(83,39,250,1);
text-align: center;
text-align-last: center;
line-height: 30px;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 18px;
}
}
.current {
padding-top: 50px;
}
.progress-bar {
......
......@@ -245,9 +245,7 @@ class BlessingPreheat extends Component {
if (code === 200) {
this.setState({
isSign: !!data.today_signed,
// isFormal: data.is_activity,
//todo 去掉假数据
isFormal: 1,
isFormal: data.is_activity,
testSum: parseInt(data.user_test_total, 10) || 0,
userInfo: Object.assign({}, userInfo, {
isFollow: data.subscribed,
......@@ -540,8 +538,23 @@ class BlessingPreheat extends Component {
toSection={this.toSection}
index={index}
/>
{/* 抽奖--正式 */}
{
isFormal === 1 &&
<>
<ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: '30px 0 10px'}}/>
<div className="formal-draw-btns">
<button className="luck-draw__button" onClick={() => this.handleToShow('isRule')}>活动规则></button>
<button className='prize-record' onClick={this.getMyPrizeRecord}>中奖记录></button>
</div>
<FormalDraw toLogin={this.toLogin}/>
</>
}
{/* 积福气 */}
<ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '60px 0 15px'}}/>
<ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '30px 0 15px'}}/>
<Link className="luck-draw__button" to="/blessingRank">福气排行榜></Link>
......@@ -558,11 +571,10 @@ class BlessingPreheat extends Component {
/>
{/* 幸运大抽奖--预热 */}
<ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: '30px 0 10px'}}/>
{
isFormal === 0 &&
<>
<ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: '30px 0 10px'}}/>
<p className="luck-draw__tip">- 将于111110点开启 -</p>
<button className="luck-draw__button" onClick={() => this.handleToShow('isRule')}>活动规则></button>
<LuckDraw/>
......@@ -570,20 +582,6 @@ class BlessingPreheat extends Component {
}
{/* 抽奖--正式 */}
{
isFormal === 1 &&
<>
<div className="formal-draw-btns">
<button className="luck-draw__button" onClick={() => this.handleToShow('isRule')}>活动规则></button>
<button className='prize-record' onClick={this.getMyPrizeRecord}>中奖记录></button>
</div>
<FormalDraw toLogin={this.toLogin}/>
</>
}
{/*定金--只在预热期间显示*/}
{
isFormal === 0 &&
......
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