<template>
	<view>
		<!--文章标题-->
		<view class="text-black  text-bold  title" style="font-size: 40rpx;">{{dataDetail.noticeManagementContent.title}}</view>
		<view class="text-gray flex " style="padding: 0 0 30rpx 30rpx;">
			<view class="center">
				<text class="cuIcon-time padding-right-10"></text>
				<text>{{dataDetail.createTime}}</text>
			</view>
			<view @click="jump" class="center margin-left-30">
				<u-icon name="account" color="#b6b6b7"></u-icon>
				<text class="padding-left-10">{{dataDetail.noticeManagementContent.sender}}</text>
			</view>
		</view>
		<view class="content-view-box">
			<view class="font-view">
				<u-parse :html="dataDetail.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	var app=getApp()
	export default {
		components: {
		},
		data() {
			return {
				id:'',
				dataDetail:{},
			}
		},
		onLoad(options) {
			this.id=options.id
			this.fetchDetail()
		},
		methods: {
			 fetchDetail(){
				 this.$api.notice.detail({id:this.id}).then(res=>{
					 this.dataDetail=res.data
					 this.dataDetail.content= decodeURIComponent(this.dataDetail.noticeManagementContent.content)
				 })
			 },
			 jump(){
				 if (this.dataDetail.noticeManagementContent.senderType == 'SHOP') {
				 	uni.navigateTo({
				 		url:"/pages/consume/detail/shop-detail?id="+this.dataDetail.noticeManagementContent.senderId
				 	})
				 }
				 if (this.dataDetail.noticeManagementContent.senderType == 'MALL') {
				 	uni.navigateTo({
				 		url:"/pages/activity/activity?id="+this.dataDetail.noticeManagementContent.senderId
				 	})
				 }
			 }
		}
	}
</script>


<style lang="scss">
	page {
		background: #FFFFFF;
	}
	.title {
		margin: 36.36rpx 27.27rpx;
	}

	.content-view-box {
		position: relative;
		.font-view {
			padding: 27.27rpx;
			line-height: 1.9;
		}
		image {
			width: 100%;
		}
	}
</style>
