<template>
	<view class="comment">
		<view class="box">
			<view class="headPortraitimg">
				<image :src="item.userHead"
				@click.stop="previewImage([item.userHead])"
				mode="aspectFill"></image>
			</view>
			<view class="YaoduUniversalWall">
				<view class="heide">
					<view class="username text-ellipsis">
						{{ item.userName }}
					</view>
				</view>
	
				<view class="Times">
					<view class="TimeMonth">
						{{ item.createTime }}发布
					</view>
				</view>
			</view>
		</view>
		
		<view class="dynamics" v-html="$utils.stringFormatHtml(item.userValue)">
		</view>
		
		<view class="images">
			<view class="image" 
			@click.stop="previewImage(images, i)"
			:key="i" v-for="(img, i) in images">
				<image :src="img" mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props : ['item'],
		data() {
			return {

			}
		},
		computed : {
			images(){
				if(!this.item.userImage){
					return []
				}
				return this.item.userImage.split(',')
			}
		},
		methods: {

		}
	}
</script>

<style scoped lang="scss">
	.comment {
		background-color: #fff;
		padding: 30rpx 40rpx;
		margin-top: 10rpx;

		.box {
			display: flex;
			align-items: center;

			.headPortraitimg {
				width: 80rpx;
				height: 80rpx;
				border-radius: 15rpx;
				overflow: hidden;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.YaoduUniversalWall {
				padding: 0rpx 10rpx;
				font-size: 26rpx;
				line-height: 40rpx;

				.Times {
					font-size: 22rpx;
				}
			}
		}

		.dynamics {
			margin-top: 20rpx;
			margin-left: 100rpx;
			font-size: 28rpx;
			letter-spacing: 3rpx;
			word-break: break-all;
		}
		
		.images {
			display: flex;
			flex-wrap: wrap;
			margin-top: 20rpx;
			margin-left: 100rpx;
			.image {
				margin: 10rpx;
				image {
					height: 120rpx;
					width: 120rpx;
					border-radius: 20rpx;
				}
			}
		}
	}
</style>