From 6c60202d9a824701b3c9167cf59ecb02b764f67c Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 13 Aug 2021 16:56:39 +0800 Subject: [PATCH] beginPath --- packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js b/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js index 8621c98..fb42855 100644 --- a/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js +++ b/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js @@ -314,15 +314,18 @@ Component({ this.toPlay(x, y); }, toPlay: function toPlay(x, y) { - var ctx = this.ctx; - ctx.beginPath(); - ctx.arc(0, 0, this.$lucky.maxBtnRadius, 0, Math.PI * 2, false); - if (!ctx.isPointInPath(x * this.dpr, y * this.dpr)) return; - // 隐藏图片并显示canvas - this.showCanvas = true; - this.setData({ luckyImg: '' }); - // 触发 lucky-canvas 的抽奖逻辑 - this.$lucky.startCallback(); + var th=this; + setTimeout(function () { + var ctx = th.ctx; + ctx.beginPath(); + ctx.arc(0, 0, th.$lucky.maxBtnRadius, 0, Math.PI * 2, false); + if (!ctx.isPointInPath(x * th.dpr, y * th.dpr)) return; + // 隐藏图片并显示canvas + th.showCanvas = true; + th.setData({ luckyImg: '' }); + // 触发 lucky-canvas 的抽奖逻辑 + th.$lucky.startCallback(); + },400) }, play: function play() { var _$lucky; -- libgit2 0.21.4