<template>
	<view class="main">
		<navbar :config="config" backColor="#666"></navbar>
		<view class="content ql-editor-box" v-html="content"></view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				config: {
					back: true,
					title: '',
					color: '#1a1a1a',
					backgroundColor: [1, '#fff'],
					statusBarFontColor: 'black'
				},
				content: ''
			}
		},
		onLoad(option) {
			this.getProtocol(option.code);
		},
		methods:{
			getProtocol(code){
				if(code == 'privacy-agreement'){
					this.config.title = '隐私政策'
				}
				if(code == 'about-us'){
					this.config.title = '关于我们'
				}
				if(code == 'privacy-agreement'){
					this.config.title = '用户隐私协议'
				}
				if(code == 'earnings-explain'){
					this.config.title = '收益说明'
				}
        if(code == 'income_statement'){
        	this.config.title = '收益说明'
        }
				this.$http.get(`/protocolConfig/info/${code}`)
				.then(res => {
					if(res.code==200){
						this.content = res.data.content
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main{
		.content{
			padding: 0 30rpx;
		}
	}
</style>