<template>
	<view style="padding: 24rpx;" v-html="content">

	</view>
</template>

<script>
	import {get_agreement_detail} from "@/units/inquire.js"
	export default {
		data() {
			return {
				type: '',
				content: ''
			}
		},
		onLoad(option) {
			this.type = option.type
		},
		onShow() {
			this.getdata()
		},
		methods: {
			getdata() {
				// 协议标识:
				// user_service用户服务协议;
				// personal_info_protected个人信息保护政策;
				// platform_qualification_introduce平台资质介绍;
				// service_introduce服务介绍;
				// example_introduce案例介绍;
				// infomation_introduce资讯介绍;
				// contact_customer_service联系客服;
				// agreement_rule协议与规则;
				// privacy隐私政策;
				// pay_for_job付费求职;
				// commission_balance佣金余额
				get_agreement_detail({
					code: {
						1: 'user_service',
						2: 'privacy'
					} [this.type]
				}).then(res => {
					uni.setNavigationBarTitle({
						title: res.data.title
					})
					const regex = new RegExp('<img', 'gi')
					this.content = res.data.content.replace(regex, `<img style="max-width: 100%; height: auto"`)
				})

			}
		}
	}
</script>

<style lang="scss">
</style>