<template>
	<view class="content">
		<u-parse :content="content"></u-parse>
		 <!-- <mp-html   :content="content"></mp-html> -->
	</view>
</template>
<script>
// import mpHtml from '@/uni_modules/mp-html/mp-html.vue'
import {getConfigByKey} from '@/api/common'
export default {
	// components: {
	//  	mpHtml
	// },
 	data() {
 		return {
			type:null,
			content:"",
 		}
 	},
	onLoad(options) {
		this.type=options.type;
		if(this.type=="doctorAgreement"){
			uni.setNavigationBarTitle({
				title:"入驻协议"
			})
		}
		if(this.type=="userRegister"){
			uni.setNavigationBarTitle({
				title:"用户协议"
			})
		}
		if(this.type=="userPrivacy"){
			uni.setNavigationBarTitle({
				title:"隐私协议"
			})
		}
		 
		this.getConfig();
	},
	methods:{
		getConfig(){
			var that=this;
			var data={key:"his.agreementConfig"}
			getConfigByKey(data).then(
				res => {
					if(res.code==200){
						if(this.type=="doctorRegister"){
							this.content=JSON.parse(res.data).doctorRegister;
						}
						else if(this.type=="doctorFiling"){
							this.content=JSON.parse(res.data).doctorFiling;
						}
						else if(this.type=="userRegister"){
							this.content=JSON.parse(res.data).userRegister;
						}
						else if(this.type=="userPrivacy"){
							this.content=JSON.parse(res.data).userPrivacy;
						}
						else if(this.type=="pharmacistRegister"){
							this.content=JSON.parse(res.data).pharmacistRegister;
						}
						else if(this.type=="pharmacistFiling"){
							this.content=JSON.parse(res.data).pharmacistFiling;
						}
						else if(this.type=="storeRules"){
							this.content=JSON.parse(res.data).storeRules;
						}
						else if(this.type=="residencyAgreement"){
							this.content=JSON.parse(res.data).residencyAgreement;
						}
					}
				},
				rej => {}
			);
		},
	}
 	 
 }
 
 
</script>


<style scoped lang="scss">
page{
	height: 100%;
}
.content{
	height: 100%;
}
 
</style>
