作者 lihongjuan

1

... ... @@ -167,7 +167,7 @@
//计数器
var interval = null;
//值越大旋转时间越长 即旋转速度
var intime = 50;
var intime = 30;
export default {
data() {
return {
... ... @@ -212,7 +212,7 @@
],
btnconfirm: '../../static/dianjichoujiangd.png',
clickLuck: 'clickLuck',
luckPosition: 0,
luckPosition: 2,
giftshow:false,
text:''
}
... ... @@ -225,6 +225,31 @@
this.tab=e.currentTarget.dataset.id;
this.getdrawlist()
},
// 抽奖
chou(){
console.log('我是我是')
let that = this;
var url = 'gift/extract';
var params = {
extract_model_id:1
}
console.log(params)
app.post(url, params, "post").then((res) => {
console.log('我是我是我是我是我是我是我是我是',res);
that.color.forEach(function(value,index,array){
value.name=res.data.data.name;
that.luckPosition=index
})
console.log('好吧爸爸',that.luckPosition)
}).catch((err) => {
})
},
hidegift(){
this.giftshow=false
... ... @@ -269,10 +294,7 @@
value.chose=false
})
that.color=gift;
// that.goodinfo=res.data.data;
that.chou()
}).catch((err) => {
... ... @@ -386,7 +408,6 @@
} else {
//1秒后显示弹窗
setTimeout(function() {
if (which == 0) {
e.text= e.color[which].name
console.log( e.color[which].name)
e.giftshow=true;
... ... @@ -407,24 +428,28 @@
// fail: () => {},
// complete: () => {}
// });
} else {
//未中奖
uni.showModal({
content: '很遗憾未中奖',
showCancel: false,
confirmColor: "#F8C219",
success: res => {
if (res.confirm) {
//设置按钮可以点击
e.btnconfirm = '../../static/sherpa-jiugonggedianjichoujiang.png';
e.clickLuck = 'clickLuck';
e.loadAnimation();
}
},
fail: () => {},
complete: () => {}
});
}
// else {
// //未中奖
// uni.showModal({
// content: '很遗憾未中奖',
// showCancel: false,
// confirmColor: "#F8C219",
// success: res => {
// if (res.confirm) {
// //设置按钮可以点击
// e.btnconfirm = '../../static/sherpa-jiugonggedianjichoujiang.png';
// e.clickLuck = 'clickLuck';
// e.loadAnimation();
// }
// },
// fail: () => {},
// complete: () => {}
// });
// }
}, 1000);
}
}, time);
... ... @@ -450,7 +475,8 @@
uni.hideLoading()
this.loadAnimation();
console.log(333434)
this.getdrawlist()
this.getdrawlist();
}
}
</script>
... ...