<template>
	<view >
		 <!-- <web-view :src="webUrl"></web-view> -->
		 <view v-html="text"></view>
	</view>
</template>

<script>
 import {getConfigByKey} from '@/api/index.js'
 export default {
 	data() {
 		return {
			webUrl:"",
			vaule:'',
			text:''
 		}
 	},
	onLoad(val) {
		this.webUrl=uni.getStorageSync('url');
		console.log(val)
		this.vaule=val.data
		this.getConfigByKeys()
	},
	methods:{
		getConfigByKeys(){
			const data={
				key:"his.agreementConfig",
				appId:wx.getAccountInfoSync().miniProgram.appId,
			}
			getConfigByKey(data).then(res=>{
				if(res.code==200){
					if(this.vaule=='userRegister'){
						this.text=JSON.parse(res.data).userRegister
					}else{
						this.text=JSON.parse(res.data).userPrivacy
					}
					console.log(JSON.parse(res.data))
				}else{
					if (res.msg.length >14) {
					  uni.showModal({
					    title: '提示',
					    content: res.msg,
					    showCancel: false,
					    confirmText: '我知道了'
					  })
					} else {
					  uni.showToast({
					    title: res.msg,
					    icon: 'none'
					  })
					}
				}
			})
		}
	}
 	 
 }
 
 
</script>


<style scoped lang="scss">
page{
	height: 100%;
}
.content{
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	
}
 

</style>
