<template>
	<view class="page-body">
		<!-- #ifdef MP-ALIPAY-->
		<web-view :src="isMinorityUrl+'/9901?source=web&token='+face_token+'&serialNumber='+face_key+'&backUrl='+ url"></web-view>
		<!-- #endif  -->
		
		<!-- #ifdef MP-WEIXIN  -->
		<web-view :src="isMinorityUrl+'/9901?token='+face_token+'&serialNumber='+face_key+'&backUrl='+ url"></web-view>
		<!-- #endif  -->
		
	</view>
</template>

<script>
	var config = require('../../common/config.js');
	var http = require('../../common/http.js');
	var common = require('../../common/common.js');
	var storage = require('../../common/storage.js')
	export default {
		data() {
			return {
				face_token: '',
				face_key: '',
				url: '',
				isMinorityUrl:'', //是否是小众租车appid url
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			this.face_token = options.face_token
			this.face_key = options.face_key
			const accountInfo = uni.getAccountInfoSync();
			if(accountInfo.miniProgram.appId=='wx868f4e5130ef2636'){
				this.setData({isMinorityUrl:'https://h5live.chinadatapay.com'})
			}else{
				this.setData({isMinorityUrl:'https://h5livev1.chinadatapay.com'})
			}
			console.log(this.isMinorityUrl,'isMinorityUrl');
			//#ifdef MP-ALIPAY
			// this.url = encodeURIComponent('https://ax.tellhe.cn/callBack')
			// this.url = encodeURIComponent('https://ax.tellhe.cn/callBack/faceCallback.html')
			this.url = encodeURIComponent('https://admin.bms16.com/static/faceCallback.html')
			//#endif
			//#ifdef MP-WEIXIN
			this.url = '/pages/callPage/callPage'
			//#endif
			
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			this.getFaceKey()
			
		},
		methods: {
			getFaceKey() {
				const _face_key = uni.getStorageSync('faceKey')
				if (_face_key&&_face_key != this.face_key) {
					this.face_key = _face_key
				}
				
			}
		}
	};
</script>

<style>
	@import './livenessView.css';
</style>