PitchList.vue 2.0 KB
<template>
	<view class="pitch_list">
		<view v-for="item in pitchList" :key="item.groundId" class="pitch_item" @click="goRouter(`/pages_arenaControl/addArena/addArena?groundId=${item.groundId}`)">
			<view class="left">
				<image class="cover_img" :src="item.groundPhotos"></image>
			</view>
			<view class="right">
				<view class="right_text">
					<text class="f-w-500 f-28 l-h-38 col-3d mb-10">{{ item.groundNum }}号包间</text>
					<text>{{ item.isOutdoor === 0 ? '室内' : '室外' }}<text class="m-l-20">{{ item.price }}¥/小时</text></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { pro_http } from '@/utils/baseUrl.js'
	export default {
		name:"pitchCard",
		props: {
			pitchList: {
				type: Array,
				require: true
			}
		},
		data() {
			return {pro_http}
		},
		computed: {
			formatPhoto(){
				return (groundPhotos) => {
					let imgList = groundPhotos.split(',')
					return imgList[0]
				}
			}
		},
		methods: {
			goRouter(path){
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.pitch_list{
	display: flex;
	flex-direction: column;
	padding: 30rpx 20rpx;
	.pitch_item{
		position: relative;
		display: flex;
		align-items: center;
		overflow: hidden;
		margin-bottom: 20rpx;
		&:last-child {
			margin-bottom: 0;
		}
		.left{
			width: 120rpx;
			height: 120rpx;
			border-radius: 12rpx;
			margin-right: 40rpx;
			overflow: hidden;
			.cover_img{
				width: 100%;
				height: 100%;
			}
		}
		.right{
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.right_text{
				display: flex;
				flex-direction: column;
				justify-content: center;
				font-size: 24rpx;
				line-height: 32rpx;
				color: #FFD900;
			}
			.QRCode{
				right: 60rpx;
				width: 72rpx;
				height: 72rpx;
			}
		}
	}
	.add_mode{
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		line-height: 38rpx;
		color: #999;
		height: 120rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		border-radius: 12rpx;
	}
}
</style>