Browse Source

修改bug

huangxiaojing 2 years ago
parent
commit
06a04a50e6
1 changed files with 4 additions and 4 deletions
  1. 4 4
      pages/activity/lottery/index.vue

+ 4 - 4
pages/activity/lottery/index.vue

@@ -413,7 +413,7 @@ export default {
       }
       }
     },
     },
     // 开始抽奖
     // 开始抽奖
-    startRotation() {
+    async startRotation() {
       // 如果还不可以转动
       // 如果还不可以转动
       if (!this.canBeRotated()) {
       if (!this.canBeRotated()) {
         return false;
         return false;
@@ -422,11 +422,13 @@ export default {
       // 开始转动
       // 开始转动
       // 先上锁
       // 先上锁
       this.isLocking = true;
       this.isLocking = true;
-      this.getLuckDraw();
+      await this.getLuckDraw();
       // 成功后次数减少一次
       // 成功后次数减少一次
       if (this.num > 1) {
       if (this.num > 1) {
         this.num--;
         this.num--;
       }
       }
+      // 告诉子组件,开始转动了
+      this.$refs.roundTurntable.rotate(this.prizeIndex);
     },
     },
     async getLuckDraw() {
     async getLuckDraw() {
       // 设置在哪里停下,应该与后台交互,这里随机抽取0~5
       // 设置在哪里停下,应该与后台交互,这里随机抽取0~5
@@ -462,8 +464,6 @@ export default {
         this.phoneType = res.data.phoneType
         this.phoneType = res.data.phoneType
         this.title = res.data.title
         this.title = res.data.title
         this.prizeIndex = res.data.luckDrawType === 1 ? 5 : 2;
         this.prizeIndex = res.data.luckDrawType === 1 ? 5 : 2;
-        // 告诉子组件,开始转动了
-        this.$refs.roundTurntable.rotate(this.prizeIndex);
         if (this.num === 0) {
         if (this.num === 0) {
           this.showPay = true
           this.showPay = true
         }
         }