关于painter 画出海报保存不了,不报错也没进入回调,有大佬么?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:19 896 0 全屏看文

AI助手支持GPT4.0

关于painter 画出海报保存不了,不报错也没进入回调,有大佬么?

已经生成海报但是不能保存,

//保存的  onImgOK(e) {    console.log(e)    this.imagePath = e.detail.path;    console.log(e.detail.path)    this.setData({      image: this.imagePath    })    if (this.isSave) {      this.saveImage(this.imagePath);    }  },  saveImage(imagePath = '') {    console.log(111, '刚进来',)    console.log(imagePath)    console.log(222, '判断条件', this.isSave)    if (!this.isSave) {      this.isSave = true;      console.log(333, this.data.template)      this.setData({        paintPallette: this.data.template,      });    } else if (imagePath) {      console.log(imagePath)      this.isSave = false;      wx.saveImageToPhotosAlbum({        filePath: imagePath,      });    }  },



    <painter     customStyle='margin-left: 80rpx;height: 1000rpx;'    customActionStyle="{{customActionStyle}}"    dancePalette="{{template}}"    palette="{{paintPallette}}"    bind:imgOK="onImgOK"     bind:touchEnd="touchEnd"     action="{{action}}"     />


 saveImgToLocal() {      console.log(444444)      const that = this;      setTimeout(() => {        console.log('that.canvasWidthInPx', that.canvasWidthInPx)        console.log('that.canvasHeightInPx', that.canvasHeightInPx)        wx.canvasToTempFilePath({          canvasId: 'photo',          destWidth: that.canvasWidthInPx,          destHeight: that.canvasHeightInPx,          success: function (res) {            that.getImageInfo(res.tempFilePath);            console.log('6666-请求成功', res)          },          fail: function (error) {            console.log('77777-请求失败', error)            console.error(`canvasToTempFilePath failed, ${JSON.stringify(error)}`);            that.triggerEvent('imgErr', {              error: error            });          },        }, this);      }, 300);    },

It's been born, but it can't be saved. console.log E) this.imagePath =e.g. detail.path Vertical Scroll Arrow Length console.log (e.g. detail.path ) setData ({ strictly → image: this.imagePath If ( This.isSave ){ No } } } } + + + + + + + + + + + + + + + + + + + + + + + + This.saveImage ( this.imagePath ) console.log (111, 'Just arrived', console.log (image path) console.log 222, Decision Condition. This.isSave ) If (! This.isSave ){ No } } } } + + + + + + + + + + + + + + + + + + + + + + + + This.isSave = true; t console.log (333, Templates ) setData ({ strictly → paint palette: Templates < image > console.log (image path) This.isSave = false; t wx.saveImageToPhotosAlbum ({ → → filePath: imagePath,* → → }); * * * ::saveImgToLocal() {} :: console.log (444444) == this;* * - setTimeout(() => { strict & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & console.log (' that.canvasWidthInPx ' that.canvasWidthInPx ) console.log (' canvasHeightInPx ' canvasHeightInPx ) wx.canvasToTempFilePath ({ strictly } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } that.canvasWidthInPx & Height: canvasHeightInPx ,* [UNK] Band that.getImageInfo ( res.tempFilePath ) console.log ( 6666-request for success, res)}, * * * * * * fail: function (error) { * * * * * * * console.log ('77777-request failed', error & & & ; There is no active layer or channel to copy from.console.error (`canvasToTempFilePath failed, ${ JSON.stringify (error)}`*; I'm sorry. that.triggerEvent ('imgErr', { ± ± ± }, this); ± ± ± }, 300); ± ± },

回答:

阴阳屯科技:

都没有发起权限

hreat:

成功回调没有执行,失败的也没有,结束回调也没有进入

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
哪位大佬可以指点一下,为什么我的积木修改text文本的内容不管用呢?
企业微信自建应用无法获取suite_ticket
企业微信被禁止登陆,没有任何违规行为,但说却被投诉刷单,无法登陆企业微信,要多久才可以解封?
今天企业微信群活码扫描后打不开什么情况?
请问下,青蛙Pro小程序里面的这个背屏导航栏和背屏桌面图标 如何自行编辑样式、名称、图片、链接地址?
随便看看
小程序发布后的默认首页问题? 507
开通会员卡后,onShow中数据重复问题 407
在webview内嵌的h5页面能唤起原生button按钮对应的getPhoneNumber弹窗吗? 398
从其它页面返回时 image 图片消失 396
企业微信扫码登录,移动端提示登录成功,pc端一直没有跳转页面 759
小程序无法跳转h5页面,部分机型可以,部分不行,开发者工具可以 525
微信小程序版本更新问题? 398
关于文件上传wx.uploadFile的用法? 953
如何获取连点之间的角度问题? 319
又开始封链接了 为啥?管理员看看吧 ? 347