<template>
	<view class="agreement">
		<navbar :config="config" backColor="#999999"></navbar>
		<view class="top ql-editor-box" v-html="agreement">
		</view>
	</view>
</template>

<script>
	import jyfParser from "../../components/jyf-parser/jyf-parser";
	var app = getApp()
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '注册协议',
					color: '#1A1A1A',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, "#FFFFFF"],
					// statusBarFontColor: '#1A1A1A',

				},
				agreement: '',
				balance: [],
				parmas: {
					page: 1,
					limit: 20,
					title: ''
				},
				noData: false,
				tabTop: 0,
				status: 'more', //more|loading|noMore

			}
		},

		onLoad(options) {
			if (options.type) {
				this.agreementInfo(options.type);
				if (options.type == 'user_protocol') {
					this.config.title = '服务协议';
				}else if (options.type == 'privacy_protocol') {
					this.config.title = '隐私协议';
				}else if (options.type == 'realname_auth_protocol') {
					this.config.title = '实名认证协议';
				}else if(options.type == 'about_us'){
					this.config.title = '关于我们';
				}
			}
		},
		methods: {
			agreementInfo(type) {
				this.$yghttp.get('/protocol/info', {
						code: type
					})
					.then(res => {
						if (res && res.code == 200) {
							this.agreement = res.data.protocolContent
						}
					})
			}
		}
	}
</script>

<style scoped lang="scss">
	.agreement {
		width: 100%;
		overflow: hidden;
	}

	.topsearch {
		position: fixed;
		left: 0;
		width: 100%;
		z-index: 2;
		box-sizing: border-box;
		background-color: #fff;
	}

	.topsbox {
		padding: 80rpx 30rpx 0;
	}

	.leftbox {
		height: 60rpx;
		line-height: 60rpx;
		background-color: #E6E6E6;
		border-radius: 30rpx;
	}

	.u-p30s {
		padding: 10rpx 30rpx;
	}

	.uptop {
		padding: 30rpx 0;
		width: 100%;
		position: relative;
	}

	.turn {
		transform: rotate(90deg);

	}

	.top {
		padding: 0 20rpx;
	}

	/deep/ .hxicon {
		color: #1A1A1A !important;
	}
</style>