...
|
...
|
@@ -12,7 +12,8 @@ import { |
|
|
Link
|
|
|
} from 'react-router-dom'
|
|
|
|
|
|
import BottomButtons from '../components/bottom-buttons';
|
|
|
import Resource from '../components/resource';
|
|
|
import BottomButton from '../components/bottom-button';
|
|
|
|
|
|
const {actId} = getQueryObj();
|
|
|
|
...
|
...
|
@@ -25,6 +26,7 @@ export default class wheelSurf extends PureComponent { |
|
|
pending: false, // 抽奖中
|
|
|
startEnd: false,
|
|
|
isEnding: false, // 即将停止
|
|
|
isLogin: false,
|
|
|
|
|
|
conf: {
|
|
|
loading: ''
|
...
|
...
|
@@ -35,22 +37,13 @@ export default class wheelSurf extends PureComponent { |
|
|
}
|
|
|
|
|
|
init = async () => {
|
|
|
let uid = cookie.load('app_uid') || getQueryObj().uid || 0;
|
|
|
if(!uid || !parseInt(uid)){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let result = await conf({
|
|
|
actId,
|
|
|
uid: uid,
|
|
|
sessionKey: cookie.load('app_session_key') || getQueryObj().session_key || '',
|
|
|
sessionType: cookie.load('app_client_type') || '',
|
|
|
appVersion: cookie.load('app_version') || ''
|
|
|
act_id: +actId
|
|
|
});
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
this.setState({
|
|
|
conf: result.data
|
|
|
conf: result.data.conf
|
|
|
})
|
|
|
}
|
|
|
};
|
...
|
...
|
@@ -80,32 +73,65 @@ export default class wheelSurf extends PureComponent { |
|
|
|
|
|
if (result.code === 200) {
|
|
|
this.setState({
|
|
|
conf: result.data
|
|
|
conf: result.data.conf
|
|
|
})
|
|
|
}
|
|
|
};
|
|
|
|
|
|
links = conf => {
|
|
|
let links = [];
|
|
|
|
|
|
if (conf.jump_btn_left_url) {
|
|
|
links.push({
|
|
|
url: conf.jump_btn_left_url,
|
|
|
bg: conf.jump_btn_left_bg
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (conf.jump_btn_middle_url) {
|
|
|
links.push({
|
|
|
url: conf.jump_btn_middle_url,
|
|
|
bg: conf.jump_btn_middle_bg
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (conf.jump_btn_right_url) {
|
|
|
links.push({
|
|
|
url: conf.jump_btn_right_url,
|
|
|
bg: conf.jump_btn_right_bg
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return links;
|
|
|
};
|
|
|
|
|
|
render() {
|
|
|
const {conf, isEnding} = this.state;
|
|
|
const {conf, isEnding, isLogin} = this.state;
|
|
|
|
|
|
if (!conf.id) {
|
|
|
return (
|
|
|
<div className="home-wrap">
|
|
|
<img className="main-bg" src={this.state.conf.loading + '?imageslim'}/>
|
|
|
<img className="main-bg" src={this.state.conf.loading}/>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
|
|
|
let links = this.links(conf);
|
|
|
|
|
|
return (
|
|
|
<div className="home-wrap">
|
|
|
<img className="main-bg" src={conf.main_bg + '?imageslim'}/>
|
|
|
{conf.rule_btn_bg ? (<Link to={`${config.routerPath}/rule.html`}><img className="rule-btn" src={conf.rule_btn_bg + '?imageslim'}/></Link>) : ''}
|
|
|
{conf.share_btn_bg ? (<img className="share-btn" src={conf.share_btn_bg + '?imageslim'}/>): ''}
|
|
|
<img className="wheel-bg" src={conf.wheel_bg + '?imageslim'}/>
|
|
|
<img className="main-bg" src={conf.main_bg}/>
|
|
|
{conf.rule_btn_bg ? (<Link to={`${config.routerPath}/rule.html`}><img className="rule-btn" src={conf.rule_btn_bg}/></Link>) : ''}
|
|
|
{conf.share_btn_bg ? (<img className="share-btn" src={conf.share_btn_bg}/>): ''}
|
|
|
<img className="wheel-bg" src={conf.wheel_bg}/>
|
|
|
<img className="wheel-bg-surf-layer" src={conf.wheel_bg}/>
|
|
|
<img onClick={()=>{this.start()}} className="start-btn-bg" src={conf.prize_btn_bg}/>
|
|
|
|
|
|
<BottomButton links={links}/>
|
|
|
<Resource code={conf.code || '11421760f4ea8b231c5b8269f4ff65bb'}/>
|
|
|
|
|
|
{isEnding ? (<img className="prize-hit-bg" src={conf.win_prize_bg}/>) : ''}
|
|
|
{isEnding ? (<img className="prize-hit-start-bg" src={conf.prize_btn_bg}/>) : ''}
|
|
|
<BottomButtons links={this.conf}/>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
...
|
...
|
|