<template>
	<view>
		<u-navbar title="微营业厅" title-color="#fff" :is-back="false" :background="background" back-icon-color="#ffffff"></u-navbar>
		<!-- 账户充值 扣费记录 -->
		<view class="function">
			<view class="item" @click="gotoUrl('/pages/businessHall/recharge/accountRecharge')">
				<view class="icon">
					<image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
				</view>

				<view class="text">
					<view class="title">
						账户充值
					</view>
					<view class="infos">
						余额 {{personInfo.balance}}

					</view>
				</view>
			</view>

			<view class="item" @click="gotoUrl('/pages/businessHall/deductionRecord/deductionRecord')">
				<view class="icon icon2">
					<image class="img" src="@/assets/img/iconPark-order.svg" mode=""></image>
				</view>

				<view class="text">
					<view class="title">
						扣费记录
					</view>
					<view class="infos">
						查看每日用电情况
					</view>
				</view>
			</view>
		</view>

		<!-- 管家服务 -->
		<view class="housekeeper-service">
			<view class="title">
				管家服务
			</view>
			<view class="grid">
				<u-grid :col="4" :border="false">
					<u-grid-item @click="gotoUrl('/pages/businessHall/recharge/rechargeRecord')" >
						<view class="icon icon1">
							<image class="img" src="@/assets/img/far fa-clock.svg" mode=""></image>
						</view>
						<view class="grid-text">充值记录
						</view>
					</u-grid-item>
					<u-grid-item  @click="gotoUrl('/pages/businessHall/billingRules/billingRules')" >
						<view class="icon icon2">
							<image class="img" src="@/assets/img/fas fa-file-alt.svg" mode=""></image>
						</view>
						<view class="grid-text">计费规则
						</view>
					</u-grid-item>
					<u-grid-item   @click="gotoUrl('/pages/businessHall/message/messageList?type=1')">
						<view class="icon icon3">
							<image class="img" src="@/assets/img/antFill-account-book.svg" mode=""></image>
						</view>
						<view class="grid-text">余额提醒
						</view>
					</u-grid-item>
					<u-grid-item   @click="gotoUrl('/pages/businessHall/message/messageList?type=4')">
						<view class="icon icon9">
							<image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
						</view>
						<view class="grid-text">断电通知
						</view>
					</u-grid-item>
					<u-grid-item   @click="gotoUrl('/pages/businessHall/message/messageList?type=2')">
						<view class="icon icon5">
							<image class="img" src="@/assets/img/antFill-notification.svg" mode=""></image>
						</view>
						<view class="grid-text">停电通知

						</view>
					</u-grid-item>
					<u-grid-item   @click="gotoUrl('/pages/businessHall/message/messageList?type=3')">
						<view class="icon icon6">
							<image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
						</view>
						<view class="grid-text">故障警报

						</view>
					</u-grid-item>
				
					<u-grid-item   @click="gotoUrl('/pages/businessHall/mine/electronicMonitoring')">
						<view class="icon icon7">
							<image class="img" src="@/assets/img/fas fa-chart-pie.svg" mode=""></image>
						</view>
						<view class="grid-text">用电监控
						</view>
					</u-grid-item>
					
					<u-grid-item     @click="gotoUrl('/pages/businessHall/mine/contactService')"  >
						<view class="icon icon4">
							<image class="img" src="@/assets/img/if-support.svg" mode=""></image>
						</view>
						<view class="grid-text">客服热线
						</view>
					</u-grid-item>
					<u-grid-item v-if="false"   @click="gotoUrl('/pages/businessHall/billingRules/billingRules')">
						<view class="icon icon8">
							<image class="img" src="@/assets/img/fas fa-book.svg" mode=""></image>
						</view>
						<view class="grid-text">用电常识
						</view>
					</u-grid-item>
				</u-grid>
			</view>
		</view>

		<view class="cover">
			<view class="text">
				预存余额 安心用电
			</view>
		</view>
		<u-divider border-color="#bbbbbb" half-width="80" color="#777777">荆鹏电管家 服务热线 <text
				class="tel">8121234</text></u-divider>
		<Tabbar :current="0"></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 {
				personInfo:{},
				background: {
					backgroundColor: '#3D86FF',
				}

			}
		},
		onLoad() {
			this.homePage()
		
		},
		methods: {
			
			homePage(){
				// uni.showLoading({
				// 	title: "加载中",
				// 	mask: true,
				// })
				
				API.homePage({
					
				}).then((response) => {
					//uni.hideLoading();
					this.personInfo=response.data.regUser;
					console.log(response.data.regUser)
				}).catch(error => {
					//uni.hideLoading();
					
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	//  账户充值 扣费记录 
	.function {
		background-color: #fff;
		padding: 56rpx 40rpx;
		display: flex;
		justify-content: space-between;

		.item {
			display: flex;
			align-items: center;

			.icon {
				width: 96rpx;
				height: 96rpx;

				border-radius: 12px;
				background: linear-gradient(180deg, rgba(93, 155, 255, 1) 0%, rgba(0, 97, 255, 1) 100%);
				display: flex;
				align-items: center;
				justify-content: center;

				.img {
					width: 64rpx !important;
					height: 64rpx !important;


				}
			}

			.icon2 {
				background: linear-gradient(179.2deg, rgba(96, 213, 124, 1) -0.62%, rgba(0, 161, 39, 1) 97.92%);
			}

			.text {
				margin-left: 16rpx;

				.title {
					color: rgba(51, 51, 51, 1);
					font-size: 36rpx;
				}

				.infos {
					color: rgba(119, 119, 119, 1);
					font-size: 24rpx;
					margin-top: 8rpx;
				}
			}
		}
	}

	// 管家服务
	.housekeeper-service {
		background-color: #fff;
		margin-top: 24rpx;
		padding: 32rpx;

		.title {
			font-size: 36rpx;
			color: #333333;
		}

		.grid-text {
			margin-top: 28rpx;
			color: rgba(51, 51, 51, 1);
		}

		.icon {
			width: 96rpx;
			height: 96rpx;
			border-radius: 24rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			.img {
				width: 56rpx;
				height: 56rpx;
			}
		}

		.icon1 {
			background: linear-gradient(181.79deg, rgba(117, 213, 224, 1) -1.13%, rgba(53, 153, 203, 1) 94.2%);
		}

		.icon2 {
			background: linear-gradient(179.2deg, rgba(168, 178, 238, 1) 6.28%, rgba(123, 123, 240, 1) 96.94%);
		}

		.icon3 {
			background: linear-gradient(180deg, rgba(121, 172, 255, 1) 0%, rgba(57, 132, 255, 1) 100%);
		}

		.icon4 {
			background: linear-gradient(180.82deg, rgba(247, 186, 154, 1) 0.58%, rgba(255, 128, 158, 1) 97.52%);
		}

		.icon5 {
			background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
		}

		.icon6 {
			background: linear-gradient(180.29deg, rgba(255, 214, 125, 1) 0.9%, rgba(255, 150, 0, 1) 100.4%);
		}

		.icon7 {
			background: linear-gradient(178.44deg, rgba(122, 232, 227, 1) 3.96%, rgba(57, 182, 182, 1) 100.6%);
		}

		.icon8 {
			background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
		}
		.icon9 {
			background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
		}
	}

	.cover {
		background: radial-gradient(at 100% 100%, rgba(194, 255, 216, 1) 3%, rgba(138, 182, 232, 1) 39%, rgba(82, 110, 248, 1) 100%);
		color: #ffffff;
		text-align: center;
		padding: 40rpx 0;
		margin: 24rpx 0;

		.text {
			font-size: 64rpx;
			// box-shadow: 0px 4px 12px 0px  rgba(0, 0, 0, 0.2);
			text-align: center;
		}
	}

	.tel {
		color: #1677FF;
		margin-left: 16rpx;
	}
</style>