<template>
	<view>
		<public-module></public-module>
		<view class="headers " :style="headerStyle">
			<view class="dis a-c j-c">
				<text>首页</text>
			</view>
		</view>
		<!-- <image style="position: relative;height:230px" src="../../static/beijing.png"></image> -->
		<!-- <image v-if="type == 1" style="position: relative;height:230px" src="../../static/shouye1.png"></image> -->
		<view class="Personnel">
			<view class="avatar">
				<image src="/static/img/Frame (8).png"  mode=""></image>
				<text>团队新人员加入信息/新出单信息</text>
			</view>
			<uni-notice-bar show-icon scrollable text="uni-app 版正式发布，开发一次，同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
		<!-- <view class="homepage" style="position: absolute;padding: 0px 20px;    top: 170px;">
			<view class="wallet" @click="bankwallet()">
				<view>钱包</view>
				<view>查看金额与记录</view>
			</view>
			<view class="wallet" @click="detail()">
				<view>绑定银行卡</view>
				<view>提现请先绑定</view>
			</view>
		</view> -->
		</view>
		<view class="insurance dis j-s" >
			<view style="text-align: center;">
				<view class="insurance-cash" >{{totalList.sumPremium}}</view>
				<text class="insurance-text">总保费	</text>
			</view>
			<view style="text-align: center;">
				<view class="insurance-cash">{{totalList.teamManNum }}</view>
				<text class="insurance-text">总人数	</text>
			</view>
			<view style="text-align: center;">
				<view class="insurance-cash">{{totalList.extractFee}}</view>
				<text class="insurance-text">总佣金</text>
			</view>
		</view>
		<view >
			<view class="institutional-data" v-if="type == 2">
			<view class="inst-con" @click="closeStudion()">
				<view>工作室</view>
				<text >{{totalList.workroomTeamNum}}</text>
			</view>
				<!-- <view class="institutional-title homepage">
					<text>团队贡献数据</text>
					<text   @click="viewTeam()" class="view-now" style="font-size: 11px;" >查看更多</text>
				</view>
				<o-empty   height="15vh" v-if="totalList1.length==0" />
				<view class="institutional-list" v-if="totalList1.length > 0">
					<view style="padding: 10px 0;">
						<view class="homepage" style="font-size: 13px;font-weight: 500;">
							<text>{{ totalList1[0].deptName }}</text>
						</view>
						<view class="dis j-s">
							<view type="primary" size="mini">负责人：{{ totalList1[0].userName }}</view>
							<text @click="closeDetailPro(totalList1[0])" class="view-now1"
								>查看详情</text>
						</view>
					</view>
					<view style="padding: 10px 0;border-top: 1px solid #ccc" v-if="totalList1.length > 1">
						<view class="homepage" style="font-size: 13px;font-weight: 500;">
							<text>{{ totalList1[1].deptName }}</text>
						</view>
						<view class="dis j-s">
							<view type="primary" size="mini">负责人：{{ totalList1[1].userName }}</view>
							<text class="view-now1" @click="closeDetailPro(totalList1[1])"
								>查看详情</text>
						</view>
					</view>
				</view> -->
			</view>
			<view class="inst-data dis j-s" v-if="type == 1">
				<view class="inst-con" @click="closePartner()">
					<view>合伙人</view>
					<text >{{totalList.partnerNum}}</text>
				</view>
				<view class="inst-con" @click="closeInstitution()">
					<view>工作室</view>
					<text >{{totalList.workroomNum}}</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			totalList:{},
			type: uni.getStorageSync('type'),
			headerStyle: {
				backgroundColor: 'transparent',
				backgroundImage: '',
				backgroundSize: '',
				backgroundPosition: '',
				boxShadow: ''
				// 其他样式属性...
			},
			// type:JSON.parse(localStorage.getItem('type')).data
		}
	},
	async onLoad(e) {
		this.type = uni.getStorageSync('type')
		let res = await this.$http.get('/APPPartner/getHomePage', {
			type: uni.getStorageSync('type'),
		});
		if (res.code == '200') {
			this.totalList = res.data
		}
	
	},
	methods: {
		detail(id){
			uni.navigateTo({
				url: "/pages/institutional/walletDetail?id="+id
			})
		},
		closeDetailPro(val){
				uni.navigateTo({
					url: `/pages/institutional/detail?deptId=${val.deptId}&deptName=${val.deptName}&startTime=${val.startTime}`
				})
			},
		
		closeInstitution() {
			this.totalList.type=1
			uni.navigateTo({
				url: "/pages/institutional/institutionalTeam?key="+encodeURIComponent(JSON.stringify(this.totalList))
			})
		},
		closeStudion() {
			uni.navigateTo({
				url: "/pages/institutional/institutional?key="+encodeURIComponent(JSON.stringify(this.totalList))
			})
		},
		closePartner() {
			uni.navigateTo({
				url: "/pages/institutional/partner"
			})
		},
		viewTeam() {
			uni.navigateTo({
				url: "/pages/institutional/institutional" 
			})
		},
		bankCard() {
			uni.navigateTo({
				url: "/pages/wallet/bankCard"
			})
		},
		bankwallet() {
			uni.navigateTo({
				url: "/pages/institutional/wallet"
			})
		},
	}
}
</script>
<style lang="scss" scoped>


