<template>
	<view style="padding: 20rpx;">
		<view class="item">
			<view class="title">{{listData.informVo.informName}}</view>
			<view class="time">{{ $method.timestampToTime(listData.sendTime, false) }}</view>
			<view class="content" v-html="listData.informVo.affiche"  style="width: 100%;">
			</view>
		</view>
		<view class="btn1" @click="isOk" v-if="listData.receiptStatus === 0">
			我已阅读
		</view>
		<view class="btn1" @click="backPage" v-if="listData.receiptStatus === 1">
			返回
		</view>
	</view>
</template>

<script>

import { mapGetters } from 'vuex';
export default {
	components: {
		
	},
	data() {
		return {
			listData:{},
			id:null,
			img1:'/static/icon/msg_icon1.png',
			img2:'/static/icon/msg_icon2.png'
		};
	},
	onPullDownRefresh(){
	},
	onLoad(option) {
		this.id = Number(option.id)
		this.getInfo()
	},
	onShow() {
		/* if(this.current === 2 && this.$method.isLogin()){
			this.$refs.refMy.init();
		} */
	},
	onShareAppMessage(res) {
		var self = this;
		return {
			title: '中正',
			path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
		};
	},
	methods: {
		isOk(){
			this.$api.courseappinformUser({id:this.listData.id,receiptStatus:1}).then(res => {
				if(res.data.code === 200){
					uni.navigateBack({
					    delta: 1
					});
				}
			})
		},
		backPage(){
			uni.navigateBack({
			    delta: 1
			});
		},
		getInfo(){
			this.$api.getappinformUserId(this.id).then(res => {
				if(res.data.code === 200){
					res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi,'<img style="max-width:100%;"')
				this.listData = res.data.data
				}
			})
		},
		change(index){
			this.current = index;
		}
	},
	onReachBottom() {},
	computed: { ...mapGetters(['userInfo']) }
};
</script>
<style >
	page {
			background: #EAEEF1;
		}
</style>
<style scoped>
	.content{
		font-size: 28rpx;
		color: #666666;
		line-height: 36rpx;
	}
	.time{
		font-size: 24rpx;
		color: #999999;
		margin: 15rpx 0;
	}
	.btn1{
		width: 526rpx;
		height: 80rpx;
		background: #007AFF;
		border-radius: 40rpx;
		color: #FFFFFF;
		font-size: 30rpx;
		font-weight: bold;
		text-align: center;
		line-height: 80rpx;
		margin: 30rpx auto;
	}
.item{
		width: 100%;
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 15rpx;
	}
	.title{
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
	}
</style>
