<template>
	<view>

		<view class="echo-article-title bg-white">
			{{notice.title}}
		</view>

		<view class="echo-article-meta bg-white">
			<view class="echo-article-meta-left">
				<text>{{notice.createtime_text}}</text>
				<text>{{notice.noticeCate.title}}</text>
			</view>
			<view class="echo-article-meta-right">
				<text>浏览 {{notice.volume}}</text>
			</view>
		</view>

		<view class="echo-article-details bg-white">
			<u-parse :content="notice.details" noData="详情内容..." @navigate="navigate"></u-parse>
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/gaoyia-parse/parse.vue';
	var _this;
	export default {
		components: {
			uParse
		},
		data() {
			return {
				notice: {}
			}
		},
		onLoad: function(option) {
			_this = this;
			var noticeid = option.noticeid || 0;
			_this.$req.ajax({
				path: "notice/getnotice",
				data: {
					noticeid: noticeid
				}
			}).then((data) => {
				_this.notice = data.notice;
			}).catch((err) => {
				uni.showModal({
					title: '信息提示',
					content: err,
					showCancel: false
				});
			});
		},
		onShareAppMessage: function(res) {
		    return {
				title: _this.notice.title,
				path: "/pages/notice/detail?noticeid="+_this.notice.id
		    }
		},
		methods: {
			navigate: function(href, e) {
				// #ifdef H5
				location.href = href;
				// #endif
				// #ifndef H5
				uni.navigateTo({
					url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
				});
				// #endif
			}
		}
	}
</script>

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