Commit ab357d74 authored by Jennie Shi's avatar Jennie Shi

人证对比插件

parent 594ca1b9
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.xcmg.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>徐工金服</name>
<widget id="com.xcmg.app.dev" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>徐工金服UAT</name>
<description>
正式环境版
</description>
......@@ -109,6 +109,7 @@
<plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<engine name="android" spec="~6.2.0" />
<engine name="ios" spec="~4.5.5" />
<plugin name="IdCardPlugin" spec="/Users/jeshi/Documents/徐工/IdCardPlugin-测试S" />
<engine name="android" spec="~6.2.0" />
</widget>
......@@ -167,7 +167,7 @@
"dev": true
},
"IdCardPlugin": {
"version": "file:../card-plugin-test/IdCardPlugin-test"
"version": "file:../IdCardPlugin-测试S"
},
"abbrev": {
"version": "1.1.1",
......@@ -2523,7 +2523,7 @@
},
"cordova-android": {
"version": "6.2.0",
"resolved": "https://registry.npm.taobao.org/cordova-android/download/cordova-android-6.2.0.tgz?cache=0&sync_timestamp=1604452896462&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcordova-android%2Fdownload%2Fcordova-android-6.2.0.tgz",
"resolved": "https://registry.npm.taobao.org/cordova-android/download/cordova-android-6.2.0.tgz",
"integrity": "sha1-32iB29cuIzA8o9/e03KrAWFMAXM=",
"requires": {
"cordova-common": "^2.0.1",
......
......@@ -13,7 +13,7 @@
"clean": "rimraf www/*"
},
"dependencies": {
"IdCardPlugin": "file:../card-plugin-test/IdCardPlugin-test",
"IdCardPlugin": "file:../IdCardPlugin-测试S",
"autosize": "^3.0.20",
"better-scroll": "^1.10.3",
"cordova-android": "^6.2.0",
......@@ -116,7 +116,8 @@
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"ionic-plugin-keyboard": {}
"ionic-plugin-keyboard": {},
"IdCardPlugin": {}
}
}
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ public class IdCardIdentifyPlugin extends CordovaPlugin {
callbackContext.error(getResult(0,"参数错误"));
return false;
}
return super.execute(action, args, callbackContext);
return true;
}
private void startIdCardCheck(){
......@@ -79,17 +79,17 @@ public class IdCardIdentifyPlugin extends CordovaPlugin {
case 800:
if (resultCode == Activity.RESULT_OK) {
String isLive = data.getStringExtra("isLiveness");
byte headImage[] = data.getByteArrayExtra("headImage");
String imageStr = null;
if(headImage != null && headImage.length > 0){
imageStr = Base64.encodeToString(headImage, Base64.NO_WRAP);
}
if ("1".equals(isLive)) {
byte headImage[] = data.getByteArrayExtra("headImage");
String imageStr = null;
if(headImage != null && headImage.length > 0){
imageStr = Base64.encodeToString(headImage, Base64.NO_WRAP);
}
//检测成功
mCallbackContext.success(getResult(1,"检测成功",imageStr));
} else {
//检测失败
mCallbackContext.success(getResult(0,"检测失败"));
mCallbackContext.error(getResult(0,"检测失败"));
}
}
break;
......
......@@ -7,7 +7,7 @@ repositories{
dependencies {
compile(name:"qsign_facesdk_xg_dev_1.0.0",ext: 'aar')
implementation 'com.lzy.net:okgo:3.0.4'
compile('com.lzy.net:okgo:3.0.4')
}
android {
......@@ -15,4 +15,8 @@ android {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
aaptOptions {
noCompress "dat"
}
}
\ No newline at end of file
......@@ -72,7 +72,7 @@
"PACKAGE_NAME": "com.xcmg.app.dev"
},
"IdCardPlugin": {
"PACKAGE_NAME": "com.xcmg.app.dev"
"PACKAGE_NAME": "com.xcmg.app"
}
},
"dependent_plugins": {
......
......@@ -7,9 +7,6 @@
"files": {}
},
"installed_plugins": {
"IdCardPlugin": {
"PACKAGE_NAME": "com.xcmg.app"
},
"com.handmobile.cordovaplugin.hotpatch": {
"PACKAGE_NAME": "com.xcmg.app"
},
......@@ -78,6 +75,9 @@
"jpush-phonegap-plugin": {
"APP_KEY": "bef4fd44dcf54b79b8ab27c3",
"PACKAGE_NAME": "com.xcmg.app"
},
"IdCardPlugin": {
"PACKAGE_NAME": "com.xcmg.app"
}
},
"dependent_plugins": {
......
......@@ -163,17 +163,17 @@
<tab-button class="approve" @click.native="isConfirm">确定</tab-button>
</bottom-tab>
<!--活体检测-->
<body-check ref="body" :check_id="$route.params.check_id" :confirm_id="confirm_id" />
<!-- <body-check ref="body" :check_id="$route.params.check_id" :confirm_id="confirm_id" /> -->
</h-view>
</template>
<script>
import Tab from '@/pages/carConfirm/tab'
import bodyCheck from './body-check'
// import bodyCheck from './body-check'
export default {
components: {
Tab,
bodyCheck,
// bodyCheck,
},
filters: {
lengthCheck: function (value) {
......@@ -217,6 +217,7 @@ export default {
product_plan_id_n: '',
product_code: '',
},
signMsg: '',
rentInfo: {
frame_number: '',
engine: '',
......@@ -241,7 +242,7 @@ export default {
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'ConfirmList') {
vm.$refs.body.hideBody()
// vm.$refs.body.hideBody()
vm.getDetail()
vm.getEquipment()
vm.getAttachment()
......@@ -345,23 +346,43 @@ export default {
if (res.result === 'S') {
return true
} else {
vm.hlsPopup.showLongCenter(res.message)
vm.signMsg = res.message
return false
}
},
getTabNum (i) {
this.tabNum = i
},
takePhonto () {
async takePhonto () {
let vm = this
hlsPopup.showConfirm({
title: '提示',
content: '请自拍一张',
onConfirm: function (index) {
if (index === 1) {
vm.takePhontoOpenCamera()
} else {
}
},
let flag = await this.signCheck()
if (flag) {
vm.hlsPopup.showLongCenter('已经验证过!')
return
}
let url = process.env.basePath + 'bp_query'
let param = {
bp_id: window.localStorage.bp_id,
}
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
if (res.result === 'S') {
let data = res.lists[0]
console.log('data === ' + data)
cordova.plugins.IdCardPlugin.idCardIdentify({'idNum': data.id_card_no, 'idName': data.bp_name, 'timeout': 10000}, function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
// 回调成功上传图片
// vm.uploadImg(success.image)
vm.goElectronicSign()
}
}, function (reason) {
vm.hlsPopup.showLongCenter('认证失败: ' + reason)
})
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
},
// 查看大图
......@@ -372,32 +393,43 @@ export default {
width: '100%',
})
},
// 打开相机自拍
takePhontoOpenCamera () {
uploadImg (img) {
let vm = this
vm.faceListUpload = []
let obj = {
pkvalue: vm.$route.params.check_id,
source_type: 'PRJ_CDD_ITEM_CHECK',
picture: '',
filePath: '',
filePath: img,
attachment_id: '',
user_id: 1,
fileName: 'face',
}
let cameraoptions = {
quality: 100,
cameraDirection: 1,
}
let success = function (imgdata) {
obj.filePath = imgdata
vm.confirmContractSign(imgdata)
vm.faceListUpload.push(obj)
}
let error = function () {
hlsPopup.showLongCenter('请拍照')
vm.faceListUpload.push(obj)
vm.save_picture(vm.faceListUpload)
},
goElectronicSign () { // 电子签
let vm = this
let url = process.env.basePath + 'get_sign_url'
let param = {
confirm_id: vm.confirm_id,
data_class: 'PRJ_PROJECT',
}
hlsUtil.openCamera(cameraoptions, success, error)
vm.hlsPopup.showLoading('请稍后')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.info.msg === 'success') {
vm.$router.push({
name: 'ElectronicSign',
params: {
url: res.info.data.url,
},
})
cordova.InAppBrowser.open(res.info.data.url, '_blank', 'location=yes')
} else {
vm.hlsPopup.showLongCenter(res.info.msg)
}
})
},
// 执行同意的逻辑(查询对应的身份证正面图片->人脸识别->确认签约)
async confirmContractSign (faceImg) {
......@@ -517,18 +549,20 @@ export default {
},
async isConfirm () {
let vm = this
let flag = await this.signCheck()
let flag = await vm.signCheck()
if (flag) {
// 只有认证通过后方可进行签约操作
this.hlsPopup.showConfirm({
vm.hlsPopup.showConfirm({
title: '提示',
content: '您确定同意发车吗?',
onConfirm: data => {
if (data === 1) {
this.confirm()
vm.confirm()
}
},
})
} else {
vm.hlsPopup.showLongCenter(vm.signMsg)
}
},
confirm () {
......
......@@ -1109,6 +1109,7 @@ export default {
textarea{
color: #666;
resize: none;
text-align: right;
}
textarea::placeholder{
text-align: right;
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"><meta name=format-detection content="telephone=no"><meta name=format-detection content="email=no"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><script type=text/javascript src=./static/vuePlatform.js></script><script type=text/javascript src=./static/prototype.js></script><script type=text/javascript src=./cordova.js></script><script type=text/javascript src="http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"></script><title>徐工金服</title><link href=./static/css/app.d391cbe4f727fbde9a1f0c7f76c12fc8.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.6a178e8d77c32e3c385d.js></script><script type=text/javascript src=./static/js/vendor.7191c48e0b160a3ab672.js></script><script type=text/javascript src=./static/js/app.9d0d4f4694bb9d826f6b.js></script></body></html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment