以下是我的方法,请问是怎么回事呢?
doWordIndentify: function () {
var that = this
that.setData({
showOcrResult: false
})
data: {
ocrImgUrl: null
}
wx.chooseImage({
count: 1,
sizeType: [‘compressed’],
sourceType: [‘album’, ‘camera’],
success: function (res) {
var tempfilePath = res.tempFilePaths[0]
that.setData({
ocrImgUrl: tempfilePath,
})
console.log(tempfilePath)
wx.uploadFile({
url: ‘https://zs.nxxxjs.top/API/getImage’,
filePath: tempfilePath,
name: ‘file’,
formData: {
‘user’: ‘test’
},
success: function (res) {
wx.showToast({
title: ‘解析成功’,
icon: ‘succes’,
duration: 1000,
mask: true
})
var carN = res.data
console.log(carN)
console.log(carN[0])
var carN1 = carN.slice(15,-4)
console.log(carN1)
that.setData({
inputTxt1: carN1,
})
//do something
}, fail: function (err) {
console.log(err)
}
})
},
fail: function (res) {
// fail
},
complete: function (res) {
// complete
}
})
},
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。