Commit eb016248 authored by jiacheng.mao's avatar jiacheng.mao

腾讯sdk iOS分支

parent 8acdc59c
This diff is collapsed.
......@@ -43,6 +43,7 @@
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"cordova-android": "^6.2.0",
"cordova-ios": "^6.3.0",
"cross-env": "^5.2.0",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
......@@ -103,12 +104,11 @@
],
"cordova": {
"platforms": [
"ios",
"android"
],
"plugins": {
"cordova-plugin-inappbrowser": {},
"cordova-plugin-ionic-webview": {}
}
}
}
}
{
"prepare_queue": {
"installed": [],
"uninstalled": []
},
"config_munge": {
"files": {}
},
"installed_plugins": {
"com.handmobile.cordovaplugin.hotpatch": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-baidumaplocation": {
"ANDROID_KEY": "Y8gTWgN2GuDtvhBfiECaZiBtE6i0wQBG",
"IOS_KEY": "hhouKKwxALvC7MBZmnfwgSacHOfFOlNu",
"IOS_LOCATION_DESC": "请点击'好'以允许访问。",
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": "我们将在拍照模块使用您的相机",
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-datepicker": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-device": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-dialogs": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-file": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-file-transfer": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-hrms-faceidentify": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-image-picker": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-ionic-webview": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-jcore": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-media-capture": {
"CAMERA_USAGE_DESCRIPTION": " ",
"MICROPHONE_USAGE_DESCRIPTION": " ",
"PHOTOLIBRARY_USAGE_DESCRIPTION": " ",
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-network-information": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-splashscreen": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-statusbar": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-touch-id": {
"FACEID_USAGE_DESCRIPTION": " ",
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.xcmg.app"
},
"ionic-plugin-keyboard": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-ionic-webview": {
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
},
"cordova-plugin-inappbrowser": {
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
},
"jpush-phonegap-plugin": {
"APP_KEY": "bef4fd44dcf54b79b8ab27c3",
"PACKAGE_NAME": "com.xcmg.app"
},
"IdCardPlugin": {
"PACKAGE_NAME": "com.xcmg.app"
}
},
"dependent_plugins": {
"cordova-plugin-3dtouch": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-compat": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-contacts": {
"CONTACTS_USAGE_DESCRIPTION": "我们将在通讯功能读取您的联系人,为你提供便捷服务",
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-fingerprint": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-themeablebrowser": {
"PACKAGE_NAME": "com.xcmg.app"
},
"cordova-plugin-x-toast": {
"PACKAGE_NAME": "com.xcmg.app"
},
"es6-promise-plugin": {
"PACKAGE_NAME": "com.xcmg.app"
}
}
}
\ No newline at end of file
......@@ -180,28 +180,105 @@ export default {
hlsPopup.hideLoading()
if (res.result === 'S') {
let data = res.lists[0]
cordova.plugins.IdCardPlugin.faceContrast({ 'idNum': data.id_card_no, 'idName': data.bp_name }, function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
let filePath = JSON.stringify(success.message, '\\', null)
filePath = 'file:\/\/' + filePath.replace('\"', '')
filePath = filePath.substr(0, filePath.length - 1)
// console.log('filePath ==== ' + filePath)
// 回调成功上传图片
vm.uploadImg(filePath)
vm.signContact()
} else {
vm.hlsPopup.showLongCenter('认证失败,请将脸部完整露出再重试!')
}
}, function (reason) {
let error = JSON.parse(reason)
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
vm.startTencentFace({
name: data.bp_name,
idNo: data.id_card_no,
userId: data.id_card_no,
bp_id: JSON.parse(window.localStorage.now_user_bp_bind_id).bp_id,
})
// cordova.plugins.IdCardPlugin.faceContrast({ 'idNum': data.id_card_no, 'idName': data.bp_name }, function (suc) {
// let success = JSON.parse(suc)
// if (success.code === 1) {
// let filePath = JSON.stringify(success.message, '\\', null)
// filePath = 'file:\/\/' + filePath.replace('\"', '')
// filePath = filePath.substr(0, filePath.length - 1)
// // console.log('filePath ==== ' + filePath)
// // 回调成功上传图片
// vm.uploadImg(filePath)
// vm.signContact()
// } else {
// vm.hlsPopup.showLongCenter('认证失败,请将脸部完整露出再重试!')
// }
// }, function (reason) {
// let error = JSON.parse(reason)
// vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
// })
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
},
startTencentFace (params) {
let vm = this
let url = process.env.basePath + 'api_get_faceinfo'
let param = params
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
console.log(res)
if (res.result === 'S') {
let faceParams = res.info
window.successCallback = function (suc) {
console.log('success', suc)
let params = {
master: {
orderNo: faceParams.agreementNo,
getFile: 1, // 是否需要获取人脸识别的视频和文件,值为1则返回视频和照片、值为2则返回照片、值为3则返回视频;其他则不返回
queryVersion: '1.0',
nonce: faceParams.openApiNonce,
record_id: faceParams.faceId,
project_list: vm.checkList.map(item => ({ project_id: item.project_id, content_id: item.content_id })),
},
}
vm.getTencentFaceResult(params)
}
window.errorCallback = function (err) {
console.log('error', err)
vm.hlsPopup.showLongCenter('人脸唤起失败, 请重新尝试或联系管理员!')
}
let option = {
// 以下是必须的参数
'openApiAppId': res.info.openApiAppId,
'keyLicence': res.info.keyLicence,
'faceId': res.info.faceId,
'agreementNo': res.info.agreementNo,
'openApiAppVersion': res.info.openApiAppVersion,
'openApiNonce': res.info.openApiNonce,
'openApiUserId': res.info.openApiUserId,
'openApiSign': res.info.openApiSign,
// 以下是可选的
'config': {
'customTipsInUpload': '已提交审核,请等待结果',
'forceOrientation': true,
},
}
console.log('option', option)
Tencentface.startWbFaceVerifySdk(successCallback, errorCallback, option)
} else {
vm.hlsPopup.showLongCenter('人脸身份认证失败:' + res.message)
}
})
},
getTencentFaceResult (params) {
let vm = this
let url = process.env.basePath + 'api_query_faceresult'
let param = params
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
console.log('faceResult', res)
if (res.result === 'S') {
if (res.info.code === '0') {
vm.hlsPopup.showLongCenter('人脸认证成功!')
vm.signContact()
} else {
vm.hlsPopup.showLongCenter('人脸认证失败:' + res.info.msg)
}
} else {
vm.hlsPopup.showLongCenter('人脸结果查询失败:' + res.message)
}
})
},
// 处理要上传的图片格式
uploadImg (img) {
this.faceListUpload = this.list.map(item => {
......
......@@ -457,28 +457,105 @@ export default {
hlsPopup.hideLoading()
if (res.result === 'S') {
let data = res.lists[0]
cordova.plugins.IdCardPlugin.faceContrast({'idNum': data.id_card_no, 'idName': data.bp_name}, function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
let filePath = JSON.stringify(success.message, '\\', null)
filePath = 'file:\/\/' + filePath.replace('\"', '')
filePath = filePath.substr(0, filePath.length - 1)
console.log('filePath ==== ' + filePath)
// 回调成功上传图片
vm.uploadImg(filePath)
vm.goElectronicSign()
} else {
vm.hlsPopup.showLongCenter('认证失败,请重试!')
}
}, function (reason) {
let error = JSON.parse(reason)
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
vm.startTencentFace({
name: data.bp_name,
idNo: data.id_card_no,
userId: data.id_card_no,
bp_id: JSON.parse(window.localStorage.now_user_bp_bind_id).bp_id,
})
// cordova.plugins.IdCardPlugin.faceContrast({'idNum': data.id_card_no, 'idName': data.bp_name}, function (suc) {
// let success = JSON.parse(suc)
// if (success.code === 1) {
// let filePath = JSON.stringify(success.message, '\\', null)
// filePath = 'file:\/\/' + filePath.replace('\"', '')
// filePath = filePath.substr(0, filePath.length - 1)
// console.log('filePath ==== ' + filePath)
// // 回调成功上传图片
// vm.uploadImg(filePath)
// vm.goElectronicSign()
// } else {
// vm.hlsPopup.showLongCenter('认证失败,请重试!')
// }
// }, function (reason) {
// let error = JSON.parse(reason)
// vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
// })
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
},
startTencentFace (params) {
let vm = this
let url = process.env.basePath + 'api_get_faceinfo'
let param = params
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
console.log(res)
if (res.result === 'S') {
let faceParams = res.info
window.successCallback = function (suc) {
console.log('success', suc)
let params = {
master: {
orderNo: faceParams.agreementNo,
getFile: 1, // 是否需要获取人脸识别的视频和文件,值为1则返回视频和照片、值为2则返回照片、值为3则返回视频;其他则不返回
queryVersion: '1.0',
nonce: faceParams.openApiNonce,
record_id: faceParams.faceId,
project_list: [{ project_id: vm.project_id, content_id: vm.content_id }],
},
}
vm.getTencentFaceResult(params)
}
window.errorCallback = function (err) {
console.log('error', err)
vm.hlsPopup.showLongCenter('人脸唤起失败, 请重新尝试或联系管理员!')
}
let option = {
// 以下是必须的参数
'openApiAppId': res.info.openApiAppId,
'keyLicence': res.info.keyLicence,
'faceId': res.info.faceId,
'agreementNo': res.info.agreementNo,
'openApiAppVersion': res.info.openApiAppVersion,
'openApiNonce': res.info.openApiNonce,
'openApiUserId': res.info.openApiUserId,
'openApiSign': res.info.openApiSign,
// 以下是可选的
'config': {
'customTipsInUpload': '已提交审核,请等待结果',
'forceOrientation': true,
},
}
console.log('option', option)
Tencentface.startWbFaceVerifySdk(successCallback, errorCallback, option)
} else {
vm.hlsPopup.showLongCenter('人脸身份认证失败:' + res.message)
}
})
},
getTencentFaceResult (params) {
let vm = this
let url = process.env.basePath + 'api_query_faceresult'
let param = params
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
console.log('faceResult', res)
if (res.result === 'S') {
if (res.info.code === '0') {
vm.hlsPopup.showLongCenter('人脸认证成功!')
vm.goElectronicSign()
} else {
vm.hlsPopup.showLongCenter('人脸认证失败:' + res.info.msg)
}
} else {
vm.hlsPopup.showLongCenter('人脸结果查询失败:' + res.message)
}
})
},
// 查看大图
showBigPicture (pic) {
let vm = this
......
This diff is collapsed.
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