<template>
	<view>
		<view class="background">
			<!-- 个人信息 -->
			<view class="person-infos">
				<view class="photo">
					<image class="img" src="@/assets/img/photo@x1.png" mode=""></image>
				</view>
				<view class="else">
					<view class="name">
						{{personInfo.contacts}}
					</view>
					<view class="company">
						{{personInfo.companyName}}
					</view>
					
				</view>
			</view>
			<!-- 地址 -->
			<view class="address-box">
				<view class="address">
					<view class="address-title">
						荆鹏软件园
					</view>
					<view class="address-value">
						<u-icon name="map"></u-icon>荆州市沙市区江津东路附155号
					</view>
				</view>
				<!-- 切换 -->
				<view class="switch" v-if="false">
					切换园区
				</view>
			</view>
		</view>
		<!-- 功能 -->
		<view class="function-group">
			<view class="function-item" >
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-contacts-book-line.svg" mode=""></image>
				</view>
				<view class="name">
					用户信息
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			<view class="function-item" v-if="false">
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-pie-chart-line.svg" mode=""></image>
				</view>
				<view class="name">
					用电监控
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
			<view class="function-item" v-if="false">
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-book-2-line.svg" mode=""></image>
				</view>
				<view class="name">
					用电常识
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
			<view class="function-item" >
				<view class="icon">
					<image class="img" src="@/assets/img/iconPark-order2.svg" mode=""></image>
				</view>
				<view class="name">
					发票管理
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
			<view class="function-item">
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-customer-service-2-line.svg" mode=""></image>
				</view>
				<view class="name">
					客服热线
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
		</view>
		
		<view class="function-group" v-if="false">
			<view class="function-item">
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-user-settings-line.svg" mode=""></image>
				</view>
				<view class="name">
					个人信息
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
		</view>
		
		<view class="function-group" >
			<view class="function-item">
				<view class="icon">
					<image class="img" src="@/assets/img/riLine-settings-2-line.svg" mode=""></image>
				</view>
				<view class="name">
					设置
				</view>
				<view class="arrow">
					<u-icon name="arrow-right" color="#b2b2b2"></u-icon>
				</view>
			</view>
			
		</view>
		
		<Tabbar :current="2" ></Tabbar>
	</view>
</template>

<script>
	import * as API from '@/apis/pagejs/hall/index.js'
	
	import Tabbar from '@/components/Tabbar.vue'
	export default {
		components: {
			Tabbar
		},
		data() {
			return {
				
			}
		},
		onLoad() {
			this.homePage()
		},
		methods: {
			homePage(){
				uni.showLoading({
					title: "加载中",
					mask: true,
				})
				
				API.homePage({
					
				}).then((response) => {
					uni.hideLoading();
					this.companyInfo=response.companyInfo;
				}).catch(error => {
					uni.hideLoading();
					
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.background{
		background: linear-gradient(180deg, rgba(194,219,255,1) 53%,rgba(180,211,255,0) 100%);
		padding: 72rpx 32rpx;
		// 个人信息
		.person-infos{
			display: flex;
			align-items: center;
			.photo{
				width: 112rpx;
				height: 112rpx;
				border-radius: 50px;
				.img{
					width: 100%;
					height: 100%;
				}
			}
			.else{
				margin-left: 24rpx;
				.name{
					color: rgb(16,16,16);
					font-size: 36rpx;
				}
				.company{
					color: rgba(16,16,16,1);
				}
			}
		}
		// 地址
		.address-box{
			border-radius: 8px;
			background: linear-gradient(90deg, rgba(49,110,207,1) 2%,rgba(20,73,159,1) 100%);
			color: #fff;
			padding: 32rpx;
			margin-top: 40rpx;
			display: flex;
			align-items: center;
			.address{
				.address-title{
					font-size: 40rpx;
				}
				.address-value{
					font-size: 24rpx;
					margin-top: 8rpx;
				}
			}
			// 切换
			.switch{
				margin-left: auto;
				width: 160rpx;
				height: 64rpx;
				line-height: 64rpx;
				border-radius: 50px;
				text-align: center;
				color: rgba(255,255,255,1);
				border: 1px solid rgba(255,255,255,1);
			}
		}
	}


// 功能
.function-group{
	border-radius: 8px;
	background-color: #fff;
	margin: 0 32rpx 24rpx;
	.function-item{
		display: flex;
		align-items: center;
		padding: 26rpx 26rpx 26rpx 0;
		margin-left: 26rpx;
		border-bottom: 1px solid rgba(221,221,221,1);
		.icon{
			width: 40rpx;
			height: 40rpx;
			.img{
				width: 100%;
				height: 100%;
			}
		}
		.name{
			color: rgba(51,51,51,1);
			font-size: 30rpx;
			margin-left: 26rpx;
		}
		.arrow{
			margin-left: auto;
		}
	}
}
</style>
