huangxiaojing před 2 roky
rodič
revize
06a04a50e6
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  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()) {
         return false;
@@ -422,11 +422,13 @@ export default {
       // 开始转动
       // 先上锁
       this.isLocking = true;
-      this.getLuckDraw();
+      await this.getLuckDraw();
       // 成功后次数减少一次
       if (this.num > 1) {
         this.num--;
       }
+      // 告诉子组件,开始转动了
+      this.$refs.roundTurntable.rotate(this.prizeIndex);
     },
     async getLuckDraw() {
       // 设置在哪里停下,应该与后台交互,这里随机抽取0~5
@@ -462,8 +464,6 @@ export default {
         this.phoneType = res.data.phoneType
         this.title = res.data.title
         this.prizeIndex = res.data.luckDrawType === 1 ? 5 : 2;
-        // 告诉子组件,开始转动了
-        this.$refs.roundTurntable.rotate(this.prizeIndex);
         if (this.num === 0) {
           this.showPay = true
         }