<template>
	<view class="tongcheng">
		<view class="tongcheng-navbar">
			<u-navbar :title="title" back-icon-color="#ffffff" title-color="#ffffff" :background="background"></u-navbar>
		</view>
		<view class="tongcheng-content">
			<view class="title" v-if="isSucess == false">正在寻找新朋友...</view>
			<view class="desc" v-if="isSucess == false">当前用户过多，请耐心等待</view>
			<view class="desc1" v-else>{{isJieshou?'匹配成功，马上开始这段缘分吧！':'你有一条新的缘分！'}}</view>
			<view class="dian" v-if="isSucess == false">
				<view class="user">
					<view class="item">
						<image class="avatar" src="@/static/nv.png"></image>
						<view class="txt">空白空白1</view>
					</view>
					<view class="items">
						<image src="@/static/yuyin-xin2.png"></image>
					</view>
					<view class="item">
						<view class="pic">
							<image class="avatar1" src="@/static/nan.png"></image>
							<image class="avatar2" src="@/static/nan.png"></image>
						</view>
					</view>
				</view>
			</view>
			<view class="dian-on" v-else>
				<view class="info">
					<image src="@/static/nan.png"></image>
					<view class="name">张美丽</view>
					<view class="btn" v-if="isJieshou">+关注</view>
					<view class="txt">27岁/165cm</view>
				</view>
				<view class="tag" v-if="isSucess == true">
					<view class="titles">个性签名：</view>
					<view class="descs">
						<text>们都会走上一条叫做青春的路，反复并疼痛地成长着。\n曾经的旧时光，感动过你我。\n在黎明来临的时刻，我选择了将你遗忘。\n思绪的风引起一阵阵叹息，成了来自我心的绝唱。\n用一季的花开季节，见证你我的生命轮回。</text>
					</view>
				</view>
			</view>
		</view>
		<view class="tongcheng-end" v-if="isSucess == false">
			<view class="send">茫茫人海，今天和你相遇</view>
			<view class="todo">
				<image src="@/static/yuyin-cha.png"></image>
			</view>
		</view>
		<template v-else>
			<view class="tongcheng-start" v-if="isJieshou">
				<view class="item" @click="toggleMenu(1)">
					<image src="@/static/yuyin-01.png" v-if="isMakefeng"></image><image v-else src="@/static/yuyin-01-on.png"></image>麦克风{{isMakefeng?'开启':'已关'}}
				</view>
				<view class="item" @click="toggleMenu(4)">
					<image src="@/static/yuyin-02.png"></image>挂断
				</view>
				<view class="item" @click="toggleMenu(2)">
					<image src="@/static/yuyin-03.png" v-if="isYangshengqi"></image><image v-else src="@/static/yuyin-03-on.png"></image>扬声器{{isYangshengqi?'开启':'已关'}}
				</view>
			</view>
			<view class="tongcheng-start" v-else>
				<view class="item" @click="toggleMenu(3)">
					<image src="@/static/yuyin-02.png"></image>挂断
				</view>
				<view class="item" @click="toggleMenu(3)">
					<image src="@/static/yuyin-05.png"></image>接受
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isJieshou: true,
				title: "语音速配",
				isMakefeng: false,
				isYangshengqi: false,
				isSucess: false,
				background: {
					// 导航栏背景图
					background: 'url(@/static/yuyin-bg.png) center top no-repeat',
					// 还可以设置背景图size属性
					backgroundSize: '100 auto',
				},
			};
		},
		onLoad() {
			
		},
		methods: {
			toggleMenu(index){
				if(index == 1){
					this.isMakefeng = !this.isMakefeng
				}else if(index == 2){
					this.isYangshengqi = !this.isYangshengqi
				}else if(index == 3){
					this.isJieshou = !this.isJieshou
					this.title = (this.isJieshou == false?"语音速配":'00:60')
				}else if(index == 4){
					uni.navigateBack({
						delta: 1
					})
				}
			},
		}
	}
</script>

