arenaCard.vue 3.1 KB
<template>
	<view class="arenaCard" :style="customStyle">
		<view class="left">
			<image class="cover_img" src="@/static/images/home/bg-1.png" mode="scaleToFill"></image>
		</view>
		<view class="right">
			<CommonTitleNav title-name="彩虹体育馆" :mark-color="ThemeColor.PrimaryColor" right-title="4.8分" >
				<template #side-content>
					{{ isBooking ? '160/小时' : '¥ 36/人' }}
				</template>
			</CommonTitleNav>
			<view class="center">
				<CommonIconNav v-if="isBooking" icon-name="map" title-content="1.2km 滨湖路地铁C口"></CommonIconNav>
				<CommonIconNav v-else icon-name="clock" title-content="2023-02-06 9:00-23:00"></CommonIconNav>
			</view>
			<view v-if="isBooking" class="startTime">
				<CommonIconNav icon-name="clock" title-content="9:00-23:00"></CommonIconNav>
				<view class="detail" @click="goRouter('/pages/arenaDetail/arenaDetail')">
					<text>详情</text>
					<u-icon name="play-right-fill" :color="ThemeColor.PrimaryColor" size="12"></u-icon>
				</view>
			</view>
		
			<view v-else class="startTime">
				<view class="number">
					<u-avatar-group
					:urls="urls"
					size="24"
					gap="0.4"
				/>
				</view>
				<MyButton title="拼场" size="small" @comfirn="goRouter('/pages/aboutBallsDetail/aboutBallsDetail')" />
			</view>
		</view>
	</view>
</template>

<script>
	import CommonIconNav from '@/components/commonIconNav.vue'
	import CommonTitleNav from '@/components/commonTitleNav.vue'
	import MyButton from '@/components/myButton.vue'
	import ThemeColor from '@/utils/themeColor.js'
	export default {
		components: { CommonIconNav, CommonTitleNav, MyButton },
		props: {
			isBooking: {
				type: Boolean,
				default: true
			},
			customStyle: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				ThemeColor,
				urls: [
					'https://cdn.uviewui.com/uview/album/1.jpg',
					'https://cdn.uviewui.com/uview/album/2.jpg',
					'https://cdn.uviewui.com/uview/album/3.jpg',
					'https://cdn.uviewui.com/uview/album/4.jpg',
					'https://cdn.uviewui.com/uview/album/7.jpg',
					'https://cdn.uviewui.com/uview/album/6.jpg',
					'https://cdn.uviewui.com/uview/album/5.jpg'
				]
			}
		},
		methods: {
			goRouter(path){
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.arenaCard{
		display: flex;
		align-items: center;
		padding: 20rpx;
		height: 188rpx;
		background-color: #fff;
		border-radius: 16rpx;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		.left{
			width: 144rpx;
			height: 144rpx;
			margin-right: 20rpx;
			.cover_img{
				width: 100%;
				height: 100%;
			}
		}
		.right{
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			flex: 1;
			height: 100%;
			.center{
				display: flex;
				align-items: center;
				color: #333;
				font-size: 24rpx;
				line-height: 32rpx;
			}
			.startTime{
				display: flex;
				align-items: center;
				justify-content: space-between;
				position: relative;
				color: #666666;
				font-size: 24rpx;
				.detail{
					display: flex;
					align-items: center;
					position: absolute;
					color: $uni-color-primary;
					font-size: 24rpx;
					top: 0;
					right: 0;
				}
			}
		}
	}
</style>