酒店
Showing
1 changed file
with
45 additions
and
26 deletions
| ... | @@ -101,14 +101,13 @@ | ... | @@ -101,14 +101,13 @@ |
| 101 | <div class="price">{{ language==0?'¥':'€' }}<span>{{language==0?r.roomPrice:r.roomPriceEn}}</span></div> | 101 | <div class="price">{{ language==0?'¥':'€' }}<span>{{language==0?r.roomPrice:r.roomPriceEn}}</span></div> |
| 102 | </el-col> | 102 | </el-col> |
| 103 | <el-col :span="3"> | 103 | <el-col :span="3"> |
| 104 | <el-link v-if="language==0" @click="goOrder(r)" :disabled="!r.useCount"> | 104 | <el-button v-if="language==0" :disabled="!r.useCount" :class="{'forbid':!r.useCount}" @click="goOrder(r)" class="bg-lineg button"> |
| 105 | <div class="bg-lineg " :class="{'forbid':!r.useCount}" > | 105 | 订 |
| 106 | 订 | 106 | <div>{{ language==0?'在线付':'Online' }}</div> |
| 107 | <div>{{ language==0?'在线付':'Online' }}</div> | 107 | </el-button> |
| 108 | </div> | 108 | |
| 109 | </el-link> | 109 | |
| 110 | 110 | <el-button v-else :disabled="!r.useCount" class="btn-lineG w100" :class="{'forbid':!r.useCount}" round type="pri mary" @click="goOrder(r)">Select</el-button> | |
| 111 | <el-button v-else class="btn-lineG w100" round type="pri mary" @click="goOrder(r)">Select</el-button> | ||
| 112 | <!-- <div class="text-center text-primary mt10 fontsize14 pointer" v-if="language == 0">--> | 111 | <!-- <div class="text-center text-primary mt10 fontsize14 pointer" v-if="language == 0">--> |
| 113 | <!-- 剩余 {{(r.roomCount - (r.useCount||0)).toFixed()}} 间--> | 112 | <!-- 剩余 {{(r.roomCount - (r.useCount||0)).toFixed()}} 间--> |
| 114 | <!-- </div>--> | 113 | <!-- </div>--> |
| ... | @@ -128,12 +127,12 @@ | ... | @@ -128,12 +127,12 @@ |
| 128 | 127 | ||
| 129 | <script setup > | 128 | <script setup > |
| 130 | import {useRouter} from "vue-router"; | 129 | import {useRouter} from "vue-router"; |
| 131 | import {ref, reactive, onMounted} from "vue"; | 130 | import {ref, reactive, onMounted,getCurrentInstance} from "vue"; |
| 132 | import {useRoute} from "vue-router"; | 131 | import {useRoute} from "vue-router"; |
| 133 | import {dayjs} from 'element-plus' | 132 | import {dayjs} from 'element-plus' |
| 134 | import {getHotelById, getHotelRooms,checkRoomPayByUserId} from "@/apiPc/booking" | 133 | import {getHotelById, getHotelRooms,checkRoomPayByUserId} from "@/apiPc/booking" |
| 135 | import {getBaseInfoByActiveId} from "@/apiPc/booking"; | 134 | import {getBaseInfoByActiveId} from "@/apiPc/booking"; |
| 136 | 135 | const { proxy } = getCurrentInstance() | |
| 137 | 136 | ||
| 138 | import {useStorage} from "@vueuse/core/index"; | 137 | import {useStorage} from "@vueuse/core/index"; |
| 139 | import useUserStore from "@/store/modules/user"; | 138 | import useUserStore from "@/store/modules/user"; |
| ... | @@ -281,26 +280,32 @@ function goNext(room) { | ... | @@ -281,26 +280,32 @@ function goNext(room) { |
| 281 | 280 | ||
| 282 | function getDaysBetween(e){ | 281 | function getDaysBetween(e){ |
| 283 | console.log(hotTime.value) | 282 | console.log(hotTime.value) |
| 284 | getData() | 283 | if (hotTime.value && hotTime.value.length==2){ |
| 285 | console.log(e) | 284 | const d1=dayjs(hotTime.value[0]).format('YYYY-MM-DD') |
| 286 | } | 285 | const d2=dayjs(hotTime.value[1]).format('YYYY-MM-DD') |
| 287 | 286 | if (d1==d2){ | |
| 288 | function disabledDateRZ(date) { | 287 | hotTime.value=[] |
| 289 | //判读今天大与form.value.hqStart | 288 | return proxy.$modal.msgError(language.value==0?'入住时间跨度需要大于一天':'The duration of the stay must be more than one day.') |
| 290 | console.log(formTime.value.hqStart) | 289 | }else{ |
| 291 | // const start=dayjs(formTime.value.hqStart).format('YYYY-MM-DD') | 290 | getData() |
| 292 | // const end=dayjs(formTime.value.hqStart).format('YYYY-MM-DD') | ||
| 293 | if (formTime.value.hqStart) { | ||
| 294 | const today = dayjs().format('YYYY-MM-DD') | ||
| 295 | if (formTime.value.hqStart < today) { | ||
| 296 | return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) | ||
| 297 | } else { | ||
| 298 | return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) | ||
| 299 | } | 291 | } |
| 300 | } | 292 | } |
| 301 | return true | ||
| 302 | } | 293 | } |
| 303 | 294 | ||
| 295 | // function disabledDateRZ(date) { | ||
| 296 | // //判读今天大与form.value.hqStart | ||
| 297 | // console.log(date) | ||
| 298 | // if (formTime.value.hqStart) { | ||
| 299 | // const today = dayjs().format('YYYY-MM-DD') | ||
| 300 | // if (formTime.value.hqStart < today) { | ||
| 301 | // return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) | ||
| 302 | // } else { | ||
| 303 | // return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf())) | ||
| 304 | // } | ||
| 305 | // } | ||
| 306 | // // return true | ||
| 307 | // } | ||
| 308 | |||
| 304 | function goMap() { | 309 | function goMap() { |
| 305 | return | 310 | return |
| 306 | // var tencentMapUrl = "https://map.qq.com/"; | 311 | // var tencentMapUrl = "https://map.qq.com/"; |
| ... | @@ -364,6 +369,19 @@ function goMap() { | ... | @@ -364,6 +369,19 @@ function goMap() { |
| 364 | } | 369 | } |
| 365 | } | 370 | } |
| 366 | } | 371 | } |
| 372 | :deep(.button) { | ||
| 373 | display: block; | ||
| 374 | height: 55px; | ||
| 375 | width: auto; | ||
| 376 | color: #fff; | ||
| 377 | span{ | ||
| 378 | display: block !important; | ||
| 379 | div{ | ||
| 380 | margin-top: 3px; | ||
| 381 | } | ||
| 382 | } | ||
| 383 | |||
| 384 | } | ||
| 367 | 385 | ||
| 368 | .starBox { | 386 | .starBox { |
| 369 | img { | 387 | img { |
| ... | @@ -433,6 +451,7 @@ function goMap() { | ... | @@ -433,6 +451,7 @@ function goMap() { |
| 433 | .oddmb:nth-child(2){margin-bottom: 20px;} | 451 | .oddmb:nth-child(2){margin-bottom: 20px;} |
| 434 | .forbid{ | 452 | .forbid{ |
| 435 | cursor:not-allowed !important; | 453 | cursor:not-allowed !important; |
| 454 | color: #a8abb2; | ||
| 436 | filter:grayscale(1); | 455 | filter:grayscale(1); |
| 437 | } | 456 | } |
| 438 | </style> | 457 | </style> | ... | ... |
-
Please register or sign in to post a comment