<style scoped lang="scss">
.tongcheng{
	background: #0d0b15 url(@/static/yuyin-bg.png) center top no-repeat;
	background-size: 100% auto;
	overflow: hidden;
	min-height: 100vh;
	&-content{
		text-align: center;
		.title{
			font-weight: 500;
			font-size: 48rpx;
			color: #FFFFFF;
			margin-top: 120rpx;
		}
		.desc{
			font-weight: 500;
			font-size: 30rpx;
			color: #FFFFFF;
			margin-top: 30rpx;
		}
		.desc1{
			font-weight: 500;
			font-size: 30rpx;
			color: #FFFFFF;
			margin-top: 120rpx;
		}
		.dian{
			width: 648rpx;
			height: 648rpx;
			background: url(@/static/yuyin-bg2.png) center top no-repeat;
			background-size: 100% auto;
			margin: 0 auto;
			margin-top: 50rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			.user{
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: -10rpx;
				margin-left: 20rpx;
				.items{
					width: 290rpx;
					position: relative;
					z-index: 5;
					image{
						width: 290rpx;
						height: 86rpx;
					}
				}
				.item{
					width: 180rpx;
					position: relative;
					height: 180rpx;
					.avatar{
						width: 180rpx;
						height: 180rpx;
						border-radius: 50%;
					}
					.txt{
						font-weight: 500;
						font-size: 28rpx;
						color: #FFFFFF;
						margin-top: 10rpx;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
						overflow: hidden;
						width: 180rpx;
					}
					.pic{
						width: 180rpx;
						position: relative;
						left: -30rpx;
						z-index: 2;
						.avatar1{
							width: 180rpx;
							height: 180rpx;
							border-radius: 50%;
							opacity: 0.5;
							position: absolute;
							left: 0;
							top: 0;
							z-index: 3;
						}
						.avatar2{
							width: 180rpx;
							height: 180rpx;
							border-radius: 50%;
							opacity: 0.3;
							position: absolute;
							left: 30rpx;
							top: 0;
							z-index: 2;
						}
					}
					
				}
			}
		}
		.dian-on{
			width: 648rpx;
			min-height: 648rpx;
			background: url(@/static/yuyin-bg2.png) center top no-repeat;
			background-size: 100% auto;
			margin: 0 auto;
			margin-top: 150rpx;
			.tag{
				width: 660rpx;
				height: 330rpx;
				background: rgba(35, 32, 48, 0.36);
				border-radius: 20rpx;
				margin: 0 auto;
				padding: 30rpx;
				box-sizing: border-box;
				text-align: left;
				margin-top: 30rpx;
				.titles{
					font-weight: bold;
					font-size: 30rpx;
					color: #FFFFFF;
				}
				.descs{
					line-height: 45rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #B8B7BC;
					margin-top: 20rpx;
				}
			}
			.info{
				width: 100%;
				text-align: center;
				overflow: hidden;
				image{
					width: 180rpx;
					height: 180rpx;
					border-radius: 50%;
				}
				.name{
					font-weight: 500;
					font-size: 28rpx;
					color: #FFFFFF;
					margin-top: 10rpx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					overflow: hidden;
					text-align: center;
					margin-top: 10rpx;
				}
				.btn{
					width: 170rpx;
					line-height: 56rpx;
					background: linear-gradient(0deg, #FF9124, #BD4700);
					border-radius: 56rpx;
					font-weight: bold;
					font-size: 30rpx;
					color: #FFFFFF;
					margin: 0 auto;
					margin-top: 20rpx;
				}
				.txt{
					font-weight: 500;
					font-size: 26rpx;
					color: #FFFFFF;
					margin-top: 20rpx;
					opacity: 0.3;
				}
			}
		}
	}
	&-start{
		width: 100%;
		position: absolute;
		left: 0;
		bottom: 130rpx;
		z-index: 21;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.item{
			flex: 1;
			text-align: center;
			font-weight: 500;
			font-size: 24rpx;
			color: rgba(255, 255, 255, 0.4);
			text-align: center;
			image{
				width: 130rpx;
				height: 130rpx;
				display: block;
				margin: 0 auto;
				border-radius: 50%;
				margin-bottom: 20rpx;
			}
		}
	}
	&-end{
		width: 100%;
		position: absolute;
		left: 0;
		bottom: 140rpx;
		z-index: 21;
		.send{
			width: 100%;
			text-align: center;
			font-weight: 500;
			font-size: 30rpx;
			color: #FFFFFF;
		}
		.todo{
			width: 100%;
			text-align: center;
			margin-top: 30rpx;
			image{
				width: 60rpx;
				height: 60rpx;
			}
		}
	}
}
</style>
