Authored by 李奇

修改

... ... @@ -19,6 +19,7 @@ export default class wheelSurf extends PureComponent {
super(props);
this.state = {
uid: 0,
expIdx: 1,
query: {},
canStart: true, // 可以抽奖
slowEnding: false, // 减速结束
... ... @@ -107,6 +108,7 @@ export default class wheelSurf extends PureComponent {
if (result.code === 200) {
this.setState({
conf: result.data.conf,
expIdx: result.data.prize_idx,
totalParts: result.data.prize,
remainCount: result.data.residueCount,
dayLeftTimesTip: result.data.conf.btm_tip_one,
... ... @@ -148,7 +150,11 @@ export default class wheelSurf extends PureComponent {
});
if (result.code !== 200) {
console.log(result.message);
result = {
data: {
prize_idx: this.state.expIdx
}
}
}
let timer = setTimeout(() => {
... ... @@ -201,7 +207,7 @@ export default class wheelSurf extends PureComponent {
};
stop = angle => {
let rotateDeg = angle + 360 * 2;
let rotateDeg = angle + 360 * 5;
let randCssName = 'stop_' + (new Date()).getTime();
let randCssContent = '{' +
'transform: rotateZ(' + rotateDeg + 'deg) !important;' +
... ...
... ... @@ -3,6 +3,7 @@ import './index.scss'
import {prize} from '../../api';
import yaSDK from 'yoho-activity-sdk';
import config from '../../config';
import wx from 'weixin-js-sdk';
import TipModal from '../components/tip-modal';
import moment from 'moment';
... ... @@ -32,6 +33,11 @@ export default class Prize extends PureComponent {
if (yaSDK.env !== 'miniprogram') {
yaSDK.link(event);
} else {
wx.miniProgram.navigateTo({url: {
2: '/page/subPackage/pages/allowance/allowance',
3: '/page/subPackage/pages/couponList/couponList'
}[type]});
}
};
... ... @@ -65,7 +71,7 @@ export default class Prize extends PureComponent {
let couponLink = 'https://m.yohobuy.com/home/coupons?openby:yohobuy={"action":"go.coupon"}';
let redEnvelopeLink = 'https://activity.yoho.cn/feature/3221.html?title=我的红包&openby:yohobuy={"action":"go.mineredpackage"}';
this.state.prizes.map(prize => {
prize.createTime = moment(new Date(prize.createTime).getTime()).format('YYYY-MM-DD HH:mm');
});
... ...