<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;
				try {
					const res = uni.getStorageSync('config');
					if (res) {
						res.agree = res.agree.replace(/\<img/gi, '<img class="rich-img"');
						that.$set(that, `info`, res.data);
					}
				} catch (err) {
					uni.showToast({
						title: err.errmsg,
						icon: 'error',
						duration: 2000
					});
				}
			}
		}
	}
</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>