<template>
	<view>
		<view id="box">
			<u-parse :content="content" :noData="content" v-if="isShow" :imageProp="imageProp" />
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/gaoyia-parse/parse.vue'
	export default {
		components: {
			uParse
		},
		data () {
			return {
				content: "",
				isShow: false,
				imageProp:{
					mode: 'aspectFit',
					padding: 0,
					lazyLoad: false,
					domain: ''
				}
			}
		},
		onLoad (options) {
			this.id = options.id || 0;
			this.get_article();
		},
		methods: {
			get_article () {
				this
					.request
					.post("getContent", {
						id: this.id
					})
					.then(res => {
						if (res.code == 200) {
							this.content = res.data.content;
							uni.setNavigationBarTitle({
								title: res.data.title
							});
							this.isShow = true;
						}
					})
					.catch(err => {
						this.utils.Tip("网络错误，请稍后尝试");
					});
			}
		}
	}
</script>

<style lang="scss">
	@import url("/components/gaoyia-parse/parse.css");
	#box {
		z-index: -1;
		padding: 15px;
	}
	/deep/ {
		/* #ifndef APP */
		.img {
			display: block !important;
			width: 100%;
		}
		/* #endif */
	}
</style>