<template>
	<view class="main">
		<view class="personalnformation">
			<image class="hread" :src="userInfo.avatar"></image>
			<view class="user_info">
				<view class="user_name">{{userInfo.userName}}</view>
				<view class="user_phone">{{userInfo.mobile}}</view>
			</view>
		</view>
		<view class="bgMian">
			<view class="clock" @click="clockIn">
				<view class="clockItem">
					<view>
						<image class="hread" src="../../static/hoem/ic_clock_in.png">
					</view>
					<view class="flex-column flex-row-around">
						<view class="textCommon">每日打卡</view>
						<view class="contentCommon">每日签到打卡</view>
					</view>
				</view>
				<view>
					<image class="left" src="../../static/hoem/ic_left.png"></image>
				</view>
			</view>
			<view class="clock" @click="personalInfo">
				<view class="clockItem">
					<view>
						<image class="hread" src="../../static/hoem/ic_my_info.png">
					</view>
					<view class="flex-column flex-row-around">
						<view class="textCommon">个人信息</view>
						<view class="contentCommon">点击这里查看编辑自己的基础信息</view>
					</view>
				</view>
				<view>
					<image class="left" src="../../static/hoem/ic_left.png"></image>
				</view>
			</view>
			<view class="clock" @click="$wskj.to('/pages/about')">
				<view class="clockItem">
					<view>
						<image class="hread" src="../../static/hoem/ic_about.png">
					</view>
					<view class="flex-column flex-row-around">
						<view class="textCommon">关于我们</view>
						<view class="contentCommon">点击这里更快了解我们</view>
					</view>
				</view>
				<view>
					<image class="left" src="../../static/hoem/ic_left.png"></image>
				</view>
			</view>
			<view class="clock" @click="$wskj.to('/pages/Bluetooth')">
				<view class="clockItem">
					<view>
						<image class="hread" src="../../static/hoem/ic_version.png">
					</view>
					<view class="flex-column flex-row-around">
						<view class="textCommon">蓝牙配网</view>
						<view class="contentCommon">为厕纸机配网！</view>
					</view>
				</view>
				<view>
					<image class="left" src="../../static/hoem/ic_left.png"></image>
				</view>
			</view>
			<view class="clock">
				<view class="clockItem">
					<view>
						<image class="hread" src="../../static/hoem/ic_version.png">
					</view>
					<view class="flex-column flex-row-around">
						<view class="textCommon">当前版本</view>
						<view class="contentCommon">Ver{{version}}</view>
					</view>
				</view>
				<!-- <view>
					<image class="left" src="../../static/hoem/ic_left.png"></image>
				</view> -->
			</view>

			
			<view class="excLogin" @click="excLogin">退出登录</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {
					userName: '',
					mobile: '',
					avatar: '../../static/iv_wx.png'
				},
				version:'1.0.0'
			}
		},
		onLoad() {
		},
		onShow() {
			//#ifdef APP
			// this.version=uni.getSystemInfoSync().version
			// console.log(version)
			//#endif
			const params = {
				url: '/getInfo',
				data: {},
				method: 'GET',
			}
			this.$request(params).then(res => {
				if (res.user.avatar) {
					this.userInfo.avatar = res.user.avatar
				}
				this.userInfo.userName = res.user.nickName
				this.userInfo.mobile = res.user.phonenumber
			})
		},
		methods: {
			excLogin(){
				uni.reLaunch({
					url: '/pages/index/index'
				})
			},
			personalInfo() {
				uni.navigateTo({
					url: '/pages/personalInfo/personalInfo'
				})
			},
			clockIn() {
				uni.navigateTo({
					url: '/pages/clockIn/clockIn'
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F8F4F4;
	}
	.excLogin{
		width: 702rpx;
		height: 96rpx;
		background: linear-gradient( 90deg, #FFBFBC 0%, #FB262A 100%);
		border-radius: 48rpx;
		text-align: center;
		line-height: 96rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 600;
		font-size: 28rpx;
		margin-top: 20rpx;
		color: #fff;
	}
	.main {
		.bgMian {
			background: #F8F4F4;
			padding: 20rpx;
			border-radius: 30rpx 30rpx 0rpx 0rpx;
			margin-top: -190rpx;

			.textCommon {
				padding-left: 10rpx;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
			}

			.contentCommon {
				padding-left: 10rpx;
				margin-top: 10rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #999999;
			}

			.clock {
				margin-top: 20rpx;
				justify-content: space-between;
				display: flex;
				background: #FFFFFF;
				align-items: center;
				border-radius: 14rpx 14rpx 14rpx 14rpx;

				.clockItem {
					display: flex;
					padding: 20rpx;

					.hread {
						width: 100rpx;
						height: 100rpx;
					}
				}

				.left {
					width: 8rpx;
					height: 16rpx;
					padding-right: 20rpx;
					align-items: center;
				}
			}
		}

		.personalnformation {
			height: 353rpx;
			padding-top: 90rpx;
			padding-left: 24rpx;
			display: flex;
			background: linear-gradient(91deg, #FCD4D2 0%, #FDEDEE 100%);

			.user_info {
				padding-left: 25rpx;
				padding-top: 13rpx;

				.user_name {
					font-weight: bold;
					font-size: 32rpx;
					color: #000000;
				}

				.user_phone {
					font-weight: 400;
					font-size: 24rpx;
					color: #000000;
				}
			}

			.hread {
				width: 110rpx;
				height: 110rpx;
			}
		}
	}
</style>