arenaCard.vue
3.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<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="#FFA100" 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="#FFA100" 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'
export default {
components: { CommonIconNav, CommonTitleNav, MyButton },
props: {
isBooking: {
type: Boolean,
default: true
},
customStyle: {
type: String,
default: ''
}
},
data() {
return {
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: #FFA100;
font-size: 24rpx;
top: 0;
right: 0;
}
}
}
}
</style>