<!-- 分销商信息  -->
<template>
	<!-- 用户资料 -->
	<view class="user-card ss-flex ss-col-bottom">
		<view class="card-top ss-flex ss-row-between">
			<view class="ss-flex">
				<view class="head-img-box">
					<image class="head-img" :src="sheep.$url.cdn(userInfo.avatar)" mode="aspectFill"></image>
				</view>
				<view class="ss-flex-col">
					<view class="user-name" style="color:white;">{{ userInfo.nickname }}</view>
				</view>
			</view>
		</view>
		<!-- 账户信息 -->
		<account-info />
	</view>

</template>

<script setup>
	import accountInfo from './account-info.vue';
	import sheep from '@/sheep';
	import BrokerageApi from '@/sheep/api/trade/brokerage';
	import {
		computed,
		reactive,
		onBeforeMount
	} from 'vue';
	import {
		fen2yuan
	} from '@/sheep/hooks/useGoods';
	const userInfo = computed(() => sheep.$store('user').userInfo);
	const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');


	const state = reactive({
		showMoney: false,
	});

	async function getAgentInfo() {
		const {
			code,
			data
		} = await BrokerageApi.getBrokerageUserSummary();
		if (code !== 0) {
			return;
		}
		state.summary = data;
	}
	onBeforeMount(async () => {
		getAgentInfo();
		// 概要数据
		let {
			data
		} = await BrokerageApi.getBrokerageUserSummary();
		state.arr = data;
	});
</script>

<style lang="scss" scoped>
	// 用户资料卡片
	.user-card {
		width: 100%;
		height: 580rpx;
		// margin: -88rpx 20rpx 0 20rpx;
		background: url('https://zysc.fjptzykj.com/admin-api/infra/file/25/get/ae736076156e99710f417fe5619cd0be47a2fad082a192dbbd6dcbc2bbc65eea.png') no-repeat;
		// background: url('https://zysc.fjptzykj.com/admin-api/infra/file/25/get/4bcaa2803c9cc953353d22db804b952b333e97d2a0d57266a00baf0c07379efa.png') no-repeat;
		// background:#ff3000;
		background-size: 100% 100%;
		display: flex;
		flex-wrap: wrap;

		.head-img-box {
			margin-right: 20rpx;
			width: 62rpx;
			height: 62rpx;
			border-radius: 50%;
			position: relative;
			background: #fce0ad;

			.head-img {
				width: 62rpx;
				height: 62rpx;
				border-radius: 50%;
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}
		}

		.card-top {
			box-sizing: border-box;
			margin-top: 46px;
			margin-left: 16px;

			.user-name {
				font-size: 32rpx;
				font-weight: bold;
				color: #692e04;
				line-height: 30rpx;
			}

			.log-btn {
				width: 84rpx;
				height: 42rpx;
				border: 2rpx solid rgba(#ffffff, 0.33);
				border-radius: 21rpx;
				font-size: 22rpx;
				font-weight: 400;
				color: #ffffff;
				margin-bottom: 20rpx;
			}

			.look-btn {
				color: #fff;
				width: 40rpx;
				height: 40rpx;
			}
		}

		.user-info-box {
			.tag-box {
				background: #ff6000;
				border-radius: 18rpx;
				line-height: 36rpx;

				.tag-img {
					width: 36rpx;
					height: 36rpx;
					border-radius: 50%;
					margin-left: -2rpx;
				}

				.tag-title {
					font-size: 24rpx;
					padding: 0 10rpx;
					font-weight: 500;
					line-height: 36rpx;
					color: #fff;
				}
			}
		}
	}
</style>