Commit 9e9cc8e2 authored by leiqingsong's avatar leiqingsong

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

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