<template>
	<view class="sub">
		<view class="gpd">
			<view class="guidtit" v-if="detail.noticeTitle">
				{{detail.noticeTitle}}
			</view>
			<!-- <view class="guidtime" v-if="detail.createTime">{{detail.createTime}}</view> -->
			<rich-text v-if="noticeContent" :nodes="noticeContent"></rich-text>
		</view>
	</view>
</template>

<script>
	import url from "@/util/url";
	let {imgDomain} = url
	export default{
		data(){
			return{
				string:'',
				detail:{},
				noticeContent:'',
				id:''
			}
		},
		onLoad(e) {
			this.type=e.type
			this.getDataFn(e.id)
		},
		methods:{
			getDataFn(e){
				var that=this;
				that.$http.get("boman-system/notice/"+e).then(res => {
					if (res.code == 200) {
						if(res.data.noticeContent){
							var t='<img style="max-width: 100%;" src="';
							var newhtml=res.data.noticeContent.replace(/\<img src="/gi, t);
							that.noticeContent=newhtml;
						}
						that.detail=res.data
					} else {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
				
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.sub{box-sizing: border-box;width: 100%;min-height: 100vh;}
	.gpd{padding:30rpx 26rpx;}
	.guidtit{font-size: 30rpx;font-weight: bold;color: #222222;margin-bottom: 32rpx;}
	.guidtime{font-size: 20rpx;color: #676767;margin-bottom: 60rpx;}
</style>
