<template>
	<view class="agreement">
		
		<div class="content">
			<!-- <u-parse :content="content"></u-parse> -->
			<rich-text :nodes="content"></rich-text>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'协议',
				list:[
					{
						name:'平台协议',
						api:'/api/register/aggrement'
					},
					{
						name:'用户协议',
						api:'/api/login/aggrement'
					},
					{
						name:'隐私政策',
						api:'/api/login/policy'
					},
				],
				content:''
			};
		},
		onLoad({title}) {
			uni.setNavigationBarTitle({
				 title,
			})
			this.title=title
			this.get_agreement()
		},
		methods:{
			get_agreement(){ 
				let api =this.list.find(v=>v.name==this.title).api
				console.log(api);
				this.$api.sendRequest({
					url:api,
					data: {
						
					},
					success: res => {
						this.content= res.data.content
					},
					fail: res => {
				
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.agreement{
	padding: 32rpx;
	.content{
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #585858;
		line-height: 44rpx;
	}
	.title{
		text-align: center;
		font-size: 36rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-bottom: 30rpx;
	}
}
</style>
