zsk 2 years ago
parent af1efef3e8
commit b73509c52b

@ -4,6 +4,7 @@ var dateUtil = require("../../utils/dateUtil.js");
var dateTimePicker = require("../../utils/dateTimePicker.js"); var dateTimePicker = require("../../utils/dateTimePicker.js");
Component({ Component({
data: { data: {
idCardNum:"",
dateTime: "", dateTime: "",
currentTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()), currentTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()),
copyTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()), copyTime: dateUtil.formatDateYMD(mydate.toLocaleDateString()),
@ -227,13 +228,6 @@ Component({
e.detail.value.interviewTimeStr = that.data.currentTime; e.detail.value.interviewTimeStr = that.data.currentTime;
} }
e.detail.value.jobId = that.data.info.id e.detail.value.jobId = that.data.info.id
console.log('form发生了submit事件携带数据为', e.detail.value) console.log('form发生了submit事件携带数据为', e.detail.value)
wx.request({ wx.request({
@ -250,7 +244,8 @@ Component({
}) })
that.setData({ that.setData({
show: false, show: false,
ageIndex:-1 ageIndex:-1,
idCardNum:""
}) })
wx.showTabBar({ wx.showTabBar({
animation: false, animation: false,
@ -326,7 +321,8 @@ Component({
hideLeft () { hideLeft () {
// this.data.show = false // this.data.show = false
this.setData({ this.setData({
ageIndex: -1 ageIndex: -1,
idCardNum:"",
}) })
var eventDetail = { var eventDetail = {
type: this.data.drawerType type: this.data.drawerType
@ -356,7 +352,85 @@ Component({
this.setData({ this.setData({
morePeople: !this.data.morePeople morePeople: !this.data.morePeople
}) })
},
chooseIdCard () {
var that = this;
console.log("ischoise");
wx.chooseMedia({
count: 1,
sizeType: ["original", "compressed"],
sourceType: ["album", "camera"],
success (res) {
console.log(res);
// debugger;
that.uploadIdcardImg(res);
},
});
},
uploadIdcardImg (imgPath) {
let that = this;
// tempFilePath可以作为img标签的src属性显示图片
let filePath;
console.log("22222222222222222");
console.log(imgPath);
if (imgPath.tempFiles[0].tempFilePath) {
filePath = imgPath.tempFiles[0].tempFilePath
} else {
filePath = imgPath;
}
console.log(filePath);
wx.showLoading({
title: "识别中...",
});
wx.uploadFile({
// url: app.globalData.ip + '/commons/idCardOcrRecognize',
url: app.globalData.ip + "/commons/idCardOcrRecognizeAndUploadToAliyunOss",
filePath,
name: "uploadFile",
header: app.globalData.headers,
success: function (res) {
console.log("9999999999");
console.log(res);
if(res.statusCode == 413){
wx.showToast({
duration: 2000,
title: "身份证未识别",
icon: "none",
mask: true,
});
return
}
var idcard = JSON.parse(res.data);
console.log(idcard);
if (idcard.status == 200) {
that.setData({
idCardNum:idcard.data.num
});
} else {
wx.showToast({
duration: 2000,
title: "身份证未识别",
icon: "none",
mask: true,
});
} }
wx.hideLoading();
},
fail: function (res) {
console.log("99999999998");
console.log(res);
wx.hideLoading()
wx.showToast({
duration: 2000,
title: "身份证未识别",
icon: "none",
mask: true,
});
},
});
},
} }
}) })

@ -61,14 +61,17 @@
</view> </view>
<view class="weui-cell bb1 pb12 pt12" wx:if="{{info.agencyOperation == 1}}"> <view class="weui-cell bb1 pb12 pt12" wx:if="{{info.agencyOperation == 1}}">
<view class="weui-cell__hd display-flex aic mb16" style="max-width:90px"> <view class="weui-cell__hd display-flex aic mb16" style="max-width:90px">
<label class="weui-label c9 f12"> <label class="weui-label c9 f12" bind:tap="uploadCard">
您的身份证号 您的身份证号
<text class="cfred">*</text> <text class="cfred">*</text>
</label> </label>
</view> </view>
<view class="weui-cell__bd"> <view class="weui-cell__bd display-flex">
<input class="weui-input f17" type="idcard" maxlength="18" name="idCard" placeholder="请输入您的身份证号" placeholder-class="input__placeholder cccc" /> <input class="weui-input f17 flex-1 mr20" type="idcard" maxlength="18" name="idCard" value="{{idCardNum}}" placeholder="请输入您的身份证号" placeholder-class="input__placeholder cccc" />
<view class="t-icon t-icon-paizhao rightPz" catchtap="chooseIdCard"></view>
</view> </view>
</view> </view>
<view class="weui-cell bb1 pb12 pt12"> <view class="weui-cell bb1 pb12 pt12">
<view class="weui-cell__hd display-flex aic mb16" style="max-width:80px"> <view class="weui-cell__hd display-flex aic mb16" style="max-width:80px">

@ -66,3 +66,9 @@
position: sticky; position: sticky;
bottom: 0; bottom: 0;
} }
.rightPz{
width: 24px;
height: 24px;
padding: 4px;
box-sizing: border-box;
}
Loading…
Cancel
Save