Authored by 李奇

修改

... ... @@ -2,7 +2,6 @@ import React, {PureComponent} from 'react';
import './index.scss'
import {conf, start} from '../../api'
import yaSDK from 'yoho-activity-sdk';
import config from '../../../../config';
import cookie from 'react-cookies';
import LazyLoad from 'react-lazy-load'
import queryString from '../../../../common/query-stringify'
... ... @@ -20,7 +19,7 @@ export default class wheelSurf extends PureComponent {
super(props);
this.state = {
uid: 0,
expIdx: 1,
epPrize: {},
query: {},
canStart: true, // 可以抽奖
slowEnding: false, // 减速结束
... ... @@ -114,7 +113,7 @@ export default class wheelSurf extends PureComponent {
this.setState({
conf: result.data.conf,
expIdx: result.data.prize_idx,
epPrize: result.data.emptyPrize,
totalParts: result.data.prize,
remainCount: result.data.residueCount,
dayLeftTimesTip: result.data.conf.btm_tip_one,
... ... @@ -172,20 +171,31 @@ export default class wheelSurf extends PureComponent {
remainCount: this.state.remainCount - 1
});
let result = await start({
let result;
try {
result = await start({
act_id: +this.state.query.actId,
uid: cookie.load('uid'),
sessionKey: cookie.load('app_session_key'),
sessionType: cookie.load('app_client_type'),
appVersion: cookie.load('app_version')
});
if (result.code !== 200) {
});
if (result.code !== 200) {
result = {
data: {
prize_idx: this.state.expIdx
prize_idx: this.state.epPrize.prize_idx,
desc: '对不起,您没有中奖'
}
}
}
} catch (e) {
result = {
data: {
prize_idx: this.state.epPrize.prize_idx,
desc: '对不起,您没有中奖'
}
}
}
let timer = setTimeout(() => {
... ... @@ -197,7 +207,7 @@ export default class wheelSurf extends PureComponent {
});
this.state.angle = this.state.stopAngle;
this.stop(this.state.stopAngle);
}, 4000);
}, 3000);
};
calcStopAngle = idx => {
... ...
... ... @@ -31,7 +31,7 @@
top: 0;
left: 0;
width: 100%;
animation: showHitBg 2s 1;
animation: showHitBg 4s 1;
}
.close-prize-hit-bg {
... ...