/**
* 协议
*/
<template>
	<div class="agreement" v-html="content">

	</div>
</template>

<script>
	export default {
		data() {
			return {
				content: '',
				type: 1,
			}
		},
		watch: {
			'$route': 'selectAgree'
		},
		mounted() {
			this.selectAgree()
		},
		methods: {
			selectAgree() {
				this.type = Number(this.$route.query.type)
				console.log(this.type, '走了')
				switch (this.type) {
					case 1:
						this.getContent()
						break;
					case 2:
						this.getUserAgre()
						break;
					case 3:
						this.getMyAgre()
						break;
					default:
						break;
				}
			},
			//用户协议
			getUserAgre() {
				this.$Request.get('/app/common/type/177').then(res => {
					if (res.code === 0) {
						this.content = res.data.value;
					}
				});
			},
			//关于我们
			getMyAgre() {
				this.$Request.get('/app/common/type/187').then(res => {
					if (res.code === 0) {
						this.content = res.data.value;
					}
				});
			},
			//隐私协议
			getContent() {
				this.$Request.get('/app/common/type/176').then(res => {
					if (res.code === 0) {
						this.content = res.data.value;
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>