以下是我的方法,请问是怎么回事呢?


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


}

})

},


展开全部
收起
1回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Elijah

    4人对此回答表示赞同

    这是个遗留很久的问题了。。

    展开
    4
    1回复
    发布于 5年前

    评论(1)

    收起评论

    • 六神无主 2019-03-12 09:16

      我知道!我看过那个帖子,然鹅这都九月了。。

      回复
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部