<template>
	<view class="chat">
		<view class="chat-navbar">
			<u-navbar :title="title">
				<view class="slot-wrap" slot="right" @click="toSheet()">
					<u-icon name="more-dot-fill" color="#000000" size="30"></u-icon>
				</view>
			</u-navbar>
		</view>
		<view class="chat-hd">
			<u-notice-bar :volume-icon="false" mode="horizontal" :list="list"></u-notice-bar>
		</view>
		<scroll-view class="chat-bd" scroll-y :class="isOpen?'chat-bd-on':''">
			<view class="item">
				<view class="fl"><image src="@/static/nv.png"></image></view>
				<view class="fr">
					<view class="name">李大花<text>陪玩师</text></view>
					<view class="desc">世间无敌，舍我其谁。霸气长存，风云变色</view>
					<view class="gift">送出礼物<image mode="widthFix" src="/static/logo.png"></image>棒棒糖<text>X3</text></view>
					<view class="yinping">
						<image src="@/static/chat-03.png"></image> 8”
					</view>
					<view class="video">
						<video src=""></video>
					</view>
					<view class="img">
						<image src="/static/pic.jpg"></image>
					</view>
				</view>
			</view>
			<view class="item item-on">
				<view class="fr">
					<view class="desc">天天忙的要死，好久没联系了哈，你最近咋样啊？</view>
				</view>
				<view class="fl"><image src="@/static/nv.png"></image></view>
			</view>
		</scroll-view>
		<view class="chat-fd">
			<view class="a">
				<view class="luyin">
					<image src="/static/chat-01.png"></image>
				</view>
				<view class="input">
					<!-- <editor placeholder="单行输入" @input="inputValue"></editor> -->
					<input type="text" v-model="keyword" placeholder="单行输入" />
					<view class="more" @click="isOpen = !isOpen">
						<u-icon name="more-dot-fill" color="#000000" size="30"></u-icon>
					</view>
				</view>
				<view class="btn">
					发送
				</view>
			</view>
			<view class="b" v-if="isOpen">
				<image src="@/static/chat-zhaopian.png"></image>
				<image src="@/static/chat-xiangji.png"></image>
				<image src="@/static/chat-yinshipin.png"></image>
				<image src="@/static/chat-liwu.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isOpen: false,
				keyword: "",
				title: "里大话",
				list: ["请文明聊天，以线下约会为由索要礼物或微信转账/发红包，均是诈骗"]
			};
		},
		methods: {
			toSheet() {
				uni.showActionSheet({
					itemList: ["查看TA的主页","清楚记录", "取消关注", "举报", "加入黑名单"],
					success(res){
						console.log(res.tapIndex)
					}
				})
			},
			inputValue(e) {
				console.log(e)
			},
		}
	}
</script>

<style scoped lang="scss">
.chat{
	&-navbar{
		.slot-wrap{
			margin-right: 30rpx;
		}
	}
	&-hd{
		width: 100%;
		height: 70rpx;
		background: #FFEBEB;
		font-weight: 500;
		font-size: 24rpx;
		color: #222222;
		line-height: 70rpx;
		padding: 0 10rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}
	&-bd{
		width: 100%;
		height: calc(100vh - 190rpx - 88rpx);
		padding: 0 25rpx;
		box-sizing: border-box;
		&-on{
			height: calc(100vh - 190rpx - 88rpx - 160rpx);
		}
		.item{
			padding: 20rpx 0;
			width: 100%;
			align-items: flex-start;
			display: flex;
			overflow: hidden;
			justify-content: flex-start;
			.fl{
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				margin-right: 20rpx;
				image{
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
			.fr{
				flex: 1;
				overflow: hidden;
				.name{
					font-weight: 500;
					font-size: 28rpx;
					color: #222222;
					display: flex;
					align-items: center;
					text{
						width: 100rpx;
						line-height: 40rpx;
						background: linear-gradient(0deg, #000000, #3D3B38);
						box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
						border-radius: 40rpx;
						text-align: center;
						font-weight: 500;
						font-size: 22rpx;
						color: #FFFFFF;
						display: block;
						margin-left: 30rpx;
					}
				}
				.video{
					width: 400rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					margin-top: 20rpx;
					padding: 20rpx;
					video{
						width: 100%;
					}
				}
				.img{
					width: 400rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					margin-top: 20rpx;
					padding: 20rpx;
					image{
						width: 100%;
					}
				}
				.yinping{
					width: 200rpx;
					background: #FFFFFF;
					border-radius: 10rpx;
					margin-top: 20rpx;
					padding: 20rpx;
					display: flex;
					align-items: center;
					color: #000;
					font-size: 30rpx;
					image{
						width: 50rpx;
						height: 50rpx;
						margin-right: 20rpx;
					}
				}
				.gift{
					font-weight: 500;
					font-size: 24rpx;
					color: #999999;
					line-height: 44px;
					display: flex;
					align-items: center;
					margin-top: 20rpx;
					image{
						width: 60rpx;
						margin: 0 10rpx;
					}
					text{
						margin-left: 10rpx;
					}
				}
				.desc{
					max-width: 400rpx;
					background: #FFFFFF;
					border-radius: 30rpx 0px 30rpx 30rpx;
					margin-top: 20rpx;
					padding: 30rpx;
					font-weight: 500;
					font-size: 30rpx;
					color: #222222;
					line-height: 48rpx;
				}
			}
			
			&-on{
				.fl{
					margin-left: 20rpx;
					margin-right: 0;
				}
				.fr{
					.desc{
						float: right;
						background: #EAEBEB;
						border-radius: 0px 30rpx 30rpx 30rpx;
					}
				}
			}
		}
	}
	&-fd{
		width: 100%;
		min-height: 120rpx;
		background: #F6F6F6;
		.a{
			width: 100%;
			height: 120rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 20rpx;
			box-sizing: border-box;
			.luyin{
				width: 50rpx;
				height: 50rpx;
				image{
					width: 100%;
					height: 100%;
				}
			}
			.input{
				flex: 1;
				height: 80rpx;
				background: #FFFFFF;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-left: 20rpx;
				margin-right: 20rpx;
				editor,input{
					flex: 1;
					height: 50rpx;
					line-height: 50rpx;
					min-height: 50rpx;
					font-style: normal !important; 
					margin-left: 20rpx;
				}
				.more{
					margin: 0 20rpx;
				}
			}
			.btn{
				width: 120rpx;
				line-height: 70rpx;
				background: linear-gradient(0deg, #000000, #3D3B38);
				box-shadow: 0px 4rpx 18rpx 0px rgba(42,41,39,0.34);
				border-radius: 50rpx;
				text-align: center;
				font-weight: 500;
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
		.b{
			width: 100%;
			height: 160rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-top: 1px solid #E2E2E2;
			padding: 0 45rpx;
			box-sizing: border-box;
			image{
				width: 100rpx;
				height: 100rpx;
				display: block;
			}
		}
	}
}
</style>
