添加身份证识别

This commit is contained in:
老叶
2022-06-07 15:59:51 +08:00
parent c843abb7bf
commit f45fc5893f
8 changed files with 215 additions and 32 deletions
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -1,4 +1,4 @@
const env = "p";
const env = "d";
const version = 1,
@@ -138,6 +138,10 @@ api = {
appCusorderV2Customer:'app/cusorderV2/customer', //获取客户订单
appCustomersVisit_tabs:'app/customers/visit_tabs', //回访待跟进tab
appIdcardInfo:'app/idcard/info', //识别身份证号码
}
+7
View File
@@ -846,5 +846,12 @@ apiQuery.getAppCustomersVisit_tabs = function (params) {
})
}
//识别身份证号码
apiQuery.getAppIdcardInfo = function (params) {
return new Promise(function (resolve, reject) {
HttpRequest(false, Config.api.appIdcardInfo, 2, params, "GET", resolve, reject)
})
}
export default apiQuery;
+4 -6
View File
@@ -52,7 +52,7 @@ Page({
isResetbiz:false,//是否重置过BIZID
isShowVersionInfo:false,//是否显示版本更新
versionInfo:{
number:'V3.0.28',
number:'V3.0.36',
list:[
// '',
// '',
@@ -60,11 +60,9 @@ Page({
// '',
// '',
// '',
// '调整【客户等级】H级(3天内购车)、A级(7天内购车)、B级(15天内购车);',
// '调整【客户跟进】逻辑,新增"跟进渠道"选项,可自行根据客户等级调整下次跟进时间;',
// '优化【首页】相关信息展示;',
// '优化【客户列表】【订单列表】的搜索功能及信息展示;',
// '对其他页面细节进行了优化;',
'订单新增拍照/上传身份证识别,自动填充信息,避免填错;',
'修复了客户成功经理门店切换偶尔切换不成功的bug;',
],
},
},
+57
View File
@@ -16,6 +16,7 @@ Page({
c_city_id:'',
oncardArray:[],//上牌城市
oncardIndex:-1,//上牌城市索引
owner_cardidpic:'',//车主身份证正面照
},
onLoad: function (options) {
for (let key in options) {
@@ -150,6 +151,16 @@ Page({
_.apiQuery.putAppCusorderV2Info(params).then(res => {
//上传身份证
if(that.data.owner_cardidpic != ''){
let oparams = {};
oparams['id'] = that.data.id;
oparams['cardida'] = that.data.owner_cardidpic;
_.apiQuery.putAppCusorderdata(oparams).then(res2 => {
})
}
//刷新详情页
let pages = getCurrentPages();
let prevPage = null; //上一个页面
@@ -225,4 +236,50 @@ Page({
}
},
//选择图片
chooseImg(e) {
let that = this
//上传身份证正面-车主身份证
if(e.currentTarget.dataset.type=='owner'){
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
wx.showLoading();
wx.uploadFile({
url:_.config.api.upImg,
filePath:res.tempFilePaths[0],
name: 'img',
formData: {
'app': 'liche'
},
success: (resp) => {
resp.data = JSON.parse(resp.data);
wx.hideLoading();
if (resp.data.code == 200) {
let params = {};
params['img'] = resp.data.data.url;
_.apiQuery.getAppIdcardInfo(params).then(res2 => {
that.setData({
owner_cardid:res2.data.IdNum,
owner_name:res2.data.Name,
owner_cardidpic:resp.data.data.url,
})
})
}
},
})
},
fail: res => {
wx.showToast({
title: '文件选择失败',
icon: 'none',
duration: 2000
})
}
})
}
},
})
+8 -7
View File
@@ -2,23 +2,24 @@
<view class="inner30">
<block wx:if="{{main_type==0}}">
<view class="mt10 pt20 pb20 bg-e3f5f3 font-36 text-center ulib-r10">车主信息</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" model:value='{{owner_name}}' disabled='{{isShowAddress?true:false}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主手机号码<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号码" model:value='{{owner_mobile}}' disabled='{{isShowAddress?true:false}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="relative bbs-1-eb last-b-none pl180 pr60 font-28">
<view class="absolute left-0 box-middle">车主身份证<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="idcard" placeholder="请输入客户身份证" model:value='{{owner_cardid}}' disabled='{{isShowAddress?true:false}}' />
</view>
<view class="absolute right-0 box-middle font-50 iconfont icon-cardid color-666" bindtap="chooseImg" data-type="owner"></view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" model:value='{{owner_name}}' disabled='{{isShowAddress?true:false}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" bindtap="optAddress">
<view class="absolute left-0 box-middle">车主地址<text class="color-f9394d">*</text></view>
+110
View File
@@ -95,6 +95,9 @@ Page({
if_local_bill:0,//本地开具发票
customer_cardidpic:'',//客户身份证正面照
owner_cardidpic:'',//车主身份证正面照
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -591,6 +594,7 @@ Page({
owner_name:this.data.name,
owner_mobile:this.data.mobile,
owner_cardid:this.data.cardid,
owner_cardidpic:this.data.customer_cardidpic,
})
},
@@ -693,6 +697,15 @@ Page({
details:res.data,
})
if(that.data.owner_cardidpic != ''){
let oparams = {};
oparams['id'] = res.data.id;
oparams['cardida'] = that.data.owner_cardidpic;
_.apiQuery.putAppCusorderdata(oparams).then(res2 => {
})
}
// wx.showModal({
// title: '登记成功',
// content: '',
@@ -866,6 +879,15 @@ Page({
isShowSuccess:true,//是否显示成功提示
details:res.data,
})
if(that.data.owner_cardidpic != ''){
let oparams = {};
oparams['id'] = res.data.id;
oparams['cardida'] = that.data.owner_cardidpic;
_.apiQuery.putAppCusorderdata(oparams).then(res2 => {
})
}
}).catch(res=>{
that.setData({
@@ -1148,4 +1170,92 @@ Page({
})
},
//选择图片
chooseImg(e) {
let that = this
//上传身份证正面-客户身份证
if(e.currentTarget.dataset.type=='customer'){
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
wx.showLoading();
wx.uploadFile({
url:_.config.api.upImg,
filePath:res.tempFilePaths[0],
name: 'img',
formData: {
'app': 'liche'
},
success: (resp) => {
resp.data = JSON.parse(resp.data);
wx.hideLoading();
if (resp.data.code == 200) {
let params = {};
params['img'] = resp.data.data.url;
_.apiQuery.getAppIdcardInfo(params).then(res2 => {
that.setData({
cardid:res2.data.IdNum,
name:res2.data.Name,
customer_cardidpic:resp.data.data.url,
})
})
}
},
})
},
fail: res => {
wx.showToast({
title: '文件选择失败',
icon: 'none',
duration: 2000
})
}
})
}
//上传身份证正面-车主身份证
if(e.currentTarget.dataset.type=='owner'){
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) {
wx.showLoading();
wx.uploadFile({
url:_.config.api.upImg,
filePath:res.tempFilePaths[0],
name: 'img',
formData: {
'app': 'liche'
},
success: (resp) => {
resp.data = JSON.parse(resp.data);
wx.hideLoading();
if (resp.data.code == 200) {
let params = {};
params['img'] = resp.data.data.url;
_.apiQuery.getAppIdcardInfo(params).then(res2 => {
that.setData({
owner_cardid:res2.data.IdNum,
owner_name:res2.data.Name,
owner_cardidpic:resp.data.data.url,
})
})
}
},
})
},
fail: res => {
wx.showToast({
title: '文件选择失败',
icon: 'none',
duration: 2000
})
}
})
}
},
})
+16 -14
View File
@@ -28,24 +28,25 @@
</view>
</view>
<block>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">客户姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" model:value='{{name}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">客户手机号码<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号码" model:value='{{mobile}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{main_type==0}}">
<view class="relative bbs-1-eb last-b-none pl180 pr60 font-28" wx:if="{{main_type==0}}">
<view class="absolute left-0 box-middle">客户身份证<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="idcard" placeholder="请输入客户身份证" model:value='{{cardid}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
<view class="absolute right-0 box-middle font-50 iconfont icon-cardid color-666" bindtap="chooseImg" data-type="customer"></view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">客户姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" model:value='{{name}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
</block>
</view>
<block wx:if="{{main_type==0}}">
@@ -56,23 +57,24 @@
</view>
</view>
<view class="mt20 pt10 pb10 pl30 pr30 bg-fff ulib-r10 box-shadow-000-10-10">
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车主姓名" model:value='{{owner_name}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主手机号码<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入车主手机号码" model:value='{{owner_mobile}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="relative bbs-1-eb last-b-none pl180 pr60 font-28">
<view class="absolute left-0 box-middle">车主身份证<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="idcard" placeholder="请输入车主身份证" model:value='{{owner_cardid}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
<view class="absolute right-0 box-middle font-50 iconfont icon-cardid color-666" bindtap="chooseImg" data-type="owner"></view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">车主姓名<text class="color-f9394d">*</text></view>
<view>
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车主姓名" model:value='{{owner_name}}' disabled='{{isShowIntenMoney||isShowAddress?true:false}}' always-embed='{{true}}' />
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" bindtap="optAddress">
<view class="absolute left-0 box-middle">车主地址<text class="color-f9394d">*</text></view>