<template>
	<view class="content">
		<view class="list">
			<block v-for="(item,index) in pageList" :key="index">
				<u-swipe-action>
					<u-swipe-action-item :options="options" @click="deleteItem">
						<view class="item hflex acenter" @click="chatItem(item)">
							<view class="img_box">
								<image :src="item.src" class="img"></image>
							</view>
							<view class="img_right">
								<view class="hflex aend jbetween">
									<view class="name">{{item.name}}</view>
									<view class="text">{{item.date}}</view>
								</view>
								<view class="hflex acenter jbetween">
									<view class="text">{{item.text}}</view>
									<view class="num">{{item.num}}</view>
								</view>
							</view>
						</view>
					</u-swipe-action-item>
				</u-swipe-action>
			</block>
		</view>
	</view>
</template>

<script>
	// import WebIM from '@/utils/WebIM.js'
	import $api from '@/static/js/api.js'
	var that = ''
	export default {
		data() {
			return {
				pageList:[
					{
						id: 51,
						name: '雷神',
						date: '',
						text: '',
						num: '',
					}
				],
				options: [{
                    text: '删除'
                }]
			}
		},
		onLoad() {
			that = this
			that.getConverList()
		},
		methods: {
			getConverList() {
				console.log(uni.WebIM);
				uni.WebIM.conn.getSessionList().then((res) => {
					console.log(res);
				})
			},
			deleteItem() {},
			chatItem(item) {
				console.log(item);
				$api.jump('/page_shop/pages/mine/chatDetail?id=' + item.id + '&name=' + item.name)
			}
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 0 30rpx;
		.list {
			
			.item {
				padding-top: 28rpx;
				width: 100%;
				.img_box {
					width: 100rpx;
					height: 100rpx;
					margin-right: 20rpx;
					.img {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}
				.img_right {
					width: calc(100% - 120rpx);
					padding: 0 0 32rpx;
					border-bottom: 1rpx solid #E9E9E9;
					.name {
						font-size: 32rpx;
						font-weight: 500;
						color: #222222;
						line-height: 44rpx;
					}
					.text {
						font-size: 24rpx;
						font-weight: 400;
						color: #999999;
						line-height: 34rpx;
					}
					.num {
						width: 34rpx;
						height: 34rpx;
						border-radius: 17rpx;
						font-size: 24rpx;
						text-align: center;
						font-weight: 400;
						color: #FFFFFF;
						line-height: 34rpx;
						background: #FF5745;
					}
				}
			}
		}
	}
</style>