<template>
	<view class="content">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	var that = ''
	export default {
		data() {
			return {
				content: ''
			}
		},
		onLoad(options) {
			that = this
			var title = ''
			switch(options.index) {
				case '1': 
					title = '规则';
					break;
				case '2':
					title = '公约';
					break;
				case '3':
					title = '供方认可机构清单';
					break;
			}
			uni.setNavigationBarTitle({
				title: title
			})
			that.getData(options.index)
		},
		methods: {
			getData(index) {
				$api.req({
					url: '/data/api.ResCenter/config'
				}, function(res) {
					if(res.code == 1) {
						switch(index) {
							case '1': 
								that.content = res.data.c_rule;
								break;
							case '2':
								that.content = res.data.c_conv;
								break;
							case '3':
								that.content = res.data.c_menu;
								break;
						}
					}
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #fff;
		padding: 24rpx 30rpx;
	}
</style>