替换人脸拍照
This commit is contained in:
@ -1,46 +1,36 @@
|
||||
<template>
|
||||
<view>
|
||||
<face-bio-assay :isDev="false" :action="['StraightenHead']" ref="faceDetect" @detectFailed="photoChange" @photoChange="photoChange">
|
||||
</face-bio-assay>
|
||||
</view>
|
||||
<!-- <@devicePosition: 摄像头位置 前置或后置摄像头,值为front, back
|
||||
@quality: 成像质量,值为high(高质量)、normal(普通质量)、low(低质量) -->
|
||||
<view>
|
||||
<hao-camera
|
||||
:devicePosition="back"
|
||||
:quality="low"
|
||||
@confirmPhoto="confirmPhoto"
|
||||
></hao-camera>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import faceBioAssay from '@/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue'
|
||||
export default {
|
||||
components: {
|
||||
faceBioAssay,
|
||||
},
|
||||
|
||||
data() {
|
||||
import haoCamera from '@/uni_modules/hao-camera/components/hao-camera/hao-camera.vue';
|
||||
export default {
|
||||
components: {
|
||||
haoCamera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
order_id: 0,
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(args) {
|
||||
this.order_id = args.order_id || 0;
|
||||
this.$refs.faceDetect.initData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
detectFailed() {
|
||||
uni.showToast({
|
||||
title: "人脸核验失败~",
|
||||
icon: 'none'
|
||||
})
|
||||
uni.navigateBack()
|
||||
},
|
||||
|
||||
photoChange(path) {
|
||||
methods: {
|
||||
confirmPhoto(filePath){
|
||||
console.log("🚀 ~ filePath:", filePath)
|
||||
let self = this
|
||||
uni.navigateBack()
|
||||
this.getOpenerEventChannel().emit('data',{path: path, order_id: self.order_id});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
this.getOpenerEventChannel().emit('data',{path: filePath, order_id: self.order_id});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user