<template>
	<view class="film-list">
		<view class="times">
			<view class="film-time">
				{{filmList.showTime.substring(11, 16)}}
			</view>
			<view class="film-end">
				{{filmList.stopSellTime.substring(11, 16)}}散场
			</view>
		</view>
		<view class="size">
			<view class="film-type">
				{{filmList.showVersionType}}
			</view>
			<view class="film-end">
				{{filmList.hallName}}
			</view>
		</view>
		<view class="price">
			<view class="film-price">
				<text class="del-price">￥{{filmList.showPrice}}</text>
				<text>￥</text>{{Math.round((parseFloat(filmList.pay_price) - parseFloat(filmList.deduction_price))*100)/100}}
			</view>
			<view class="film-card">
				消费卡补贴：{{filmList.deduction_price}}
			</view>
		</view>
		<!-- <view class="film-buy" @click="buyBill(filmList.showTime)" :class="this.isMoreOneTime(filmList.showTime)? '' : 'dontBuy'"> -->
		<view class="film-buy" @click="buyBill(filmList.showTime)">
			购票
		</view>
	</view>
</template>

<script>
	import mixin from '@/static/js/mixin/mixin.js';
	import film from '@/static/js/mixin/film.js';
	export default {
		mixins: [mixin, film],
		data() {
			return {
			}
		},
		props: {
			// 场次数据
			filmList: {
				type: Object,
				default: {}
			},
			// 影片数据
			filmData: {
				type: Object,
				default: {}
			},
			// 影院ID
			cinemaData: {
				type: Object,
				default: {}
			}
		},
		methods: {
			buyBill() {
				uni.navigateTo({
					url: `../../pages/film/filmSeat?cinemaData=${encodeURIComponent(JSON.stringify(this.cinemaData))}&filmList=${encodeURIComponent(JSON.stringify(this.filmList))}&filmData=${encodeURIComponent(JSON.stringify(this.filmData))}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.film-list {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 22rpx 0rpx;
		.times {
			width: 20%;
			height: 80rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-right: 24rpx;
			.film-time {
				font-size: 40rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #333333;
				line-height: 52rpx;
			}
			.film-end {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #666666;
				line-height: 32rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
		.size {
			width: 25%;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.film-end {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #666666;
				line-height: 32rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
			.film-type {
				font-size: 26rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #333333;
				line-height: 60rpx;
				text-overflow: ellipsis;
				overflow: hidden;
				white-space:nowrap;
			}
		}
		.price {
			width: 35%;
			.film-price {
				font-size: 32rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 900;
				color: #FC4B5C;
				line-height: 60rpx;
				text-align: right;
				text {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FC4B5C;
					line-height: 32rpx;
				}
				.del-price {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
					line-height: 32rpx;
					 text-decoration: line-through;
				}
			}
			.film-card {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
				line-height: 32rpx;
				text-align: right;
			}
		}
		.film-buy {
			width: 170rpx;
			height: 80rpx;
			background: linear-gradient(136deg, #FC4B5C 0%, #FD8D3D 100%);
			box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(0,0,0,0.1);
			border-radius: 40rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: 24rpx;
			font-family: PingFangSC-Semibold, PingFang SC;
			font-weight: 600;
			color: #FFFFFF;
			line-height: 80rpx;
			margin-left: 16rpx;
		}
		.dontBuy {
			background: linear-gradient(136deg, #646464 0%, #121212 100%);
		}
	}
</style>