<template>
	<view class="mg-view">
		<!-- <view>
			{{Info.ruleTitle}}
		</view> -->
		<rich-text style="font-size: 24rpx;color: #333333;" :nodes="Info.ruleContent"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Info: {},
				type: ""
			}
		},
		onLoad(e) {
			console.log(e);
			this.type = e.type;
			if (e.type == "user_agreement") {
				uni.setNavigationBarTitle({
					title: "用户协议"
				});
			} else if (e.type == "privacy_agreement") {
				uni.setNavigationBarTitle({
					title: "隐私政策"
				});
			}
			this.saveUserInfo();
		},
		methods: {
			async saveUserInfo() {
				let res = await this.$http.get('/api/client/rule/selectRuleByType?ruleType=' + this.type)
				let resData = res.data.data || {}
				this.Info = resData;
				console.log(this.Info)

			}
		}
	}
</script>

<style>
	page {
		background-color: #FAFBFF;
	}
</style>

<style lang="scss" scoped>
	.mg-view {
		margin: 30rpx 50rpx;
	}
</style>