<template>
	<view class="cinema-box">
		<view class="tit">
			<text>{{cinema.cinemaName}}</text>
			<text class="text-2"
				@click.stop="openLocation(cinema)">{{cinema.distance.includes('m') ? cinema.distance : cinema.distance+' km'}}</text>
		</view>
		<view class="tit">
			<text class="address">{{cinema.address}}</text>
			<view @click.stop="openLocation(cinema)">
				<m-icon type="dingwei" color="#304ECE" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			cinema: Object,
		},
		methods: {
			openLocation(item) {
				uni.openLocation({
					latitude: item.latitude,
					longitude: item.longitude
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.cinema-box {
		padding: 30rpx;
		border-top: 1rpx solid #E8E8E8;
		background-color: #FFFFFF;
		display: flex;
		flex-direction: column;

		.tit {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.text-1 {
				font-size: 30rpx;
				color: #0F0404;
			}

			.text-2 {
				font-size: 26rpx;
				color: #999999;
				white-space: nowrap;
			}
		}

		.address {
			margin-top: 20rpx;
			width: 600rpx;
			font-size: 26rpx;
			color: #666666;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
	}
</style>
