wx.canvasToTempFilePath真机不执行是什么原因?
发布于 7 年前 作者 junxie 11417 次浏览 来自 官方Issues

context.draw()第一个参数为true的时候,回调里面 wx.canvasToTempFilePath真机不执行;但是在模拟器中一切正常。并且配置了服务器域名

context.draw(true, () =>
        setTimeout(() =>
          wx.canvasToTempFilePath({
            canvasId: 'canvas',
            x: 0,
            y: 0,
            width: canvasw,
            height: canvash,
            fileType: 'png',
            success: function (res) {             
              var tempFilePath = res.tempFilePath;
              _this.setData({
                src: tempFilePath,
                modalVisible: false
              })
              wx.hideToast()
              _this.triggerEvent('callBackUrl', { code: 'success', url: tempFilePath})
            },
          }, _this)
        , 100)
      )


1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部