<template>
	<div class="view">
		
		<div v-for="(item,index) in data" :key="index" @click="toChat(item)">
			<div class="row">
				<div class="left" >
					<image :src="item.avatar" class="avatar"  mode=""></image>
				</div>
				
				<div class="center">
					<div class="name">{{item.name}}</div>
					<div class="msg">{{item.newMsg}}</div>
				</div>
				<div class="right">
					{{item.time}}
				</div>
			</div>
			<u-line style="margin: 34rpx 0;"></u-line>
		</div>
		
	</div>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				data: [
					{
						name:'远光药业001',
						newMsg: '您的问题得到解决了吗',
						time: '昨天',
						avatar: this.$util.img('/upload/weapp/user/wx.png')
					},{
						name:'远光药业002',
						newMsg: '您的问题得到解决了吗',
						time: '12-17',
						avatar: this.$util.img('/upload/weapp/user/wx.png')
					},{
						name:'远光药业003',
						newMsg: '您的问题得到解决了吗',
						time: '12-12',
						avatar: this.$util.img('/upload/weapp/user/wx.png')
					},{
						name:'远光药业004',
						newMsg: '您的问题得到解决了吗',
						time: '12-01',
						avatar:this.$util.img('/upload/weapp/user/wx.png')
					},{
						name:'远光药业005',
						newMsg: '您的问题得到解决了吗',
						time: '11-25',
						avatar: this.$util.img('/upload/weapp/user/wx.png')
					}
				]
			}
		},
		onLoad(e) {
			this.id=e.id
		},
		onShow() {
			this.$api.sendRequest({
				url: "/api/notice/page",
				data: {
					type_id: this.id
				},
				success: res => {
					console.log(res.data.list,'res');
					// this.data=res=res.data.list
				}
			});
		},
		methods: {
			toChat() {
				uni.navigateTo({
					url:'/pages_tool/news/chat'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.view {
		height: 100vh;
		background-color: #fff;
		padding: 33rpx 40rpx;
		.row {
			display: flex;
			.left {
				display: flex;
				justify-content: center;
				align-items: center;
				.avatar{
					width: 88rpx;
					height: 88rpx;
					border-radius: 50%;
				}
			}
			.center {
				padding-left: 20rpx;
				flex-grow: 1;
				.name {
					font-size: 28rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 600;
					color: #222222;
				}
				.msg {
					padding-top: 10rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}
			.right {
				display: flex;
				justify-content: center;
				align-items: center;
				padding-right: 12rpx;
				
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
			}
		}
	}
</style>