<template>
	<view class="body">
		<view class="background"></view>
		<view class="content">
			<view class="userInfo">
				<view class="userInfo-box">
					<view class="userInfo-img">
						<image class="portrait" :src="image || '../../static/error/missing-face.png'"></image>
					</view>
					<view class="userInfo-xinxi">
						<view class="title clamp">
							李丹丹
						</view>
						<view class="phone">
							好评总数：10251
						</view>
					</view>
					<view class="balance">当前余额：200</view>
				</view>
				<view class="user-money flex">
					<view class="user-money-item" @click="navTo('/pages/user/yue')">
						<view class="user-money-num">{{ userInfo.now_money*1 || 0 }}</view>
						<view class="user-money-font"> 累计金额</view>
					</view>
					<view class="user-xian"></view>
					<view class="user-money-item" @click="navTo('/pages/user/award')">
						<view class="user-money-num">{{ userInfo.brokerage_price*1 || 0 }}</view>
						<view class="user-money-font">待处理单数</view>
					</view>
					<view class="user-xian"></view>
					<view class="user-money-item" @click="navTo('/pages/user/sz')">
						<view class="user-money-num">{{ userInfo.integral*1 || 0 }}</view>
						<view class="user-money-font">完成单数</view>
					</view>
				</view>
			</view>
			<view class="userInfoList">
				<view class="userInfoList-bottom" @click="navTo('/pages/user/yue')">
					<image src="../../static/icon/admin1.png" mode="" class="bottom">
						余额管理
				</view>
				<view class="userInfoList-bottom" @click="navTo('/pages/user/spread')">
					<image src="../../static/icon/admin2.png" mode="" class="bottom">
						我的推广
				</view>
				<view class="userInfoList-bottom" @click="navTo('/pages/order/orderAdmin')">
					<image src="../../static/icon/admin3.png" mode="" class="bottom">
						订单管理
				</view>
				<view class="userInfoList-bottom" @click="navTo('/pages/merchant/commodity')">
					<image src="../../static/icon/admin4.png" mode="" class="bottom">
						服务评价
				</view>
				<view class="userInfoList-bottom" @click="navTo('/pages/user/team')">
					<image src="../../static/icon/admin5.png" mode="" class="bottom">
						我的团队
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				type: '',
				image: '',
				name: '',
				phone: '',
				address: '',
				code: ''
			};
		},
		onLoad() {

		},
		computed: {
			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
		},
		methods: {
			//跳转
			navTo(url) {
				uni.navigateTo({
					url
				});
			},
		}
	};
</script>

<style lang="scss">
	page {
		height: 100%;
		background-color: #eeeded;
		padding: 0;
		margin: 0;
	}

	.content {
		background-color: #eeeded;
		margin: 0 30rpx;
		display: flex;
		flex-direction: column;
	}

	.background {
		width: 100%;
		height: 220rpx;
		background-color: $base-color;
	}

	.userInfo {
		margin-top: -110rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #f9f9f9;
		border-radius: 19rpx;
		width: 100%;
		margin-bottom: 20rpx;
		padding-bottom: 30rpx;

		.userInfo-box {
			display: flex;
			flex-direction: column;
			align-items: center;

			.userInfo-img {
				margin: -65rpx 0 0 0;
				width: 130rpx;
				height: 130rpx;
				border: 5rpx solid #fff;
				border-radius: 50%;

				image {
					border-radius: 50%;
					width: 100%;
					height: 100%;
				}
			}

			.userInfo-xinxi {
				.title {
					margin: 20rpx 0;
					font-size: 32rpx;
					font-weight: bold;
					color: #333333;
					text-align: center;
				}

				.phone {
					font-size: 28rpx;
					font-weight: 500;
					color: #666666;
				}
			}

			.balance {
				margin-top: 10rpx;
				text-align: center;
				width: 500rpx;
				background: $base-color;
				border-radius: 30rpx;
				font-size: 28rpx;
				font-weight: 500;
				color: #ffffff;
				line-height: 60rpx;
			}
		}
	}

	.userInfoList {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.userInfoList-bottom {
			margin-bottom: 15rpx;
			width: 340rpx;
			height: 250rpx;
			background: #f9f9f9;
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.bottom {
				margin-bottom: 20rpx;
				width: 68rpx;
				height: 68rpx;
			}
		}
	}

	.user-money {
		width: 100%;
		margin-top: 50rpx;
		justify-content: center;

		.user-money-item {
			width: 50%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.user-money-num {
				font-size: 36rpx;
				font-weight: bold;
			}

			.user-money-font {
				margin-top: 20rpx;
				font-size: 24rpx;
				font-weight: 500;
			}
		}

		.user-xian {
			width: 1px;
			height: 77rpx;
			background: #eeeeee;
		}
	}
</style>