收藏
回答

canvasToTempFilePath 在ios走fail?

wx.canvasToTempFilePath 方法 在ios走fail , 上午还是好好的,下午就不行了,

返回错误信息 canvasToTempFilePath:fail invalid viewId

回答关注问题邀请回答
收藏

3 个回答

  • 小程序技术专员-binnie
    小程序技术专员-binnie
    2019-09-23

    现在ios 7.0.7 升级一下看看会不会

    2019-09-23
    有用 1
    回复 1
    • 
      2019-09-24
      已经解决了,是我手机的问题,重启一下就好了
      2019-09-24
      回复
  • 灵芝
    灵芝
    2019-09-16

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

    2019-09-16
    有用
    回复 5
    • 
      2019-09-16

      https://developers.weixin.qq.com/s/qfyIRqmW7Ybm

      微信版本:7.0.5

      测试机型:iphone8  12.2版本

      2019-09-16
      回复
    • 
      2019-09-16

      真机有问题 模拟器没问题 目前ios有问题

      2019-09-16
      回复
    • 灵芝
      灵芝
      2019-09-16回复
      怎么操作复现反馈的问题?这边用iPhone XR测试没有复现
      2019-09-16
      回复
    • 
      2019-09-16回复灵芝

      就是点击上传 就会出现上传失败(走了fail) 在iphone8下 很大概率都会出现 也是刚刚才出现的问题 之前是没有的

      2019-09-16
      回复
    • 
      2019-09-16
      {errMsg: "canvasToTempFilePath:fail invalid viewId"}

      会出现这个错误信息

      2019-09-16
      回复
  • 睡前原谅一切
    睡前原谅一切
    2019-09-16

    咋写的。生成的 图 是否都通过 getImageInfo拿到本地地址了。不行试试插件?:https://developers.weixin.qq.com/community/develop/article/doc/000ac686c5c5506f18b87ee825b013


    2019-09-16
    有用
    回复 8
    • 
      2019-09-16
      ctx.draw(false, setTimeout(()=>{
      setTimeout(()=>{
      wx.canvasToTempFilePath({
      canvasId: 'photo_canvas',
             fileType: 'jpg',
             width:canvasWidth,
             height:canvasHeight,
             quality: 0.4,
             success: function (resCanvas) {
      ctx.clearRect(0,0,canvasWidth,canvasHeight)
      let fileSystemManager = wx.getFileSystemManager();
                 fileSystemManager.readFile({
      filePath: resCanvas.tempFilePath,
                   encoding: "base64",
                   success: function (resBase64) {
      let base64 = resBase64.data;
                     let newBase64 = encodeText(base64);
                     fileList = fileList.concat(newBase64)
      }
      })
      },
             fail: function (error) {
      console.log('fail',error)
      wx.showToast({
      title: '抱歉,服务器开小差了~',
                   icon: 'none',
                   duration: 2000
                 })
      },
             complete: function (com) {
      }
      })
      },200)
      },200)
      )


      2019-09-16
      回复
    • 
      2019-09-16

      一直走fail

      2019-09-16
      回复
    • 
      2019-09-16

      之前是没问题的  现在偶尔可以成功

      2019-09-16
      回复
    • 睡前原谅一切
      睡前原谅一切
      2019-09-16回复
      可以写个可以复现的代码片段么
      2019-09-16
      回复
    • 
      2019-09-16回复睡前原谅一切

      https://developers.weixin.qq.com/s/qfyIRqmW7Ybm

      只在真机会有问题(ios),模拟器没问题

      2019-09-16
      回复
    查看更多(3)
登录 后发表内容
问题标签