<!-- 影院组件 -->

<template>
	<view class="mov">
		<view class="movie" @click="ToMoviesPlay()">
			<!-- 名字距离 -->
			<view class="movie-info">
				<view class="movie-name">
					{{data.cinemaName}}
				</view>
				<view class="movie-area">
					{{data.cinemaAddress}}
				</view>
			</view>
			<!-- 价格地址 -->
			<view class="movie-address">
				<view class="movie-distance">
					{{data.distance}}km
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			cinemaData: {}
		}
	},
	props: {
		data: {
			type: Object,
			default: function () {
				return {}
			}
		},
		filmDesc: {
			type: Object,
			default: function () {
				return {}
			}
		},
		// 跳转场次or影院(默认影院)
		isFilm: {
			type: Boolean,
			default: function () {
				return false
			}
		},
	},
	onLoad(option) {
		
	},
	methods: {
		// 选择电影场次
		ToMoviesPlay() {
			console.log(this.data,'-*-*-*--*');
			// 电影院查场次
			if (this.isFilm) {
				uni.navigateTo({
					url: `../../pages/film/filmYSearch?cinemaData=${encodeURIComponent(JSON.stringify(this.data))}`,
				})
			} else {
				// 电影查场次
				this.cinemaData = this.data
				uni.navigateTo({
					url: `../../pages/film/filmPlay?cinemaData=${encodeURIComponent(JSON.stringify(this.cinemaData))}&filmData=${encodeURIComponent(JSON.stringify(this.filmDesc))}`,
				})
			}
		}
	}
	
}
</script>

<style lang="scss" scoped>
	.mov {
		padding: 0rpx 24rpx;
		background-color: #FFFFFF;
	}
	.movie {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #FFFFFF;
		border-bottom: 2rpx solid #EDEDED;
		box-sizing: border-box;
		.movie-info {
			padding-right: 20rpx;
			.movie-name {
				font-size: 30rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #333333;
				line-height: 40rpx;
				margin-bottom: 20rpx;
				margin-top: 28rpx;
			}
			.movie-area {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #999999;
				line-height: 32rpx;
				margin-bottom: 20rpx;
			}
		}
		.movie-address {
			.movie-money {
				font-size: 24rpx;
				font-family: Alibaba-PuHuiTi-H, Alibaba-PuHuiTi;
				font-weight: 600;
				color: #FC4B5C;
				line-height: 32rpx;
				margin-bottom: 20rpx;
				text-align: right;
				text {
					font-size: 40rpx;
					font-weight: 900;
				}
			}
			.movie-distance {
				font-size: 24rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #999999;
				line-height: 32rpx;
				text-align: right;
			}
		}
	}
</style>