html52.com
我爱小程序-开发者交流社区

wx.canvasToTempFilePath真机不执行是什么原因?

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)
      )


网友回复

社区技术运营专员-小柿子:

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

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付