ballCard.vue 1.6 KB
<template>
	<view class="ball_card">
		<uni-collapse>
			<uni-collapse-item :title="ballInfo.title" :thumb="ballInfo.iconName">
				<view v-for="item in ballInfo.children" :key="item.groundId" class="content" @click="goRouter(item)">
					<view class="dis-flex flex-y-center">
						<image style="width: 44rpx;" :src="ballInfo.iconName" mode="widthFix"></image>
						<text class="col-3d f-28 m-l-20">{{ item.groundNum }}号包间</text>
					</view>
					<u-icon name="arrow-right" color="#333" size="14"></u-icon>
				</view>
			</uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	import { pro_http } from '@/utils/baseUrl.js'
	export default {
		name:"ballCard",
		props: {
			ballInfo: {
				type: Object,
				require: true
			},
			isLock: {
				type: Boolean,
				default: false
			}
		},
		data(){
			return {
				pro_http
			}
		},
		computed: {
			formatPhoto(){
				return (groundPhotos) => {
					let imgList = groundPhotos.split(',')
					return imgList[0]
				}
			}
		},
		methods: {
			// 前往球场详情
			goRouter(info){
				if(this.isLock) {
					uni.navigateTo({
						url: `/pages_arenaControl/lockArena/lockArena?groundId=${info.groundId}&sportsRange=${info.sportsRange}&groundNum=${info.groundNum}`
					})
				} else {
					uni.navigateTo({
						url: '/pages_arenaControl/addArena/addArena?groundId=' + info.groundId
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
.ball_card{
	background: #FFFFFF;
	border-radius: 12rpx;
	margin-bottom: 20rpx;
	.content{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx;
		border-top: 2rpx solid #eee;
	}
}
</style>