<template>
	<!-- 政策详情 -->
	<view class="policyDetail">
		<u-tabs :list="typeList" :current="active" name="Name" :is-scroll="false" @change="changeHandler"
			:active-color="mainColor" bg-color="#FFF" bar-height='4' height="100"></u-tabs>
		<view class="officialNotice">
			<view class="title">
				官方公告信息
			</view>
			<view class="desc">

				<rich-text :nodes="details.TicketNotice"></rich-text>
			</view>

			<view class="title">
				开放时间
			</view>
			<view class="desc">
				<view v-for="(item,index) in details.OpenTimeList" :key="index">
					<view class="open-date" v-if="item.StartDay&&item.EndDay">
						{{item.StartDay}}~<text v-if="item.IsNextYear===1">次年</text>{{item.EndDay}}
					</view>
					<view class="open-item" v-if="item.StartDay&&item.EndDay">
						<view class="BusinessStartWeek">
							<text v-if="item.BusinessStartWeek===0">不限</text>
							<text v-if="item.BusinessStartWeek===1">周一</text>
							<text v-if="item.BusinessStartWeek===2">周二</text>
							<text v-if="item.BusinessStartWeek===3">周三</text>
							<text v-if="item.BusinessStartWeek===4">周四</text>
							<text v-if="item.BusinessStartWeek===5">周五</text>
							<text v-if="item.BusinessStartWeek===6">周六</text>
							<text v-if="item.BusinessStartWeek===7">周七</text>
						</view>~
						<view class="BusinessEndWeek">
							<text v-if="item.BusinessEndWeek===0">不限</text>
							<text v-if="item.BusinessEndWeek===1">周一</text>
							<text v-if="item.BusinessEndWeek===2">周二</text>
							<text v-if="item.BusinessEndWeek===3">周三</text>
							<text v-if="item.BusinessEndWeek===4">周四</text>
							<text v-if="item.BusinessEndWeek===5">周五</text>
							<text v-if="item.BusinessEndWeek===6">周六</text>
							<text v-if="item.BusinessEndWeek===7">周七</text>
						</view>
						<view class="Businesstime" v-if="item.StartTime&&item.EndTime">
							{{item.StartTime}}~{{item.EndTime}},
							<text v-if="item.StopTime">{{item.StopTime}}停止入场</text>
						</view>
					</view>

				</view>
			</view>
			<view class="title">
				购票须知
			</view>
			<view class="desc">
				<rich-text :nodes="details.BookingInfo"></rich-text>
			</view>
			<view class="title">
				温馨提示
			</view>
			<view class="desc">
				<rich-text :nodes="details.About"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				active: 0,
				mainColor: "#DFBE6E",
				barStyle: {
					width: '30rrpx',
					height: '6rpx',
					background: '#DFBE6E',
					borderRadius: '3rpx'
				},
				typeList: [{
					Id: 0,
					Name: '官方公告'
				}, {
					Id: 1,
					Name: '购票须知'
				}, {
					Id: 2,
					Name: '温馨提示'
				}],
				richText: "",
				ID: 0,
				details: {},
			}

		},
		onLoad(options) {
			console.log(options)
			this.ID = options.id
			this.getDetail()
		},
		methods: {
			changeHandler(i) {
				this.active = i;
			},
			//获取详情
			getDetail() {
				this.request2({
						url: '/api/AppletDining/GetTicketCouponsDetails',
						data: {
							ID: this.ID,
						}
					},
					res => {
						if (res.resultCode == 1) {
							// res.data.ScenicSpotTag = res.data.ScenicSpotTag.split(',')
							// res.data.GeographicTag = res.data.GeographicTag.split(',')
							this.details = res.data;
						}
					}
				);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.policyDetail {
		.officialNotice {
			padding: 0 45rpx 90rpx;

		}

		.title {
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 800;
			color: #111111;
			margin-bottom: 45rpx;
		}

		.desc {
			margin-bottom: 60rpx;

			.open-date {
				// width: 660rpx;
				height: 60rpx;
				background-color: #F4F4F4;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #4B4949;
				line-height: 58rpx;
				padding: 0 30rpx;
			}

			.open-item {
				display: flex;
				height: 60rpx;
				background-color: #FFFFFF;
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #4B4949;
				line-height: 58rpx;
				padding: 0 30rpx;
				border: 1rpx solid #F4F4F4;

				.Businesstime {
					margin-left: 20rpx;
				}
			}
		}
	}
</style>
