<template>
	<view>
		<face-bio-assay :isDev="false" :action="['StraightenHead']" ref="faceDetect" @detectFailed="photoChange" @photoChange="photoChange">
		</face-bio-assay>
	</view>
</template>

<script>
	import faceBioAssay from '@/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue'
	export default {
		components: {
			faceBioAssay,
		},

        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) {
				let self = this
				uni.navigateBack()
				this.getOpenerEventChannel().emit('data',{path: path, order_id: self.order_id});
			}
		}

	}
</script>

<style>
</style>
