<template>
	<view class="agreement">
		<view class="con" v-html="data"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				type: 0
			}
		},
		onLoad(option) {
			this.type = option.type
			if (option.type == 1) {
				this.geixieyi()
			} else {
				this.configInfo()
			}
		},
		methods: {
			geixieyi() {
				// this.$http.getUserAgreement().then(res => {
				// 	uni.openDocument({
				// 		filePath: res.data.result.url,
				// 		fileType:'pdf',
				// 		fail: (e) => {
				// 			console.log(e);
				// 		}
				// 	})
				// })
			},
			configInfo() {
				this.$http.getPrivacy().then(res => {
					if (res.data.code == 200) {
						console.log(res)
						this.data = res.data.result.privacy
						// this.data=res.data.result
						// console.log(this.data.result.ysxy)
					}
				})
			},

		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}

	.agreement {
		height: 100%;

		.con {
			width: 680rpx;
			margin: 24rpx auto;
			padding: 32rpx;
			background-color: #fff;
			border-radius: 24rpx;
		}
	}
</style>