-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
callback 回调不准确 #18
Comments
@likaixuan 贴一下代码吧~ |
我在安卓机上也遇到,也是只能在callback里面用setTimeout来进行下一步操作 |
暂时只能加延时了 return new Promise((resolve, reject) => {
drawQrcode({
width: 200,
height: 200,
canvasId: 'qrcode',
text: url,
_this: this,
callback: () => {
// 安卓机上不准确,生成的二维码无法扫描,加延时解决
setTimeout(() => {
wx.canvasToTempFilePath({
canvasId: 'qrcode',
success: res => {
resolve(res)
}
}, this)
}, 500)
}
})
}) |
Closed
在红米7机型上使用延迟,还是没有没办法获取完整。目前还只是在红米七,不知道其它的机型怎么样,我自己的红米note5没问题- - |
@sai2333 加大延迟呢 |
iOS 放在callback里面反而获取不到临时路径了,无语了 |
` const imgPath = new Promise((resolve, reject) => {
}` |
canvasToFilePath还有第二个参数,加上this.$scope即可 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
我需要通过 wx.canvasToTempFilePath 获取画布的临时路径、但它必须是draw 绘制完成之后才能获取 我无法通过callback来完成这个操作(在安卓机型上它比draw要快)、目前只能通过callback加定时器延时来解决
The text was updated successfully, but these errors were encountered: