makeUp.vue
5.39 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
173
174
175
176
177
178
179
180
181
182
183
<template>
<div>
<div class="banner">
<img v-if="language==0" src="@/assets/booking/hz_text_c.png">
<img v-else src="@/assets/booking/hz_text_e.png">
</div>
<div class="box">
<div class="searchBar">
<el-input :placeholder="language==0?'请输入关键字搜索':'Search'" v-model="query.name" class="no-border">
</el-input>
<el-button size="large" type="primary" class="btn-lineG" icon="search" @click="getList">
{{ language==0?'搜索':'Search' }}</el-button>
</div>
</div>
<div class="box" v-loading="loading">
<el-row style="width: 100%" :gutter="20">
<el-col :span="8" v-for="(h,index) in list" class="mb20" >
<el-card style="position: relative;">
<img class="w100 hz-img" :src="fillImgUrl(h.cover)"/>
<div class="yuyue">
{{ h.counts }} {{ language==0?'个时间段可预约':"time slots can be reserved" }}
</div>
<div class="hz-text">{{h.name}}</div>
<div class="tagbox esp">
<span v-for="(t,index) in h.label?.split(',')" v-show="index<4">{{t}}</span>
</div>
<div class="hz-row">
<el-icon size="16" style="position: relative;top: 2px" color="#929AA0"><OfficeBuilding /></el-icon>
{{ language==0?'成立':'Established for'}}
<span class="sign">{{ h.ageLimit }}</span>{{language==0?'年':'years'}} |
<el-icon size="16" style="position: relative;top: 2px" color="#929AA0"><UserFilled /></el-icon><span class="sign">{{ h.dresserLimit }}</span>{{language==0?'名化妆师':'makeup artists' }}
</div>
<div class="hz-row">
<el-icon size="16" style="position: relative;top: 2px" color="#929AA0"><PhoneFilled /></el-icon>
{{ h.contact }}
</div>
<div class="hz-row">
<el-icon size="16" style="position: relative;top: 2px" color="#929AA0"><LocationFilled /></el-icon>
{{h.remarks}}
</div>
<div style="text-align: center">
<el-button :disabled="h.counts<=0" class="btn-lineG w200px" round type="primary" size="large" @click="goDetail(h)">{{ language==0?'立即预约':'Select' }} ⇀</el-button>
</div>
</el-card>
</el-col>
</el-row>
<el-empty v-show="!loading&&list.length==0" :image="`/img/order_no.png`" :image-size="228" description="" />
<div style="height: 50px"></div>
</div>
</div>
</template>
<script setup>
import {onMounted} from "@vue/runtime-core"
import * as booking from "@/apiPc/booking"
import {useRouter,useRoute} from "vue-router";
import {useStorage} from "@vueuse/core/index";
import {getMakeUpList} from "@/apiPc/booking";
const router = useRouter()
const route = useRoute()
const language= useStorage('language',0)
const query = ref({
name:''
})
const cptId = ref('')
const list = ref([])
const loading = ref(false)
onMounted(()=>{
query.value.activityId = route.params.cptId
getList()
})
function getList() {
loading.value = true
booking.getMakeUpList(query.value).then(res=>{
list.value = res.rows
loading.value = false
}).catch(e=>{
loading.value = false
})
}
function goDetail(item) {
router.push({
name:'makeUpDetail',
params:{
id:item.id,
}
})
}
</script>
<style scoped lang="scss">
.banner{height: 140px;background-size: cover;text-align: center;
background: url("@/assets/booking/hz_bg.png") center;display: flex;align-items: center;
justify-content: center;
img{display: block;margin:-30px auto 0;width: auto;}
}
.searchBar{position: relative;top: -30px;
background: #FFFFFF;display: flex;padding: 20px;
border-radius: 10px;}
.no-border{border: none;background: #F5F7F9;
:deep(.el-input__wrapper){border: none;box-shadow: none;background: #F5F7F9;}
}
.hz-img{
height: 218px;
width: 100%;
border-radius: 2px;
border: 0;
margin-bottom: 20px;
object-fit: cover;
}
.yuyue{
width: 150px;
height: 30px;
background: #000000;
border-radius: 20px 0px 0px 2px;
padding-left: 15px;
opacity: 0.45;
color: #fff;
font-size: 14px;
line-height: 30px;
position: absolute;
top: 207px;
right:21px;
}
.hz-text{
font-size: 20px;
font-weight: 500;
color: #000;
margin-bottom: 8px;
}
//.hz-tag{
// border-radius: 13px;
// height: 25px;
// line-height: 25px;
// font-size: 12px;
// font-weight: 400;
// padding: 0 15px;
//}
//.tag1{
// background: rgba(50, 177, 108, 0.2);
// color:rgba(50, 177, 108, 1);
//}
//.tag2{
// background-color: rgba(243, 152, 0, 0.2);
// color: #F39800;
//}
//.tag3{
// background-color: rgba(0, 160, 233, 0.2);
// color: #00A0E9;
//}
//.tag4{
// background-color: rgba(247, 64, 166, 0.2);
// color: #F740A6;
//}
//
//.hz-row{
// font-size: 14px;
// font-weight: 400;
// color: #929AA0;
// margin-bottom: 16px;
// .sign{
// color: #493CEB;
// }
//}
.tagbox{margin: 10px 0;
a{color: #AFB5B9;font-size: 12px;}
span{border-radius: 13px;font-size: 12px;padding: 3px 10px;margin-right:10px;font-weight: 400;}
span:nth-child(4n){background: rgba(50, 177, 108, 0.2);color: rgba(50, 177, 108, 1);}
span:nth-child(4n+1){background:rgba(243, 152, 0, 0.2);color: rgba(243, 152, 0, 1);}
span:nth-child(4n+2){background: rgba(0, 160, 233, 0.2);color: rgba(0, 160, 233, 1);}
span:nth-child(4n+3){background: rgba(247, 64, 166, 0.2);color:rgba(247, 64, 166, 1);}
}
</style>