<template>
	<view class="my-box">
		<navs :top='top' :page='pageName' :color='color'></navs>
		<image class="my-bg" src="@/static/image/my-bg.png" mode=""></image>
		<view class="my">
			<image src="@/static/image/default-avatar.svg" mode="" @click="goTo(0)"></image>
			<view class="nickname" @click="goTo(0)">我是昵称昵称</view>
			<view class="iconfont icon-Group105" @click="goTo(3)"></view>
		</view>
		<view class="my-use">
			<view @click="goTo(1)">
				<view class="iconfont icon-Group-4"></view>
				<view class="use-text">我的项目</view>
				<view class="iconfont icon-tubiaoyanse"></view>
			</view>
			<view @click="goTo(2)">
				<view class="iconfont icon-Group-3"></view>
				<view class="use-text">公司介绍</view>
				<view class="iconfont icon-tubiaoyanse"></view>
			</view>
			<view @click="tel()">
				<view class="iconfont icon-Group-2"></view>
				<view class="use-text">联系我们</view>
				<view class="iconfont icon-tubiaoyanse"></view>
			</view>
			<view>
				<view class="iconfont icon-Group-1-1"></view>
				<view class="use-text">退出登录</view>
				<view class="iconfont icon-tubiaoyanse"></view>
			</view>
			<uni-popup ref="tel" type="center">
				<view class="tel-box">
					<view class="tel-line">
						<text>手机号</text>
						<input class="uni-input" placeholder-style="color:#D8D8D8" placeholder="请输入手机号" style="width: 437rpx;height: 88rpx;"/>
					</view>
					<view class="tel-line">
						<text style="line-height: 88rpx;">备注</text>
						<textarea class="notes" placeholder-style="color:#D8D8D8" placeholder="选填" style="width: 437rpx;height: 150rpx;"/>
					</view>
					<view class="tel-btn">确定</view>
				</view>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageName: '个人中心',
				color: 0,
				top: 0
			}
		},
		onLoad() {
			this.top = uni.getMenuButtonBoundingClientRect().top;
		},
		methods: {
			goTo(i) {
				switch (i) {
					case 0:
						uni.navigateTo({
							url: '/pages/myInfo/myInfo'
						})
						break;
					case 1:
						uni.navigateTo({
							url: '/pages/myProject/myProject'
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/pages/companyProfile/companyProfile'
						})
						break;
					case 3:
						uni.navigateTo({
							url: '/pages/notice/notice'
						})
						break;
				}
			},
			tel() {
				this.$refs.tel.open()
			},
		}
	}
</script>

<style lang="scss">
	.my-box {
		position: relative;
	}

	.my-bg {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 406rpx;
		z-index: -10;
	}

	.my {
		display: flex;
		align-items: center;
		margin-top: 45rpx;

		image {
			width: 120rpx;
			height: 120rpx;
			border-radius: 50%;
			margin-left: 34rpx;
		}

		.nickname {
			flex: 1;
			margin-left: 24rpx;
			font-weight: 500;
			font-size: 36rpx;
			color: #fff;
		}

		.icon-Group105 {
			margin-right: 38rpx;
			font-size: 36rpx;
			color: #fff;
		}
	}

	.my-use {
		border-radius: 40rpx;
		padding: 0 28rpx;
		background-color: #fff;
		margin-top: 35rpx;

		>view {
			height: 116rpx;
			border-bottom: 1rpx solid #F0F0F0;
			display: flex;
			line-height: 116rpx;
			font-size: 32rpx;
			color: #222;

			.icon-tubiaoyanse {
				font-size: 24rpx;
				color: #A4A4A4;
			}

			.use-text {
				flex: 1;
				margin-left: 17rpx;
			}
		}
	}

	.tel-box {
		width: 628rpx;
		height: 462rpx;
		border-radius: 40rpx;
		background: #ffffff;
		padding: 38rpx 24rpx;
		box-sizing: border-box;
		font-size: 28rpx;
		font-weight: 500;
		.tel-line{
			display: flex;
			justify-content: space-between;
			border-radius: 12rpx;
			background-color: #F8F8F8;
			margin-top: 25rpx;
			padding-left: 31rpx;
			&:first-child{
				height: 88rpx;
				margin-top: 0;
				line-height: 88rpx;
			}
			.uni-input,.notes{
				padding-right: 23rpx;
				text-align: right;
			}
			.uni-input::placeholder,.notes::placeholder{
				text-align: left;
				direction: rtl;
			}
			.notes{
				padding-top: 24rpx;
			}
			
		}

		.tel-btn {
			width: 303rpx;
			height: 76rpx;
			border-radius: 12rpx;
			background: #3887fd;
			margin: 44rpx auto 0;
			color: #fff;
			font-size: 30rpx;
			font-weight: 500;
			text-align: center;
			line-height: 76rpx;
		}
	}
</style>
