<template>
	<view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
		<cus-header title='我的' bgColor="transparent" :showback="false"></cus-header>
		<image class="topbg" :src="imgBase+'my_topbg.png'" mode="widthFix"></image>
		<div class="box">
			<div class="top adfacjb">
				<div class="top-left adfac">
					<div class="top-left-img">
						<image :src="userInfo.avatar"></image>
					</div>
					<div class="top-left-info">
						<div class="top-left-info-name">{{userInfo.name||'未登录'}}</div>
						<div class="top-left-info-tip" v-if="!userInfo.name">点击立即登录</div>
						<div class="top-left-info-version" v-else>{{'基础版'}}</div>
					</div>
				</div>
				<div class="top-right">
					<image :src="imgBase+'my_set.png'"></image>
				</div>
			</div>
			<div class="num adf">
				<div class="num-pre adffcac">
					<div class="num-pre-sz">{{0}}</div>
					<div class="num-pre-text">基础版次数</div>
				</div>
				<div class="num-pre adffcac">
					<div class="num-pre-sz">{{0}}</div>
					<div class="num-pre-text">专业版次数</div>
				</div>
				<div class="num-pre adffcac">
					<div class="num-pre-sz">{{0}}</div>
					<div class="num-pre-text">我的团队</div>
				</div>
			</div>
			<div class="preill adfacjb">
				<div class="preill-left">{{userInfo.name?'已激活，深入了解支撑高价值团队的关键因素':'尚未激活问卷，无法开始PREILL评估'}}</div>
				<div class="preill-right" @click="handleActiveDetail">{{userInfo.name?'查看详情':'立即激活'}}</div>
			</div>
			<div class="menu">
				<div class="menu-item adfacjb" v-for="(item,index) in menuList" :key="index" @click="handleTurn(item.path)">
					<div class="menu-item-left adfac">
						<image :src="item.img"></image>
						<text>{{item.title}}</text>
					</div>
					<image class="menu-item-right" :src="imgBase+'my_arrow_right.png'"></image>
				</div>
			</div>
		</div>
		<Tabbar :tabbarIndex="2"></Tabbar>
	</view>
</template>

<script>
	import Tabbar from '@/components/CusTabbar/index.vue'
	export default {
		components:{ Tabbar },
		data(){
			return {
				userInfo:{
					avatar:this.$imgBase+'my_avatar.png',
					name:''
				},
				menuList:[
					{
						img:this.$imgBase+'my_order.png',
						title:'我的订单',
						path:''
					},
					{
						img:this.$imgBase+'my_record.png',
						title:'推荐记录',
						path:'/pagesMy/recommendHistory'
					},
					{
						img:this.$imgBase+'my_program.png',
						title:'我的项目',
						path:''
					},
					{
						img:this.$imgBase+'my_teamusers.png',
						title:'团队成员',
						path:''
					},
					{
						img:this.$imgBase+'my_friends.png',
						title:'邀请好友',
						path:''
					}
				]
			}
		},
		onLoad() {
			
		},
		methods:{
			handleTurn(url){
				if(!url) return
				uni.navigateTo({ url })
			},
			handleActiveDetail(){
				let url = '/pagesPublish/rechargeCenter'
				if(this.userInfo.name) url = '';
				url && uni.navigateTo({ url })
			}
		}
	}
</script>

<style scoped lang="scss">
	.tabPage{
		.topbg{
			width: 100%;
			position: absolute;
			left: 0;
			top: 0;
		}
		
		.box{
			position: relative;
			padding-top: 40rpx;
			
			.top{
				padding: 0 22rpx 0 16rpx;
				&-left{
					&-img{
						image{
							width: 128rpx;
							height: 128rpx;
						}
					}
					&-info{
						margin-left: 20rpx;
						&-name{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 40rpx;
							color: #002846;
							line-height: 40rpx;
						}
						&-tip{
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 26rpx;
							color: #86909C;
							line-height: 26rpx;
							margin-top: 31rpx;
						}
						&-version{
							width: 129rpx;
							height: 40rpx;
							background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_version_bg.png') no-repeat;
							background-size: 100% 100%;
							padding-left: 48rpx;
							box-sizing: border-box;
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 22rpx;
							color: #795021;
							line-height: 40rpx;
							margin-top: 24rpx;
						}
					}
				}
				&-right{
					image{
						width: 42rpx;
						height: 42rpx;
					}
				}
			}
		
			.num{
				margin-top: 48rpx;
				&-pre{
					width: calc(100% / 3);
					&-sz{
						font-family: D-DINCondensed, D-DINCondensed;
						font-weight: bold;
						font-size: 48rpx;
						color: #002846;
						line-height: 48rpx;
					}
					&-text{
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #86909C;
						line-height: 26rpx;
						text-align: center;
						margin-top: 24rpx;
					}
				}
			}
		
			.preill{
				margin-top: 49rpx;
				background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/my_pinggu_bg.png') no-repeat;
				background-size: 100% 100%;
				padding: 34rpx 24rpx;
				&-left{
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #B0B7C7;
					line-height: 24rpx;
					padding-top: 42rpx;
				}
				&-right{
					padding: 18rpx 26rpx;
					background: linear-gradient( 270deg, #F0E2C7 0%, #E3CD9E 100%);
					border-radius: 32rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: #795021;
					line-height: 26rpx;
				}
			}
		
			.menu{
				margin-top: 30rpx;
				background: #FFFFFF;
				border-radius: 16rpx;
				&-item{
					padding: 35rpx 30rpx;
					box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
					&-left{
						image{
							width: 40rpx;
							height: 40rpx;
						}
						text{
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 30rpx;
							color: #002846;
							line-height: 32rpx;
							margin-left: 21rpx;
						}
					}
					&-right{
						width: 36rpx;
						height: 36rpx;
					}
				}
			}
		}
	}
</style>