收藏
回答

OCR不能使用

问题类型 插件 AppID 插件版本号 AppID 微信版本 基础库版本
Bug wx4418e3e031e551be 3.1.6 wxbcf448b2cb20d537 8.0.51 3.6.3

      wx.chooseImage({

  count: 1,

  success: async function(res) {

    try {

      const invokeRes = await wx.serviceMarket.invokeService({

        service: 'wx4418e3e031e551be',

        api: 'OcrAllInOne',

        data: {

          // 用 CDN 方法标记要上传并转换成 HTTP URL 的文件

          img_url: new wx.serviceMarket.CDN({

            type: 'filePath',

            filePath: res.tempFilePaths[0],

          }),

          data_type: 3,

          ocr_type: 1

        },

      })


      console.log('invokeService success', invokeRes)

      wx.showModal({

        title: 'success',

        content: JSON.stringify(invokeRes),

      })

    } catch (err) {

      console.error('invokeService fail', JSON.stringify(err))

      wx.showModal({

        title: 'fail',

        content: err,

      })

    }

  },

  fail: function(res) {},

  complete: function(res) {},

})


回答关注问题邀请回答
收藏
登录 后发表内容