From 01dd997c73823c16c4680de358aeb84374445a86 Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 3 Feb 2023 17:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E6=B5=81=E9=98=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activeAnalysis/AppLuckyDraw/AppLuckyDraw.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/project/activeAnalysis/AppLuckyDraw/AppLuckyDraw.vue b/src/project/activeAnalysis/AppLuckyDraw/AppLuckyDraw.vue index 4d6aa8d2..a747468d 100644 --- a/src/project/activeAnalysis/AppLuckyDraw/AppLuckyDraw.vue +++ b/src/project/activeAnalysis/AppLuckyDraw/AppLuckyDraw.vue @@ -185,12 +185,7 @@ export default { methods: { ...mapActions(['injectJWeixin', 'wxInvoke', 'agentSign']), //封装动画旋转整数圈的方法,只需接受(角度,时间)即可开始旋转动画 - rotate(deg, duration) { - if (this.isStart) return; //防止用户多次点击动画 - this.isStart = true; //此时旋转开始,动画无法再次触发 - setTimeout(() => { - this.isStart = false; - }, duration) + rotate(deg) { this.animation.rotate(deg).step().rotate((this.awardNumber - 1) * -(360 / this.activeInfo.prizes.length)).step({ duration: 0, timingFunction: "linear", @@ -240,6 +235,9 @@ export default { if(!this.activeInfo.vaildPhone) { return this.showPhoneMask = true } + if (this.isStart) return + this.isStart = true + this.$http.post(`/app/appmarketingactivityinfo/raffle?activityId=${this.activityId}`).then((res) => { if (res.code == 0) { this.awardNumber = res.data @@ -248,6 +246,7 @@ export default { this.$u.toast(this.activeInfo.prizes[this.awardNumber-1].defaultPrize == 1 ? `很遗憾您抽中了${this.activeInfo.prizes[this.awardNumber-1].name}` : `恭喜抽中${this.activeInfo.prizes[this.awardNumber-1].name}!`) this.getDetail() this.getAwardedList() + this.isStart = false }, 2000)} }).catch((err) => { this.$u.toast(err)