<template>
	<mobile-frame>
		<view class="main">
			<view class="one">
				<rich-text :nodes="info.agree"></rich-text>
			</view>
		</view>
	</mobile-frame>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				info: {}
			};
		},
		onShow: function() {
			const that = this;
			that.search();
		},
		methods: {
			search() {
				const that = this;
				uni.getStorage({
					key: 'config',
					success: function(res) {
						if (res.data) {
							res.data.agree = res.data.agree.replace(/\<img/gi, '<img class="rich-img"');
							that.$set(that, `info`, res.data);
						}
					},
					fail: function(err) {
						console.log(err);
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.main {
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 100vh;

		.one {
			padding: 2vw;

			.rich-img {
				width: 100% !important;
				display: block;
			}
		}
	}
</style>
