timeBooking.vue
3.7 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<template>
<view class="booking_time">
<!-- 选择时间 -->
<u-sticky>
<view class="navSelectTime">
<view class="time_card" :class="{active: current === index }" v-for="(item, index) in 5" :key="index" @click="current = index">
<text style="font-weight: 500;">今天</text>
<text>2月27日</text>
</view>
</view>
</u-sticky>
<!-- 时间场 -->
<view class="pitch" v-for="king in 3" :key="king">
<view class="pitch_title">上午场</view>
<view class="pitch_list">
<view class="pitch_item" v-for="item in 5" :key="item">
<text>9:00-10:00</text>
<text>¥ 128</text>
</view>
</view>
</view>
<!-- 小提示 -->
<view class="tip_list">
<view class="tip_item" v-for="(item, index) in tipList" :key="index">
<view :style="{backgroundColor: item.bgColor}" class="tip_box"></view>
<text>{{ item.title }}</text>
</view>
</view>
<!-- 确认选择 -->
<view class="footer">
<view class="pay_money">需支付:<text style="font-size: 36rpx;font-weight: 500;">¥ 228</text></view>
<view class="comfirn">确认</view>
</view>
</view>
</template>
<script>
import ThemeColor from '@/utils/themeColor';
export default {
data() {
return {
current: 0,
tipList: [
{ title: '可预订', bgColor: '#FFFFFF' },
{ title: '已约满', bgColor: '#CDCDCD' },
{ title: '我的选择', bgColor: ThemeColor.PrimaryColor }
]
};
}
}
</script>
<style lang="scss" scoped>
.booking_time{
position: relative;
background-color: #F6F6F6;
box-sizing: border-box;
padding-bottom: 150rpx;
.navSelectTime{
display: flex;
align-items: center;
height: 104rpx;
color: #333;
font-size: 24rpx;
line-height: 32rpx;
background-color: #fff;
.time_card{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
flex: 1;
box-sizing: border-box;
&.active{
background-color: rgba(255, 161, 0, .2);
border-top: 8rpx solid $uni-color-primary;
color: $uni-color-primary;
}
}
}
// 选择时间卡片
.pitch{
padding: 0 30rpx;
margin-top: 34rpx;
.pitch_title{
text-align: center;
color: #333;
font-size: 28rpx;
margin-bottom: 20rpx;
}
.pitch_list{
display: flex;
flex-wrap: wrap;
background-color: #fff;
border-radius: 8rpx;
box-sizing: border-box;
overflow: hidden;
border: 1px solid rgba(225,225,225,0.7);
.pitch_item{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #999;
line-height: 40rpx;
width: calc(100% / 3);
height: 124rpx;
border: 1px solid rgba(225,225,225,0.7);
box-sizing: border-box;
}
}
}
// 提示列表
.tip_list{
display: flex;
align-items: center;
justify-content: center;
margin-top: 42rpx;
.tip_item{
display: flex;
flex-direction: column;
align-items: center;
color: #333;
font-size: 24rpx;
line-height: 28rpx;
margin: 0 32rpx;
.tip_box{
width: 56rpx;
height: 28rpx;
border-radius: 4rpx;
border: 1rpx solid rgba(225,225,225,0.7);
margin-bottom: 14rpx;
}
}
}
.footer{
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding: 0 30rpx;
width: 100%;
height: 112rpx;
box-sizing: border-box;
.pay_money{
font-size: 28rpx;
color: $uni-color-primary;
}
.comfirn{
width: 240rpx;
height: 76rpx;
background: linear-gradient( 270deg, $uni-color-primary 0%, #FCD723 100%);
border-radius: 90rpx;
font-size: 28rpx;
text-align: center;
color: #fff;
line-height: 76rpx;
}
}
}
</style>