<template>
	<view class="agreement_content">
		<web-view :webview-styles="webviewStyles" :src="webViewSrc"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				webviewStyles: {
					progress: false
				},
				webViewType: '',
				webViewSrc: ''
			}
		},
		onLoad(options) {
			const type = options.type;
			const obj = {
				// 用户协议
				'1': {
					title: '《用户协议》',
					src: `https://qjnovelweb.qinjiuxiaoshuo.com/UserAgreement.html`
				},
				// 隐私政策
				'2': {
					title: '《隐私协议》',
					src: `https://qjnovelweb.qinjiuxiaoshuo.com/privacypolicy.html`
				}
			}
			uni.setNavigationBarTitle({
				title: obj[type].title
			});
			this.webViewSrc = obj[type].src;
			this.webViewType = type;
		},
		onShow() {

		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.agreement_content {
		position: relative;
		width: 100%;
		height: 100%;
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容 iOS 设备 */
		padding-bottom: env(safe-area-inset-bottom);
	}
</style>