.homepage {
	display: flex;
	width: 100%;
	justify-content: space-between;
}

.homepage>view {
	width: 47%;
	height: 100px;
	// min-height: 18vh;
	// max-height: 22vh;
	background-size: contain;
}

.wallet {
	padding: 15upx 20upx;
}

.wallet>view:nth-child(1) {
	color: #333333;
	font-size: 14px;
	font-weight: bold;
}

.wallet>view:nth-child(2) {
	margin-top: 5upx;
	font-size: 12px;
	color: rgba(51, 51, 51, 0.8);
}

.homepage>view:nth-child(1) {
	background: url(../../static/qianbao.png) no-repeat;
	background-size: 100% 100%;
}

.homepage>view:nth-child(2) {
	background: url(../../static/yinhangka.png) no-repeat;
	background-size: 100% 100%;
}

.institutional-data {
	margin: 16px;
	.inst-con {
		padding: 13px 18px;
		width: 100%;
		background: url(../../static/工作室.png) no-repeat;
		background-size: 100% 100%;
		color: #009B9F;
	}
}

// .institutional-title {
// 	padding: 10upx 10upx 20upx 10upx;
// 	font-weight: bold;

// 	text {
// 		font-size: 14px;
// 	}
// }

// .institutional-list {
// 	background: #FFFFFF;
// 	border-radius: 12px 12px 12px 12px;
// 	padding: 0 20upx;
// 	font-size: 38upx;

// }

.view-now {
	background: linear-gradient(90deg, #7E99D1 0%, #4F78B1 100%);
	border-radius: 20px 20px 20px 20px;
	color: #fff;
	font-size: 11px;
	padding: 2px 10px;
}
.view-now1{
	background-color: rgba(79, 120, 177, 0.1);
	color: #537BB4;
	border-radius: 20px 20px 20px 20px;
	font-size: 11px;
	padding: 2px 10px;
}
.homepage-title {
	margin-top: 5px;

	button {
		background-color: #FEF0E1;
		color: #FE8F1C;
	}
}

.homepage-title>button:last-child {
	background: #E6FAE3;
	color: #3AC716;
	margin-left: 10px;
}

.button1 {
	background-color: #FEF0E1;
	color: #FE8F1C;
	font-size: 11px;
	padding: 5px 10px
}

.button2 {
	background: #E6FAE3;
	color: #3AC716;
	margin-left: 10px;
	font-size: 11px;
	padding: 5px 10px
}

.inst-data {
	margin: 16px;
}

.inst-con {
	width: 47%;
	padding: 13px 18px;
	}	
.inst-con>view:nth-child(1) {
	font-size: 19px;
	font-weight: 700;
}

.inst-con>view:nth-child(2) {
	font-size: 13px;
	font-weight: 400;
}

.inst-data>view:nth-child(1) {
	background: url(../../static/合伙人.png) no-repeat;
	background-size: 100% 100%;
	color: #3168DA;
}

.inst-data>view:nth-child(2) {
	background: url(../../static/工作室.png) no-repeat;
	background-size: 100% 100%;
	color: #009B9F;
}
.headers {
		position: fixed;
		top: 0;
		left: 0;
		height: auto;
		width: 100%;
		z-index: 999999;
		padding: 16px;
		padding-top: 40px;

		>view {
			width: 100%;
			height: 100%;
			position: relative;
		}
		text {
			font-size: 18px;
			font-weight: 700;
			color: #333333;
		}
	}
	.Personnel {
		height: auto;
		width: 100%;
		background: #F7F7F7;
		background-image: url("/static/beijing.png");
		background-size: 100% 100%;
		padding: 200px 16px 15px 16px;
	
		.avatar {
			background: #FFFFFF;
			box-shadow: 0px 0 8px 0px rgba(0,0,0,0.1);
			border-radius: 5px 5px 5px 5px;
			padding: 0 10px;
			line-height: 35px;
			height: 35px;
			image {
				display: inline-block;
				width: 16px;
				height: 16px;
				vertical-align: middle;
				margin-right: 5px;
			}
			
		}
		
	}
	.insurance{
		margin: 0 16px;
		background: #FFFFFF;
		box-shadow: 0px 0 8px 0px rgba(0,0,0,0.1);
		border-radius: 5px 5px 5px 5px;
		padding: 20px 30px;
		.insurance-cash{
			font-weight: 700;
			font-size: 21px;
			color: #333333;
			line-height: 24px;
			margin-bottom: 5px;
		}
		.insurance-text{
			font-weight: 300;
			font-size: 13px;
			color: #999999;
			line-height: 15px;
		}
	}
	.studio{
		margin:16px;
	}
</style>