<template>
	<view class="common_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
		<cus-header title="公益档案" bgColor="transparent"></cus-header>
		<image src="https://oss.familydaf.cn/sxsnfile/20251218/811a8863a74d4ed9b86f68284eaff0c9.png" class="top_bg_img" mode="widthFix"></image>
		<div class="box box1">
			<div class="content">
				<div class="card">
					<div class="avatar">
						<image :src="avatar"></image>
					</div>
					<image class="logo" src="https://oss.familydaf.cn/sxsnfile/20251218/de06733ceb7f4178bf2e9e6d4ca22aa1.png"></image>
					<image class="heart" src="https://oss.familydaf.cn/sxsnfile/20251218/4b2c795dd0214ccb8bce4e099acfe0ed.png"></image>
					<div class="level">Lv.{{info?.userLevel||0}}</div>
					<div class="name-tip">昵称/NAME</div>
					<div class="name">{{info?.memberName||''}}</div>
					<div class="kh-tip">家庭公益口号</div>
					<div class="kh">{{info?.welfareSlogan||''}}</div>
					<div class="memo">亲爱的，从{{info?.activityStartTime||''}}至{{info?.activityEndTime||''}}，您的每一分善意都让世界更温暖！</div>
					<div class="gx-tip">爱心贡献/CONTRIBUTION</div>
					<div class="num" style="margin-top: 28rpx;">捐赠爱心值<text>{{info?.valueLimit||0}}</text></div>
					<div class="num">获得义工时长<text>{{info?.serviceHours||0}}</text>小时</div>
				</div>
			</div>
		</div>
		<div class="box box2">
			<image class="box-title" src="https://oss.familydaf.cn/sxsnfile/20251218/c4d1e2de2eba4844965af7ca2e26d527.png"></image>
			<div class="content">{{info?.experience||''}}</div>
		</div>
		<div class="box box2">
			<image class="box-title" src="https://oss.familydaf.cn/sxsnfile/20251218/454dfee71bc7424c83ebf4fdc71fc6c7.png"></image>
			<div class="content">
				<image class="img" v-for="(item,index) in imgs" :key="index" :src="item" mode="widthFix"></image>
			</div>
		</div>
		<div class="back" @tap="goBack">返回</div>
	</view>
</template>

<script setup name="">
	import CusHeader from '@/components/CusHeader/index.vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { ref, getCurrentInstance } from 'vue'
	const { proxy } = getCurrentInstance()
	
	const avatar = ref('https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png')
	const info = ref(null)
	const imgs = ref([])
	
	const goBack = () => {
		uni.navigateBack();
	}
	
	onLoad(options=>{
		// if(uni.getStorageSync('userInfo')){
		// 	avatar.value = JSON.parse(uni.getStorageSync('userInfo'))?.avatarPath||'https://oss.familydaf.cn/sxsnfile/20251218/3821654e080945998d464f3c3aa64122.png';
		// }
		proxy.$api.get(`/core/activity/signup/getMemberProfile/${options?.activityId}/${options?.memberId}`).then(({data:res})=>{
			if(res.code!==0) return proxy.$showToast(res.msg)
			info.value = res.data;
			imgs.value = res.data.activityFile&&res.data.activityFile.split(';');
		})
	})
</script>

<style scoped lang="scss">
	::v-deep .u-navbar>view{
		background: url('https://oss.familydaf.cn/sxsnfile/20251223/d07237024c5e4f00a63b9089abbf5a3c.png') no-repeat;
		background-size: 100% 100%;
	}
	
	.common_page{
		background: #F9FEFD;
		padding-bottom: 64rpx;
		box-sizing: border-box;
		
		.box{
			background: #D9F9E9;
			border-radius: 48rpx;
			position: relative;
			margin-top: 40rpx;
			padding: 14rpx;
			
			&-title{
				width: 263rpx;
				height: 79rpx;
				position: absolute;
				top: 0;
				left: 50%;
				margin-left: -131.5rpx;
			}
			
			&.box1{
				margin-top: 30rpx;
				.content{
					border-radius: 32rpx;
					padding: 0 18rpx 18rpx;
					background-color: #EFFDF2;
					background-image: url('https://oss.familydaf.cn/sxsnfile/20251218/1b95e5a813f24c6ab7e753c83d7bebc7.png');
					background-repeat: no-repeat;
					background-size: 337rpx 450rpx;
					background-position: top right;
					overflow: hidden;
					border: 6rpx solid #FFFFFF;
					.card{
						position: relative;
						border-radius: 24rpx;
						padding: 63rpx 39rpx;
						box-sizing: border-box;
						margin-top: 142rpx;
						background: #FFFFFF;
						
						.avatar{
							width: 116rpx;
							height: 116rpx;
							border: 6rpx solid #FFFFFF;
							border-radius: 50%;
							position: absolute;
							left: 39rpx;
							top: -74rpx;
							image{
								width: 100%;
								height: 100%;
								border-radius: 50%;
							}
						}
						.logo{
							width: 159rpx;
							height: 40rpx;
							position: absolute;
							top: 40rpx;
							right: 24rpx;
						}
						.name-tip{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 24rpx;
							color: #B2B2B2;
							line-height: 24rpx;
						}
						.name{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 32rpx;
							color: #252525;
							line-height: 32rpx;
							margin-top: 16rpx;
						}
						.kh-tip{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 24rpx;
							color: #B2B2B2;
							line-height: 24rpx;
							margin-top: 44rpx;
						}
						.kh{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: 800;
							font-size: 44rpx;
							color: #70CF52;
							line-height: 44rpx;
							margin-top: 24rpx;
						}
						.memo{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 24rpx;
							color: #B2B2B2;
							line-height: 39rpx;
							margin-top: 64rpx;
						}
						.gx-tip{
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 24rpx;
							color: #B2B2B2;
							line-height: 36rpx;
							margin-top: 112rpx;
						}
						.num{
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #151B29;
							line-height: 36rpx;
							margin-top: 20rpx;
							text{
								font-family: AaHouDiHei;
								font-size: 26rpx;
								font-weight: bold;
								color: #70CF52;
								line-height: 36rpx;
								margin: 10rpx;
							}
						}
						.heart{
							width: 235rpx;
							height: 230rpx;
							position: absolute;
							right: 0;
							bottom: 64rpx;
						}
						.level{
							width: 250rpx;
							height: 64rpx;
							background: url('https://oss.familydaf.cn/sxsnfile/20251218/ab4a3c4e109b418087ef01667e472cd0.png') no-repeat;
							background-repeat: no-repeat;
							background-size: 100% 100%;
							position: absolute;
							right: 0;
							bottom: 0;
							font-family: PingFang-SC, PingFang-SC;
							font-weight: 800;
							font-size: 48rpx;
							color: #FFFFFF;
							line-height: 64rpx;
							text-align: center;
						}
					}
				}
			}
		
			&.box2{
				.content{
					background: #FFFFFF;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #4E5969;
					line-height: 48rpx;
					padding: 96rpx 32rpx 46rpx;
					border-radius: 32rpx;
					img{
						width: 100%;
					}
				}
			}
		}
	
		.back{
			width: 100%;
			height: 90rpx;
			background: #B7F358;
			border-radius: 45rpx;
			margin-top: 40rpx;
			font-family: PingFang-SC, PingFang-SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #151B29;
			line-height: 90rpx;
			text-align: center;
			letter-spacing: 2rpx;
		}
	}
</style>