<template>
	<view class="box">
		<u-navbar title="宣讲员介绍" autoBack :placeholder="true" bgColor="#fee1b9"></u-navbar>
		<view class="ban">
			<view class="top_box">
				<img src="https://img2.baidu.com/it/u=443975182,626431415&fm=253&fmt=auto&app=120&f=JPEG?w=627&h=418" class="img" />
				<view class="name_box">
					<view class="">{{details.name}}</view>
					<view class="name_js">{{details.sex_text}}，来自福建厦门，擅长中国历史文物讲解</view>
				</view>
			</view>
			<view class="xxjs">
				{{details.intro}}
			</view>
			<view class="" style="display: flex">
				<img class="left_img" src="https://img2.baidu.com/it/u=443975182,626431415&fm=253&fmt=auto&app=120&f=JPEG?w=627&h=418" style="" />

				<view class="">
					<view class="">
						<img src="https://img2.baidu.com/it/u=443975182,626431415&fm=253&fmt=auto&app=120&f=JPEG?w=627&h=418" class="img_js" />
					</view>

					<view class="">
						<img src="https://img2.baidu.com/it/u=443975182,626431415&fm=253&fmt=auto&app=120&f=JPEG?w=627&h=418" class="img_js" />
					</view>
				</view>
			</view>
			<!--  -->
			<view class="ld">历史讲解</view>
			<scroll-view scroll-x enable-flex class="scroll-view_H" type="list">
				<view class="goods-item" v-for="item in xuanjiangActivityList" :key="item">
					<image class="img" style="" :src="item.image" />
					<view style="margin-left: 20rpx">
						<view>{{item.title}}</view>
						<view class="gs_js">精彩瞬间</view>
					</view>
				</view>
			</scroll-view>
			<view class="ld">用户评价</view>
			<view class="">
				<view class="top_box">
					<img src="https://img2.baidu.com/it/u=443975182,626431415&fm=253&fmt=auto&app=120&f=JPEG?w=627&h=418" class="img" />
					<view class="name_box">
						<view class="">
							赵丽
							<view class="" style="margin-top: 6rpx; display: flex; align-items: center">
								<u-icon v-for="item in 5" :key="item" name="star-fill" color="#86827c" size="12"></u-icon>
								<view class="name_js" style="margin-left: 6rpx; font-size: 22rpx">2023-5-13</view>
							</view>
						</view>
					</view>
				</view>
				<view class="" style="margin-top: 10rpx; font-size: 26rpx">讲解生动形象非常生动有趣，内容丰富，值得推荐!</view>
				<view class="icon_box" style="">
					<u-icon name="thumb-up" color="#86827c" size="20"></u-icon>
					<u-icon name="thumb-down" color="#86827c" size="20"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
let that;
export default {
	data() {
		return {
			xuanjiangActivityList: [],
			details: [],
			volunteer_id: ''
		};
	},
	onLoad(option) {
		that = this;
		that.volunteer_id = option.id;
		that.getXuanjiangDetails();
		that.getActivityReviewList();
	},
	methods: {
		getXuanjiangDetails() {
			this.$api.getXuanjiangDetails(
				{ 
					volunteer_id: that.volunteer_id
				}, 
				data => {
					if (data.code == 0) {
						that.$common.errorToShow(data.msg);
						return;
					} else {
						that.details = data.data;
						console.log(that.details, '文物跑活动宣讲员详情');
					}
				}
			);
		},
		// 活动精彩
		getActivityReviewList() {
			this.$api.getContentList(
				{ 
					page: 1, 
					pageSize: 4, 
					model_id: 15, 
					main_body_column_id: 186 ,
					volunteer_id: that.volunteer_id
				}, 
				data => {
					if (data.code == 0) {
						that.$common.errorToShow(data.msg);
						return;
					} else {
						that.xuanjiangActivityList = data.data;
						console.log(that.xuanjiangActivityList, '宣讲员参与的活动');
					}
				}
			);
		},
	}
};
</script>

<style>
.box {
	height: auto;
	width: 100%;
	padding-bottom: 50rpx;
	background-image: url('https://huli-app.wenlvti.net/app_static/minnanhun/image/gj_bg.png');
	background-repeat: repeat-y;
	background-size: 100%;
}
.ban {
	width: 92%;
	margin: auto;
}
.img {
	width: 80rpx;
	height: 80rpx;
	border-radius: 50%;
}
.top_box {
	display: flex;
	margin-top: 10rpx;
}
.name_box {
	margin-left: 30rpx;
}
.name_js {
	color: #8a8787;
	font-size: 24rpx;
	margin-top: 10rpx;
}
.xxjs {
	margin-top: 20rpx;
	text-indent: 2em;
	color: black;
	font-size: 28rpx;
	line-height: 40rpx;
	margin-bottom: 26rpx;
}
.img_js {
	width: 330rpx;
	height: 200rpx;
	border-radius: 4rpx 10rpx 4rpx 10rpx;
}
.left_img {
	width: 330rpx;
	height: 400rpx;
	margin-right: 20rpx;
	border-radius: 10rpx 4rpx 4rpx 10rpx;
}
.scroll-view_H {
	width: 100%;
	white-space: nowrap;
	/* height: 480rpx; */
	flex-direction: row;
}
.scroll-view_H {
	white-space: nowrap; /* 确保子元素在同一行显示 */
	width: 100%; /* 设置 scroll-view 的宽度 */
}

.scroll-view_H .goods-item {
	display: inline-block; /* 使用 inline-block 确保子元素在同一行显示 */
	width: 320rpx;
	height: 400rpx;
	border-radius: 10rpx;
	flex-direction: column;
	background-color: #fcedd6;
	margin-right: 20rpx; /* 添加右边距，最后一个子元素的右边距为 0 */
}

.scroll-view_H .goods-item:last-child {
	margin-right: 0;
}
.goods-item .img {
	width: 100%;
	height: 300rpx;
	border-radius: 10rpx;
}

.gs_js {
	font-size: 28rpx;
	color: #aba89a;
	margin-top: 10rpx;
}
.ld {
	font-size: 30rpx;
	font-weight: 700;
	margin-top: 20rpx;
	margin-bottom: 20rpx;
}
.icon_box {
	width: 100rpx;
	margin-top: 10rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
</style>
