<template>
	<view class="detail">
		<view class="title">{{ item.title }}</view>
		<view class="desc">
			<text class="time">发布于：{{ item.createTime }}</text>
			<button class="fx" open-type="share">
				<text class="icon">&#xe637;</text>
				<text>分享</text>
			</button>
		</view>
		<view class="con">
			<u-divider :dot="true"></u-divider>
			<u-parse :content="item.content"></u-parse>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			item: {}
		};
	},
	onLoad(e) {
		this.http.request({
			url: '/app/knowledge/detail/' + e.id,
			success: (res) => {
				this.item = res.data.data;
				this.item.content = res.data.data.content.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
			}
		});
	},
	methods: {},
	//分享
	onShareAppMessage: function (res) {
		return {
			title: this.item.title,
			path: '/pages/knowledge/detail?id=' + this.item.id,
			success: (res) => {},
			fail: (res) => {}
		};
	}
};
</script>

<style lang="scss">
page {
	background-color: white;
}
</style>
