Commit 9e9cc8e2 authored by leiqingsong's avatar leiqingsong

修复优惠券创建的优惠券id提示隐藏

parent fc538223
...@@ -239,7 +239,7 @@ export default { ...@@ -239,7 +239,7 @@ export default {
}; };
}, },
async created() { async created() {
console.log('部署好了'); console.log("部署好了");
this.currentUrl = location.href; this.currentUrl = location.href;
this.active_id = this.$route.query.id; this.active_id = this.$route.query.id;
this.active_type = this.$route.query.active_type; this.active_type = this.$route.query.active_type;
...@@ -403,6 +403,7 @@ export default { ...@@ -403,6 +403,7 @@ export default {
init() { init() {
this.basecircle = this.prizeListOrigin.length; this.basecircle = this.prizeListOrigin.length;
this.selected = 1;
this.running = false; this.running = false;
this.isBeginPrize = false; this.isBeginPrize = false;
...@@ -411,24 +412,21 @@ export default { ...@@ -411,24 +412,21 @@ export default {
this.speed = 300; this.speed = 300;
}, },
// 开始抽奖 // 开始抽奖
async mouseDown_Start(e) { mouseDown_Start(e) {
let canvas = document.getElementById("bg"); let canvas = document.getElementById("bg");
let local = this.getPointOnCanvas(canvas, e.pageX, e.pageY); let local = this.getPointOnCanvas(canvas, e.pageX, e.pageY);
if (local.x > 100 && local.x < 300 && local.y > 100 && local.y < 300) { if (local.x > 100 && local.x < 300 && local.y > 100 && local.y < 300) {
// 点击开始 // 点击开始
// 开始前 必要检测 // 开始前 必要检测
if(!this.before_Start()) { if (!this.before_Start()) {
// 检测未通过 // 检测未通过
return false; return false;
} }
if (this.running) { if (this.running) {
this.$toast("游戏进行中,请勿多次点击!"); this.$toast("游戏进行中,请勿多次点击!");
return false; } else {
this.game_result();
} }
await this.game_result();
this.init();
// 转起来
this.wheel_timer = setInterval(this.rotate, this.speed);
} }
}, },
// 游戏开始前的检测 // 游戏开始前的检测
...@@ -465,7 +463,7 @@ export default { ...@@ -465,7 +463,7 @@ export default {
return check_res; return check_res;
}, },
// 游戏后台结果 // 游戏后台结果
async game_result() { game_result() {
let params = { let params = {
activityId: this.active_id, activityId: this.active_id,
openId: this.userBaseInfo.openid, openId: this.userBaseInfo.openid,
...@@ -473,10 +471,13 @@ export default { ...@@ -473,10 +471,13 @@ export default {
unionId: this.userBaseInfo.unionid, unionId: this.userBaseInfo.unionid,
userName: this.userBaseInfo.name userName: this.userBaseInfo.name
}; };
let res = await APi_Active.play(params); this.init();
if (!res.data.prizeId) { APi_Active.play(params)
.then(res => {
if (res.errorCode == "500") {
this.$toast('errcode: 500, 获取数据异常。');
} else if (!res.data.prizeId) {
this.$toast(res.data.message); this.$toast(res.data.message);
return false;
} else { } else {
// 在奖项列表中找到抽奖结果奖项的下标 // 在奖项列表中找到抽奖结果奖项的下标
let id = this.prizeListOrigin let id = this.prizeListOrigin
...@@ -487,9 +488,17 @@ export default { ...@@ -487,9 +488,17 @@ export default {
// 中奖后 设置中奖奖品信息 // 中奖后 设置中奖奖品信息
if (this.isAward) { if (this.isAward) {
this.awardGood = this.prizeListOrigin[id]; this.awardGood = this.prizeListOrigin[id];
this.awardGood.coupon = JSON.parse(this.prizeListOrigin[id].coupon); this.awardGood.coupon = JSON.parse(
this.prizeListOrigin[id].coupon
);
} }
// 转起来
this.wheel_timer = setInterval(this.rotate, this.speed);
} }
})
.catch(error => {
});
}, },
// 开始旋转 // 开始旋转
rotate() { rotate() {
...@@ -515,7 +524,6 @@ export default { ...@@ -515,7 +524,6 @@ export default {
} }
if (this.isBeginPrize && this.selected > 0) { if (this.isBeginPrize && this.selected > 0) {
// 开始抽奖
if (--this.selected == 0) { if (--this.selected == 0) {
//到了选择的奖项之后 //到了选择的奖项之后
this.clearTimer(); this.clearTimer();
...@@ -589,7 +597,9 @@ export default { ...@@ -589,7 +597,9 @@ export default {
this.awardGood.coupon ? this.awardGood.coupon.id : this.couponDetail.id this.awardGood.coupon ? this.awardGood.coupon.id : this.couponDetail.id
); );
let params = { let params = {
couponId: this.awardGood.coupon ? this.awardGood.coupon.id : this.couponDetail.id, couponId: this.awardGood.coupon
? this.awardGood.coupon.id
: this.couponDetail.id,
unionId: this.userBaseInfo.unionid, unionId: this.userBaseInfo.unionid,
vipId: this.userBaseInfo.vipId vipId: this.userBaseInfo.vipId
}; };
......
...@@ -131,9 +131,10 @@ ...@@ -131,9 +131,10 @@
<van-cell title="使用说明" style="font-size:14px;"> <van-cell title="使用说明" style="font-size:14px;">
<template slot="default"> <template slot="default">
<van-field <van-field
class="right"
type="textarea"
v-model="addForm.instruction" v-model="addForm.instruction"
placeholder="请输入使用说明" placeholder="请输入使用说明"
class="right"
style="font-size:14px;" style="font-size:14px;"
/> />
</template> </template>
...@@ -156,7 +157,7 @@ ...@@ -156,7 +157,7 @@
/> />
</div> </div>
</template> </template>
</van-cell> --> </van-cell>-->
<van-cell title="总限制次数" style="font-size:14px;" class="js"> <van-cell title="总限制次数" style="font-size:14px;" class="js">
<van-stepper <van-stepper
v-model="addForm.limitOfUse" v-model="addForm.limitOfUse"
...@@ -168,6 +169,7 @@ ...@@ -168,6 +169,7 @@
<van-cell title="总限制提示" style="font-size:14px;"> <van-cell title="总限制提示" style="font-size:14px;">
<template slot="default"> <template slot="default">
<van-field <van-field
type="textarea"
v-model="addForm.remind" v-model="addForm.remind"
placeholder="请输入总限制提示" placeholder="请输入总限制提示"
class="right" class="right"
...@@ -349,10 +351,10 @@ export default { ...@@ -349,10 +351,10 @@ export default {
this.$toast("请输入结束时间"); this.$toast("请输入结束时间");
return false; return false;
} }
if (!this.addForm.couponIds) { // if (!this.addForm.couponIds) {
this.$toast("请输入优惠券ID"); // this.$toast("请输入优惠券ID");
return false; // return false;
} // }
if (!this.addForm.limitOfUse) { if (!this.addForm.limitOfUse) {
this.$toast("请输入总限制次数"); this.$toast("请输入总限制次数");
......
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