<template>
	<view class="content">
		 <view v-html="webUrl" style="padding-top: 20rpx;"></view>
	</view>
</template>

<script>
 import {getuserAgreement,getprivacyPolicy} from '@/api/common.js'
 export default {
 	data() {
 		return {
			webUrl:"",
 		}
 	},
	onLoad(option) {
		// this.webUrl=uni.getStorageSync('url');
		if(option.val==1){
			uni.setNavigationBarTitle({
				title: "用户协议"
			  });
			this.getuserAgreements()
		}else{
			uni.setNavigationBarTitle({
				title: "隐私保护"
			  });
			this.getprivacyPolicys()
		}
		console.log(option)
	},
 	 methods:{
		 getuserAgreements(){
			 getuserAgreement().then(res=>{
				 if(res.code==200){
					 this.webUrl=res.userAgreement
				 }else{
					 uni.showToast({
						icon:'none',
						title: res.msg,
					 });
				 }
			 })
		 },
		 getprivacyPolicys(){
			 getprivacyPolicy().then(res=>{
				 if(res.code==200){
					 this.webUrl=res.privacyPolicy
				 }else{
					 uni.showToast({
					 	icon:'none',
					 	title: res.msg,
					 });
				 }
			 })
		 }
	 }
 }
 
 
</script>


<style scoped lang="scss">
.content{
	padding: 20rpx;
	padding-bottom: 60rpx;
}
 

</style>
