kiccer / wx-canvas-2d

微信小程序 canvas-2d 绘图工具🖌️🧑‍🎨 | 支持按需加载🍃,支持内容配置🧩,支持功能扩展🔥 | 适配各种机型📱,超轻量☁️,超易用⚪,无需学习📚️,直接上手🚀
https://kiccer.github.io/wx-canvas-2d/
MIT License
86 stars 10 forks source link

真机环境下 draw 方法会出现异常 #10

Closed fqdltd closed 3 years ago

fqdltd commented 3 years ago

setTimeout(function() { var _this = this; canvas.draw({ series: _series }).then(() => { uni.showModal({ title: '授权提示', content: "是否将图片保存到手机相册", success: (res) => { if (res.confirm) { com.showLoading();

                                // 保存到相册
                                canvas.save({
                                    destWidth: _this.screenWidth,
                                    destHeight: _this.backImageHeight
                                }).then(res => {
                                    com.hideLoading();
                                    uni.showToast({
                                        title: "保存成功",
                                        icon: "none"
                                    });
                                }).catch(err=>{
                                    com.hideLoading();
                                    uni.showToast({
                                        title: "保存失败1",
                                        icon: "none"
                                    });
                                })
                            } else {
                                com.hideLoading();
                                uni.showToast({
                                    title: "保存失败",
                                    icon: "none"
                                });
                            }
                        }
                    });
                }).catch(err => {
                    com.hideLoading();
                    //console.log('绘制失败!', err)
                    uni.showToast({
                        title: "保存失败" + err,
                        icon: "none"
                    });
                });
            }, 500)
fqdltd commented 3 years ago

errMsg为 getImageInfo:fail download image fail. reason:downloadFile:fail url not in domain