<template>
	<view class="userAagreement white_style">
		<Nav className="nav_F6" :backVisible="true" :scroll="scroll">
			<block slot="content" class="omit">{{ $t('index.userAagreement.title') }}</block>
		</Nav>
		<view class="body_scroll clearfix" :style="getHeight">
			<view class="content">
				<rich-text class="rich_content" :nodes="content"></rich-text>
			</view>
		</view>
		<!-- loading -->
		<loading :visible="loading" />
	</view>
</template>

<script>
	import mixins from '@/utils/mixins'

	export default {
		mixins: [mixins],
		data() {
			return {
				content: ''
			}
		},
		created() {
			this.getUserAgreement()
		},
		methods: {
			// 获取用户协议
			async getUserAgreement () {
				this.loading = true
				const result = await this.$axios.get(this.API.getUserAgreement)
				this.loading = false
				if (result) {
					this.content = result
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.userAagreement {
		min-height: calc(100vh);

		.body_scroll {
			.content {
				line-height: 44rpx;
				font-size: 32rpx;
				font-weight: 400;
				padding: 26rpx;
				color: $bg-0;
				.rich_content {
					word-break: break-all;
					white-space: pre-line;
				}
			}
		}
	}
</style>
