1.点击上传并识别

组件样式
<van-field border="{
{ false }}" placeholder="请输入银行卡卡号" model:value="{
{bankNo}}" label="卡号">
<van-icon bindtap="handleChooseImg" slot="right-icon" name="scan" class="custom-icon" />
</van-field>
view .van-field__control {
text-align: right;
}
方法
handleChooseImg(){
wx.chooseImage({
count: 1,
sourceType: ['album'],
success: (res) => {
let temp_path = res.tempFilePaths[0];
console.log(temp_path);
const _this = this
wx.uploadFile({
filePath: temp_path, 文件路径 按后端接口参数修改
name: 'file', 传过去的文件名