6afd6426 by zhangmeng

英文车辆预订

1 parent 67a09ccb
...@@ -6,30 +6,31 @@ ...@@ -6,30 +6,31 @@
6 </div> 6 </div>
7 <div class="box"> 7 <div class="box">
8 <div class="searchBar"> 8 <div class="searchBar">
9 <el-input :placeholder="language==0?'请输入关键字搜索':'Search'" v-model="query.name" class="no-border"> 9 <el-input v-model="query.name" :placeholder="language==0?'请输入关键字搜索':'Search'" class="no-border">
10 </el-input> 10 </el-input>
11 <el-button size="large" type="primary" class="btn-lineG" icon="search" @click="getList"> 11 <el-button class="btn-lineG" icon="search" size="large" type="primary" @click="getList">
12 {{ language==0?'搜索':'Search' }}</el-button> 12 {{ language == 0 ? '搜索' : 'Search' }}
13 </el-button>
13 </div> 14 </div>
14 </div> 15 </div>
15 <div class="box" v-loading="loading"> 16 <div v-loading="loading" class="box">
16 <el-collapse v-model="activeName" accordion style="--el-collapse-header-height:'auto'"> 17 <el-collapse v-model="activeName" accordion style="--el-collapse-header-height:'auto'">
17 <el-collapse-item :name="index" v-for="(h,index) in list" class="hotel"> 18 <el-collapse-item v-for="(h,index) in list" :name="index" class="hotel">
18 <template #title> 19 <template #title>
19 <el-row align="middle" :gutter="20" class="w100"> 20 <el-row :gutter="20" align="middle" class="w100">
20 <el-col :span="4"> 21 <el-col :span="4">
21 <div class="index">{{ language==0?'路线':'Route' }}{{index+1}} 22 <div class="index">{{ language == 0 ? '路线' : 'Route' }}{{ index + 1 }}
22 <img src="@/assets/booking/arrow.png"/> 23 <img src="@/assets/booking/arrow.png"/>
23 </div> 24 </div>
24 </el-col> 25 </el-col>
25 <el-col :span="7"> 26 <el-col :span="7">
26 <p class="esp">{{h.checkIn}}</p> 27 <p class="esp">{{ h.checkIn }}</p>
27 </el-col> 28 </el-col>
28 <el-col :span="4" class="text-center"> 29 <el-col :span="4" class="text-center">
29 <img class="mauto w40px" src="@/assets/booking/wf.png"/> 30 <img class="mauto w40px" src="@/assets/booking/wf.png"/>
30 </el-col> 31 </el-col>
31 <el-col :span="7"> 32 <el-col :span="7">
32 <p class="esp ">{{h.checkOut}}</p> 33 <p class="esp ">{{ h.checkOut }}</p>
33 </el-col> 34 </el-col>
34 </el-row> 35 </el-row>
35 </template> 36 </template>
...@@ -45,34 +46,40 @@ ...@@ -45,34 +46,40 @@
45 <el-col :span="14"> 46 <el-col :span="14">
46 <h3 class="name flex">{{ r.carType }} 47 <h3 class="name flex">{{ r.carType }}
47 <div class="tagbox"> 48 <div class="tagbox">
48 <span class="tag">{{r.carColor}}</span> 49 <span class="tag">{{ r.carColor }}</span>
49 <span class="tag" v-show="r.checkOut==1">{{ language==0?'可送车':'drop-off' }}</span> 50 <span v-show="r.checkOut==1" class="tag">{{ language == 0 ? '可送车' : 'drop-off' }}</span>
50 <span class="tag" v-show="r.checkIn==1">{{ language==0?'可接车':'pick-up' }}</span> 51 <span v-show="r.checkIn==1" class="tag">{{ language == 0 ? '可接车' : 'pick-up' }}</span>
51 </div> 52 </div>
52 </h3> 53 </h3>
53 <div class="text-gray mt20"> 54 <div class="text-gray mt20">
54 <span class="mr20">{{ language==0?'座位数':'Seats' }}: {{r.carSeat}}</span> 55 <span class="mr20">{{ language == 0 ? '座位数' : 'Seats' }}: {{ r.carSeat }}</span>
55 <span class="mr20">|</span> 56 <span class="mr20">|</span>
56 <span :span="8">{{ language==0?'运营时间':'Servers Time' }}: {{r.operStart}} ~ {{r.operEnd}}</span> 57 <span :span="8">{{
58 language == 0 ? '运营时间' : 'Servers Time'
59 }}: {{ r.operStart }} ~ {{ r.operEnd }}</span>
57 </div> 60 </div>
58 </el-col> 61 </el-col>
59 <el-col :span="3"> 62 <el-col :span="3">
60 <div class="price" v-if="language==0">¥ 63 <div v-if="language==0" class="price">¥
61 <span v-if="r.outPrice&&r.inPrice">{{Number(r.inPrice) > Number(r.outPrice)?r.outPrice:r.inPrice}}</span> 64 <span
62 <span v-else-if="r.inPrice>0">{{r.inPrice}}</span> 65 v-if="r.outPrice&&r.inPrice">{{ Number(r.inPrice) > Number(r.outPrice) ? r.outPrice : r.inPrice }}</span>
63 <span v-else>{{r.outPrice}}</span> 66 <span v-else-if="r.inPrice>0">{{ r.inPrice }}</span>
67 <span v-else>{{ r.outPrice }}</span>
64 68
65 </div> 69 </div>
66 <div class="price" v-else> 70 <div v-else class="price">
67 71
68 <span v-if="r.outPriceEn&&r.inPriceEn">{{(Number(r.inPriceEn)||0) > Number(r.outPriceEn)?r.outPriceEn:r.inPriceEn}}</span> 72 <span
69 <span v-else-if="r.inPriceEn>0">{{r.inPriceEn}}</span> 73 v-if="r.outPriceEn&&r.inPriceEn">{{ (Number(r.inPriceEn) || 0) > Number(r.outPriceEn) ? r.outPriceEn : r.inPriceEn }}</span>
70 <span v-else>{{r.outPriceEn}}</span> 74 <span v-else-if="r.inPriceEn>0">{{ r.inPriceEn }}</span>
75 <span v-else>{{ r.outPriceEn }}</span>
71 </div> 76 </div>
72 77
73 </el-col> 78 </el-col>
74 <el-col :span="3"> 79 <el-col :span="3">
75 <el-button class="btn-lineG w100" round type="primary" @click="goOrder(h,r)">{{ language==0?'我要预订':'Select' }}</el-button> 80 <el-button class="btn-lineG w100" round type="primary" @click="goOrder(h,r)">
81 {{ language == 0 ? '我要预订' : 'Select' }}
82 </el-button>
76 </el-col> 83 </el-col>
77 </el-row> 84 </el-row>
78 </div> 85 </div>
...@@ -84,7 +91,7 @@ ...@@ -84,7 +91,7 @@
84 </el-collapse> 91 </el-collapse>
85 92
86 93
87 <el-empty v-show="!loading&&list.length==0" :image="`/img/order_no.png`" :image-size="228" description="" /> 94 <el-empty v-show="!loading&&list.length==0" :image="`/img/order_no.png`" :image-size="228" description=""/>
88 <div style="height: 50px"></div> 95 <div style="height: 50px"></div>
89 </div> 96 </div>
90 97
...@@ -94,111 +101,252 @@ ...@@ -94,111 +101,252 @@
94 <script setup> 101 <script setup>
95 import {onMounted} from "@vue/runtime-core" 102 import {onMounted} from "@vue/runtime-core"
96 import * as booking from "@/apiPc/booking" 103 import * as booking from "@/apiPc/booking"
97 import {useRouter,useRoute} from "vue-router"; 104 import {useRouter, useRoute} from "vue-router";
98 import {useStorage} from "@vueuse/core/index"; 105 import {useStorage} from "@vueuse/core/index";
99 import useUserStore from "@/store/modules/user"; 106 import useUserStore from "@/store/modules/user";
107
100 const user = useUserStore().user 108 const user = useUserStore().user
101 const router = useRouter() 109 const router = useRouter()
102 const route = useRoute() 110 const route = useRoute()
103 const language= useStorage('language',0) 111 const language = useStorage('language', 0)
104 const query = ref({ 112 const query = ref({
105 name:'' 113 name: ''
106 }) 114 })
107 const activeName = ref(0) 115 const activeName = ref(0)
108 const cptId = ref('') 116 const cptId = ref('')
109 const list = ref([]) 117 const list = ref([])
110 const loading = ref(false) 118 const loading = ref(false)
111 onMounted(()=>{ 119 onMounted(() => {
112 query.value.activityId = route.params.cptId 120 query.value.activityId = route.params.cptId
113 if (language.value==0) getList() 121 // if (language.value==0)
122 getList()
114 }) 123 })
115 124
116 function getList() { 125 function getList() {
117 if (language.value!=0)return 126 // if (language.value!=0)return
118 loading.value = true 127 loading.value = true
119 booking.getActivityCarList(query.value).then(res=>{ 128 booking.getActivityCarList(query.value).then(res => {
120 list.value = res.rows 129 list.value = res.rows
121 loading.value = false 130 loading.value = false
122 }).catch(e=>{ 131 }).catch(e => {
123 loading.value = false 132 loading.value = false
124 }) 133 })
125 } 134 }
126 function goOrder(item,car) { 135
127 if(!user){ 136 function goOrder(item, car) {
137 if (!user) {
128 useUserStore().setReLogin() 138 useUserStore().setReLogin()
129 return 139 return
130 } 140 }
131 router.push({ 141 router.push({
132 name:'carOrder', 142 name: 'carOrder',
133 params:{ 143 params: {
134 id:item.id, 144 id: item.id,
135 }, 145 },
136 query:{ 146 query: {
137 item:encodeURIComponent(JSON.stringify(item)), 147 item: encodeURIComponent(JSON.stringify(item)),
138 car:encodeURIComponent(JSON.stringify(car)), 148 car: encodeURIComponent(JSON.stringify(car)),
139 } 149 }
140 }) 150 })
141 } 151 }
142 </script> 152 </script>
143 153
144 <style scoped lang="scss"> 154 <style lang="scss" scoped>
155
156 .hotel {
157 margin-bottom: 20px;
158 cursor: pointer;
145 159
146 .hotel{margin-bottom: 20px;cursor: pointer; 160 .index {
147 .index{display: flex;font-weight: 500;padding-left: 20px; 161 display: flex;
148 font-size: 18px;align-items: center; 162 font-weight: 500;
149 img{margin-left: 15px;} 163 padding-left: 20px;
164 font-size: 18px;
165 align-items: center;
166
167 img {
168 margin-left: 15px;
169 }
150 } 170 }
151 p{font-weight: 500; 171
172 p {
173 font-weight: 500;
152 font-size: 24px; 174 font-size: 24px;
153 color: #000000;} 175 color: #000000;
154 &:hover .el-card{box-shadow: 0 0 10px #aaa;} 176 }
155 } 177
156 .hotel:nth-child(7n) .index{color: #009E96;} 178 &:hover .el-card {
157 .hotel:nth-child(7n+1) .index{color: #FF8124;} 179 box-shadow: 0 0 10px #aaa;
158 .hotel:nth-child(7n+2) .index{color: #E4007F;} 180 }
159 .hotel:nth-child(7n+3) .index{color: #0068B7;} 181 }
160 .hotel:nth-child(7n+4) .index{color: #32B16C;} 182
161 .hotel:nth-child(7n+5) .index{color: #920783;} 183 .hotel:nth-child(7n) .index {
162 .hotel:nth-child(7n+6) .index{color: #00B7EE;} 184 color: #009E96;
163 185 }
164 .banner{height: 140px;background-size: cover;text-align: center; 186
165 background: url("@/assets/booking/cl_bg.png") center;display: flex;align-items: center; 187 .hotel:nth-child(7n+1) .index {
188 color: #FF8124;
189 }
190
191 .hotel:nth-child(7n+2) .index {
192 color: #E4007F;
193 }
194
195 .hotel:nth-child(7n+3) .index {
196 color: #0068B7;
197 }
198
199 .hotel:nth-child(7n+4) .index {
200 color: #32B16C;
201 }
202
203 .hotel:nth-child(7n+5) .index {
204 color: #920783;
205 }
206
207 .hotel:nth-child(7n+6) .index {
208 color: #00B7EE;
209 }
210
211 .banner {
212 height: 140px;
213 background-size: cover;
214 text-align: center;
215 background: url("@/assets/booking/cl_bg.png") center;
216 display: flex;
217 align-items: center;
166 justify-content: center; 218 justify-content: center;
167 img{display: block;margin:-30px auto 0;width: auto;} 219
168 } 220 img {
169 .searchBar{position: relative;top: -30px; 221 display: block;
170 background: #FFFFFF;display: flex;padding: 20px; 222 margin: -30px auto 0;
171 border-radius: 10px;} 223 width: auto;
172 .no-border{border: none;background: #F5F7F9; 224 }
173 :deep(.el-input__wrapper){border: none;box-shadow: none;background: #F5F7F9;} 225 }
174 } 226
175 .starBox{ 227 .searchBar {
176 img{display: inline-block;margin-right: 4px} 228 position: relative;
177 } 229 top: -30px;
178 .tagbox{margin: 15px 0; 230 background: #FFFFFF;
179 a{color: #AFB5B9;font-size: 12px;} 231 display: flex;
180 span{border-radius: 13px;font-size: 12px;padding: 4px 10px;margin-right:10px;font-weight: 400;} 232 padding: 20px;
181 span:nth-child(4n){background: rgba(50, 177, 108, 0.2);color: rgba(50, 177, 108, 1);} 233 border-radius: 10px;
182 span:nth-child(4n+1){background:rgba(243, 152, 0, 0.2);color: rgba(243, 152, 0, 1);} 234 }
183 span:nth-child(4n+2){background: rgba(0, 160, 233, 0.2);color: rgba(0, 160, 233, 1);} 235
184 span:nth-child(4n+3){background: rgba(247, 64, 166, 0.2);color:rgba(247, 64, 166, 1);} 236 .no-border {
185 } 237 border: none;
186 .name.flex{align-items: center;} 238 background: #F5F7F9;
187 .name .tagbox{margin: 0 0 0 15px;} 239
240 :deep(.el-input__wrapper) {
241 border: none;
242 box-shadow: none;
243 background: #F5F7F9;
244 }
245 }
246
247 .starBox {
248 img {
249 display: inline-block;
250 margin-right: 4px
251 }
252 }
253
254 .tagbox {
255 margin: 15px 0;
256
257 a {
258 color: #AFB5B9;
259 font-size: 12px;
260 }
261
262 span {
263 border-radius: 13px;
264 font-size: 12px;
265 padding: 4px 10px;
266 margin-right: 10px;
267 font-weight: 400;
268 }
269
270 span:nth-child(4n) {
271 background: rgba(50, 177, 108, 0.2);
272 color: rgba(50, 177, 108, 1);
273 }
274
275 span:nth-child(4n+1) {
276 background: rgba(243, 152, 0, 0.2);
277 color: rgba(243, 152, 0, 1);
278 }
279
280 span:nth-child(4n+2) {
281 background: rgba(0, 160, 233, 0.2);
282 color: rgba(0, 160, 233, 1);
283 }
284
285 span:nth-child(4n+3) {
286 background: rgba(247, 64, 166, 0.2);
287 color: rgba(247, 64, 166, 1);
288 }
289 }
290
291 .name.flex {
292 align-items: center;
293 }
294
295 .name .tagbox {
296 margin: 0 0 0 15px;
297 }
298
188 .room { 299 .room {
189 background: #FAFBFD;margin: 20px 0 0;padding: 20px; 300 background: #FAFBFD;
301 margin: 20px 0 0;
302 padding: 20px;
190 border: 1px solid #E5E5E5; 303 border: 1px solid #E5E5E5;
191 .name{font-size: 20px;margin: 0 0 10px;} 304
192 .roomImg{aspect-ratio: 16/9;border-radius: 10px;overflow: hidden; 305 .name {
193 img{width: 100%;object-fit: cover;object-position: center;height: 100%;} 306 font-size: 20px;
307 margin: 0 0 10px;
308 }
309
310 .roomImg {
311 aspect-ratio: 16/9;
312 border-radius: 10px;
313 overflow: hidden;
314
315 img {
316 width: 100%;
317 object-fit: cover;
318 object-position: center;
319 height: 100%;
320 }
194 } 321 }
195 .price{color: #FF8124;font-size: 24px; 322
196 span{font-size: 36px;font-family: "DIN Alternate"} 323 .price {
324 color: #FF8124;
325 font-size: 24px;
326
327 span {
328 font-size: 36px;
329 font-family: "DIN Alternate"
330 }
331 }
332
333 .bg-lineg {
334 margin: auto;
335 border-radius: 10px;
336 text-align: center;
337 padding: 7px 2px 2px;
338 font-size: 24px;
339 width: 66px;
340 cursor: pointer;
341
342 div {
343 background: #fff;
344 font-size: 13px;
345 border-radius: 20px;
346 padding: 0 10px;
347 color: #453DEA;
348 font-weight: 500;
197 } 349 }
198 .bg-lineg{margin: auto;border-radius: 10px;text-align: center;padding: 7px 2px 2px;
199 font-size: 24px;width:66px;cursor: pointer;
200 div{background: #fff;font-size: 13px;border-radius: 20px;padding: 0 10px;
201 color: #453DEA;font-weight: 500;}
202 } 350 }
203 } 351 }
204 352
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!