<template>
	<div style="height:100vh">
		<yd-layout>
			<yd-navbar title="消息详情" color="#fff" slot="navbar">
				<router-link :to="{path: '/MessageCenter' }"  replace slot="left">
					<yd-navbar-back-icon style="color: #fff"></yd-navbar-back-icon>
				</router-link>
			</yd-navbar>
			<div class="title_info">
				<h3 class="title">{{info.title}}</h3>
<!--				<p>发件人：188金宝博</p>-->
				<p>发件时间：{{info.write_time}}</p>
			</div>
			<div class="text_info">
				{{info.details}}
			</div>

			<yd-tabbar slot="tabbar">
				<yd-button size="large" type="primary" @click.native="deleteItem(info)">删除消息</yd-button>
			</yd-tabbar>
		</yd-layout>
	</div>
</template>

<script>
	export default {
		name: "MessageDetail",
		data(){
			return {
				info:{}
			}
		},
		computed: {
		},
		watch:{

		},
		mounted(){
			// console.log(this.$store.getters.getMessageDetail)
			this.info = this.$store.getters.getMessageDetail

		},
		methods: {
			deleteItem(item){
				// console.log(item) 
				this.$http.get(this.$ports.login.delUserNews, {
					identity: item.identity,
					token: localStorage.getItem("token")
				}).then((res) => {
					// console.log(res, '删除成功')
					this.$dialog.toast({mes:  '删除成功'});
					clearTimeout(timer);
					let timer = setTimeout(()=>{
						this.$router.go(-1);
					},1000)
				});
			}
		}
	}
</script>

<style scoped>
	.yd-btn-block {
		margin-top: 0.6rem;
	}
	.yd-navbar {
		background-image: linear-gradient(0deg, #565656 0%, #999999 100%);
	}

	.title_info {
		padding: 0.3rem;
		height:1.6rem;
		background:rgba(239,239,239,1);
	}
	.title_info h3 {
		font-size: 15px;
		margin-bottom: 10px;
	}
	.title_info p {
		color: #666666;
		line-height: 1.8;
	}

	.text_info {
		margin-top: 0.20rem;
		padding: 0.3rem;
		background:rgba(239,239,239,1);
		font-size: 14px;
		color: #333333;
		line-height: 1.8;
	}

	.yd-tabbar {
		margin: 0 auto;
		width: 80%;
		background-color: transparent !important;
	}
	.yd-btn-block {
		margin-top: 0;
		border-radius: 10px;
		background:linear-gradient(0deg,rgba(90,90,90,1) 0%,rgba(138,138,138,1) 100%);
	}
</style>