<template>
	<u-popup  :show="showPop" :round="20" @close="showPop=false" closeable>
		<view class="son-wrap">
			<view class="head">
				<view class="head1">
						购买须知
				</view>
				<view class="head2">
					{{buyKnowData.name}}
				</view>

				<view class="head3">
					挂牌价：￥{{buyKnowData.originalPrice}}
				</view>
			</view>	
			<view class="middle">
				<view style="margin-top: 30rpx;">
					<!-- 组合票页面和订单填写页面后端返回的字段不一致，所以取两个值 -->
					<image style="width: 100%;" v-for="(item,index) in buyKnowData.productImgs||buyKnowData.imgResVos" :key="index" :src="item.url" mode="widthFix">
						
					</image>
				</view>
				<!-- 组合票页面和订单填写页面后端返回的字段不一致，所以取两个值 -->
				<view class="middle-list" v-for="(item,a) of buyKnowData.productTitleResVos||buyKnowData.productTitleData" :key="a">
					<view class="middle-title">
						{{item.title}}
					</view>
					<view class="middle-content" v-for="(items,b) of item.productChildTitleData" :key="b">
						<text>
							{{items.title}}
						</text>
			
						<view>
							<!--<text>随买随用</text>-->
							<text v-for="(itemss,c) of items.contentList" :key="c" class="content-child">
								{{itemss.content}}
							</text>
						</view>
					</view>
				</view>
				<!-- 退票规则 -->
				<view class="middle-list" style="border-bottom: none;">
					<view class="middle-title">
						<text v-if="buyKnowData.backChangeRule == 0">不可退</text>
						<text v-if="buyKnowData.backChangeRule == 1">有条件退</text>
						<text v-if="buyKnowData.backChangeRule == 2">随时可退</text>
					</view>
					<view v-if="buyKnowData.productRefundRuleVo&&buyKnowData.productRefundRuleVo.refundType== 1">
						<view v-for="(item,index) in buyKnowData.productRefundRuleVo.refundRuleList" :key="index" style="margin-top: 16rpx;">
							<!--已配置文字内容 -->
							<text v-if="item.refundShowMessage">
								{{item.refundShowMessage}}
							</text>
							<!-- 未配置文字内容 -->
							<template v-else>
								<!-- 使用日期前 -->
								<text v-if="buyKnowData.productRefundRuleVo.refundTimeType==1">
									<text v-if="item.refundDay==0">
										使用日期当天{{item.refundTime}}之前可退
									</text>
									<text v-else>
										使用日期前{{item.refundDay}}天{{item.refundTime}}之前可退
									</text>
								</text>
								<!-- 过期 -->
								<text v-if="buyKnowData.productRefundRuleVo.refundTimeType==2">
									<text v-if="item.refundDay==0">
										过期当天{{item.refundTime}}之前可退
									</text>
									<text v-else>
										过期后{{item.refundDay}}天{{item.refundTime}}之前可退
									</text>
								</text>
							</template>
							
						</view>
					</view>
				</view>
			</view>
				
			<view class="bottom">
				<text class="bottom-left">
					¥ <text>{{buyKnowData.sellingPrice}}</text>
				</text>
				<view class="bottom-right">
					<text class="btn" @click="showPop=false">
						确定
					</text>
				</view>
			</view>

		</view>
	</u-popup>
</template>

<script>
export default {
  props: ['buyKnowData'],
  data() {
    return {
      showPop: false, //控制弹窗显示隐藏
    }
  },
  methods: {
  }
}
</script>

<style scoped="scoped">
.son-wrap{
	height:80vh;
	display: flex;
	flex-direction:column;
}
.head{
	padding: 0 24rpx;
}
.head1{
	text-align: center;
	font-size: 32rpx;
	font-weight: bold;
	padding: 30rpx 0;
	border-radius: 20rpx 20rpx 0 0;
}
.head2{
	font-weight: bolder;
	font-size: 32rpx;
	line-height: 40rpx;
}
.head3{
	font-size: 28rpx;
	margin-top: 20rpx;
	color: #666666;
	border-bottom: 1px solid #e6e6e6;
	padding-bottom: 30rpx;
}
.img-box{
	margin: 20rpx 0;
}
.middle {
	padding: 0 24rpx 120rpx 24rpx;
	font-size: 28rpx;
	flex: 1;
	overflow-y: scroll;
}
.middle-list {
	margin: 30rpx 0;
	padding-bottom: 24rpx;
	border-bottom: 1px solid #E6E6E6;
}
.middle-title{
	font-size: 32rpx;
	font-weight: bold;
}
.middle-content {
	display: flex;
	margin-top: 20rpx;
	position: relative;
	line-height: 52rpx;
}
.middle-content>text {
	color: #666666;
	margin-right: 30rpx;
	width: 120rpx;
	display: inline-block;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	flex-shrink: 0;
	font-size: 26rpx;
	position: relative;
}
.middle-content view {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.bottom {
	display: flex;
	justify-content: space-between;
	padding: 0 24rpx;
	height: 100rpx;
	align-items: center;
	position: fixed;
	bottom: 0;
	width: 100%;
	z-index: 9;
	background: #FFFFFF;
	box-sizing: border-box;
	border-top: 1px solid #e6e6e6;
}

.bottom-left{
	color: #f9690e;
}

.bottom-left text {
	font-size: 36rpx;
	font-weight: bolder;
}

.bottom view {
	display: flex;
	align-items: center;
}
</style>
