<template>
	<view class="box">
		<u-navbar :autoBack="true" title="个人信息" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
		<view class="ban_box">
			<view style="width: 100%; margin: auto" v-if="swiperList.length > 0">
				<u-swiper
					:list="swiperList"
					imgMode="aspectFill"
					:height="160"
					:indicator="true"
					radius="5"
					:autoplay="true"
					keyName="image"
					bgColor="transparent"
					@click="swiperBtn"
					showTitle
					:circular="true"
					indicatorStyle="bottom: 10px"
					indicatorMode="dot"
					indicatorActiveColor="#fff"
					indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
				></u-swiper>
			</view>
		</view>
		<view class="item">
			<view class="">
				<image style="width: 190rpx; height: 250rpx" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/toux.png"></image>
			</view>
			<view style="margin-left: 30rpx">
				<view class="">姓名：{{ detailsList.name }}</view>
				<view class="">所在地：{{ detailsList.region_id_text }}</view>
				<view class="">加入时间：{{ detailsList.created_at }}</view>
				<view class="">
					认领的文物：{{detailsList.cr_titles}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
let that;
export default {
	data() {
		return {
			cr_list: [],
			swiperList: ['https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/zyz_gr.png', 'https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/gj_zyjz.jpg'],
			volunteer_id: '',
			detailsList: {}
		};
	},
	onLoad(o) {
		that = this;
		this.volunteer_id = o.id;

		this.rankingDetails(o.id);
	},
	methods: {
		// 志愿者排行详情
		rankingDetails(id) {
			this.$api.rankingDetails({ main_body_id: 1, volunteer_id: id }, function (res) {
				// console.log(res, '排行的详情');
				if (res.code === 1) {
					that.detailsList = res.data;
					that.cr_list = res.data.cr_list.filter((item) => item.claim_status != 0);
					const filteredList = that.cr_list.filter((item) => item.image !== 'https://meng.wenlvti.net' && item.image !== 'http://cdnwwgj.wenlvti.net');

					if (filteredList.length > 0) {
						that.swiperList = filteredList;
					}
				} else {
					that.$common.errorToShow('请稍后再试');
				}
			});
		},
		swiperBtn(i) {
			uni.navigateTo({
				url: '/index_fenbao/GuanLi/XiangQing?id=' + this.swiperList[i].id
			});
		}
	}
};
</script>

<style>
.box {
	height: 100%;
	width: 100%;
	padding-bottom: 50rpx;
	/* background-color: #fff9e9; */
	background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xy_bgt.png');
	background-repeat: repeat-y;
	background-attachment: fixed;
	background-size: 100% 100%;
}
.ban_box {
	width: 92%;
	margin: auto;
	color: #90523c;
	font-size: 30rpx;
	line-height: 50rpx;
	font-weight: 600;
}
.item {
	display: flex;
	justify-content: start;
	/* width: 95%; */
	height: 620rpx;
	margin: auto;
	margin-left: 20rpx;

	margin-top: 50rpx;
	padding: 100rpx 45rpx 20rpx 50rpx;
	color: #90523c;
	font-weight: 600;
	line-height: 50rpx;
	font-size: 30rpx;
	background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/bh_bg.png');
	background-repeat: no-repeat;
	background-size: 100% 100%;
}
.map_tit {
	display: flex;
	align-items: center;
	margin-left: 125rpx;
	margin-top: 50rpx;
	margin-bottom: 20rpx;
	font-size: 32rpx;
	font-family: Songti SC, Songti SC;
	font-weight: 900;
	line-height: 52rpx;
	color: #444444;
}
</style>
