no message
Showing
4 changed files
with
75 additions
and
19 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | export function getHotelList(params) { | 2 | export function getHotelList(params) { |
| 3 | return request({ | 3 | return request({ |
| 4 | // url: `/logex/activityHotel/list`, | 4 | url: `/ota/activityHotel/list`, |
| 5 | url: `/league/competition/webList`, | ||
| 6 | method: 'get', | 5 | method: 'get', |
| 7 | params: params | 6 | params: params |
| 8 | }) | 7 | }) |
| 9 | } | 8 | } |
| 9 | export function getHotelById(id) { | ||
| 10 | return request({ | ||
| 11 | url: `/ota/hotel/${id}`, | ||
| 12 | method: 'get' | ||
| 13 | }) | ||
| 14 | } | ... | ... |
| ... | @@ -356,6 +356,12 @@ export const constantRoutes = [ | ... | @@ -356,6 +356,12 @@ export const constantRoutes = [ |
| 356 | meta: { title: 'Hotel Reservation' } | 356 | meta: { title: 'Hotel Reservation' } |
| 357 | }, | 357 | }, |
| 358 | { | 358 | { |
| 359 | path: 'hotel/:cptId/:hotelId', | ||
| 360 | component: () => import('@/viewsPc/booking/hotelDetail'), | ||
| 361 | name: 'hotelDetail', | ||
| 362 | meta: { title: 'Hotel Reservation' } | ||
| 363 | }, | ||
| 364 | { | ||
| 359 | path: 'car/:cptId', | 365 | path: 'car/:cptId', |
| 360 | component: () => import('@/viewsPc/booking/car'), | 366 | component: () => import('@/viewsPc/booking/car'), |
| 361 | name: 'car', | 367 | name: 'car', | ... | ... |
| ... | @@ -12,27 +12,28 @@ | ... | @@ -12,27 +12,28 @@ |
| 12 | </div> | 12 | </div> |
| 13 | 13 | ||
| 14 | <div class="box"> | 14 | <div class="box"> |
| 15 | <el-card v-for="(h,index) in list" class="mb20"> | 15 | <el-card v-for="(h,index) in list" class="mb20" @click="goDetail(h)"> |
| 16 | <!-- 酒店列表--> | 16 | <!-- 酒店列表--> |
| 17 | <el-row class="hotel" align="middle"> | 17 | <el-row class="hotel" align="middle" :gutter="20"> |
| 18 | <el-col :span="8"> | 18 | <el-col :span="6"> |
| 19 | <img/> | 19 | <img class="w100" :src="fillImgUrl(h.photos?.split(',')[0])"/> |
| 20 | </el-col> | 20 | </el-col> |
| 21 | <el-col :span="8"> | 21 | <el-col :span="10"> |
| 22 | <h3>{{h.name}}</h3> | 22 | <h3 class="esp">{{h.name}}</h3> |
| 23 | <div> | 23 | <div class="starBox"> |
| 24 | <img src="@/assets/booking/star.png"> | 24 | <img v-for="i in Number(h.starLevel||0)" src="@/assets/booking/star.png"> |
| 25 | </div> | 25 | </div> |
| 26 | <div> | 26 | <div class="tagbox"> |
| 27 | <span v-for="t in h.tags">{{t}}</span> | 27 | <span v-for="(t,index) in h.label?.split(',')" v-show="index<4">{{t}}</span> |
| 28 | <a v-show="h.label?.split(',').length>4">更多 ></a> | ||
| 28 | </div> | 29 | </div> |
| 29 | <p> | 30 | <p class="esp addr"> |
| 30 | <el-icon><LocationFilled /></el-icon> | 31 | <el-icon size="16" style="position: relative;top: 2px" color="#929AA0"><LocationFilled /></el-icon> |
| 31 | {{h.address}} | 32 | {{h.address}} |
| 32 | </p> | 33 | </p> |
| 33 | </el-col> | 34 | </el-col> |
| 34 | <el-col :span="8" class="text-right"> | 35 | <el-col :span="8" class="text-right"> |
| 35 | <div class="price">¥<span>450</span><i>起</i></div> | 36 | <div class="price">¥<span>{{ h.price }}</span><i>起</i></div> |
| 36 | <el-button class="btn-lineG w200px" round type="primary" size="large">立即预约 ⇀</el-button> | 37 | <el-button class="btn-lineG w200px" round type="primary" size="large">立即预约 ⇀</el-button> |
| 37 | </el-col> | 38 | </el-col> |
| 38 | </el-row> | 39 | </el-row> |
| ... | @@ -45,6 +46,8 @@ | ... | @@ -45,6 +46,8 @@ |
| 45 | <script setup> | 46 | <script setup> |
| 46 | import {onMounted} from "@vue/runtime-core" | 47 | import {onMounted} from "@vue/runtime-core" |
| 47 | import * as booking from "@/apiPc/booking" | 48 | import * as booking from "@/apiPc/booking" |
| 49 | import {useRouter} from "vue-router"; | ||
| 50 | const router = useRouter() | ||
| 48 | const query = ref({ | 51 | const query = ref({ |
| 49 | name:'' | 52 | name:'' |
| 50 | }) | 53 | }) |
| ... | @@ -58,10 +61,27 @@ | ... | @@ -58,10 +61,27 @@ |
| 58 | list.value = res.rows | 61 | list.value = res.rows |
| 59 | }) | 62 | }) |
| 60 | } | 63 | } |
| 64 | function goDetail(item) { | ||
| 65 | router.push({ | ||
| 66 | name:'hotelDetail', | ||
| 67 | params:{ | ||
| 68 | hotelId:item.id | ||
| 69 | } | ||
| 70 | }) | ||
| 71 | } | ||
| 61 | </script> | 72 | </script> |
| 62 | 73 | ||
| 63 | <style scoped lang="scss"> | 74 | <style scoped lang="scss"> |
| 64 | .hotel{} | 75 | .hotel{ |
| 76 | h3{margin: 0 0 20px;} | ||
| 77 | img.w100{object-fit: cover;aspect-ratio: 16/9} | ||
| 78 | .addr{font-size: 16px;color: #929AA0;font-weight: 400;} | ||
| 79 | .price{margin: 0 0 25px; | ||
| 80 | color: #FF8124;font-size: 18px; | ||
| 81 | span{font-size: 24px;margin: 0 8px;font-family: 'DINAlternate-Bold';font-weight: 600;} | ||
| 82 | i{font-style: normal;color: #929AA0;} | ||
| 83 | } | ||
| 84 | } | ||
| 65 | .banner{height: 140px;background-size: cover;text-align: center; | 85 | .banner{height: 140px;background-size: cover;text-align: center; |
| 66 | background: url("@/assets/booking/jd_bg.png") center;display: flex;align-items: center; | 86 | background: url("@/assets/booking/jd_bg.png") center;display: flex;align-items: center; |
| 67 | justify-content: center; | 87 | justify-content: center; |
| ... | @@ -73,4 +93,15 @@ | ... | @@ -73,4 +93,15 @@ |
| 73 | .no-border{border: none;background: #F5F7F9; | 93 | .no-border{border: none;background: #F5F7F9; |
| 74 | :deep(.el-input__wrapper){border: none;box-shadow: none;background: #F5F7F9;} | 94 | :deep(.el-input__wrapper){border: none;box-shadow: none;background: #F5F7F9;} |
| 75 | } | 95 | } |
| 96 | .starBox{ | ||
| 97 | img{display: inline-block;margin-right: 4px} | ||
| 98 | } | ||
| 99 | .tagbox{margin: 15px 0; | ||
| 100 | a{color: #AFB5B9;font-size: 12px;} | ||
| 101 | span{border-radius: 13px;font-size: 12px;padding: 4px 10px;margin-right:10px;font-weight: 400;} | ||
| 102 | span:nth-child(4n){background: rgba(50, 177, 108, 0.2);color: rgba(50, 177, 108, 1);} | ||
| 103 | span:nth-child(4n+1){background:rgba(243, 152, 0, 0.2);color: rgba(243, 152, 0, 1);} | ||
| 104 | span:nth-child(4n+2){background: rgba(0, 160, 233, 0.2);color: rgba(0, 160, 233, 1);} | ||
| 105 | span:nth-child(4n+3){background: rgba(247, 64, 166, 0.2);color:rgba(247, 64, 166, 1);} | ||
| 106 | } | ||
| 76 | </style> | 107 | </style> | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div class="box"> | ||
| 3 | <div> | 2 | <div> |
| 3 | <div class="box"> | ||
| 4 | <el-card class="mt30"> | 4 | <el-card class="mt30"> |
| 5 | 5 | <h3>{{form.name}}</h3> | |
| 6 | </el-card> | 6 | </el-card> |
| 7 | </div> | 7 | </div> |
| 8 | </div> | 8 | </div> |
| 9 | </template> | 9 | </template> |
| 10 | 10 | ||
| 11 | <script setup> | 11 | <script setup> |
| 12 | 12 | import {useRouter} from "vue-router"; | |
| 13 | import {ref, reactive, onMounted} from "vue"; | ||
| 14 | import {useRoute} from "vue-router"; | ||
| 15 | import { getHotelById } from "@/apiPc/booking" | ||
| 16 | const router = useRouter() | ||
| 17 | const route = useRoute() | ||
| 18 | const form = ref({}) | ||
| 19 | getData() | ||
| 20 | function getData() { | ||
| 21 | getHotelById(route.params.hotelId).then(res=>{ | ||
| 22 | form.value = res.data | ||
| 23 | }).catch(err=>{ | ||
| 24 | console.log(err) | ||
| 25 | }) | ||
| 26 | } | ||
| 13 | </script> | 27 | </script> |
| 14 | 28 | ||
| 15 | <style scoped> | 29 | <style scoped> | ... | ... |
-
Please register or sign in to post a comment