收藏
回答

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


最后一次编辑于  11-29
回答关注问题邀请回答
收藏

1 个回答

问题标签