背号查询
Showing
1 changed file
with
10 additions
and
0 deletions
| ... | @@ -137,6 +137,7 @@ import { triggerLanguage } from '@/utils/ruoyi' | ... | @@ -137,6 +137,7 @@ import { triggerLanguage } from '@/utils/ruoyi' |
| 137 | import { useStorage } from '@vueuse/core/index' | 137 | import { useStorage } from '@vueuse/core/index' |
| 138 | import { useRoute, useRouter } from 'vue-router' | 138 | import { useRoute, useRouter } from 'vue-router' |
| 139 | import { getCurrentInstance } from '@vue/runtime-core' | 139 | import { getCurrentInstance } from '@vue/runtime-core' |
| 140 | import dayjs from 'dayjs' | ||
| 140 | 141 | ||
| 141 | const language = useStorage('language', 0) | 142 | const language = useStorage('language', 0) |
| 142 | const useStore = useUserStore() | 143 | const useStore = useUserStore() |
| ... | @@ -170,7 +171,9 @@ onMounted(() => { | ... | @@ -170,7 +171,9 @@ onMounted(() => { |
| 170 | async function getLogexScenicVoById() { | 171 | async function getLogexScenicVoById() { |
| 171 | const res = await booking.getLogexScenicVoById({ id: lasId.value }) | 172 | const res = await booking.getLogexScenicVoById({ id: lasId.value }) |
| 172 | travel.value = res.data | 173 | travel.value = res.data |
| 174 | const nowDate = dayjs().format('YYYY-MM-DD') | ||
| 173 | selectForm.value.lasId = lasId.value | 175 | selectForm.value.lasId = lasId.value |
| 176 | travel.value.dateList = travel.value.dateList.filter(val => dayjs(val).format('YYYY-MM-DD') >= nowDate) | ||
| 174 | if (travel.value.dateList && travel.value.dateList.length > 0) { | 177 | if (travel.value.dateList && travel.value.dateList.length > 0) { |
| 175 | selectForm.value.scenicDate = travel.value.dateList[0] | 178 | selectForm.value.scenicDate = travel.value.dateList[0] |
| 176 | await getGateListByLasId() | 179 | await getGateListByLasId() |
| ... | @@ -183,6 +186,7 @@ async function getGateListByLasId() { | ... | @@ -183,6 +186,7 @@ async function getGateListByLasId() { |
| 183 | scenicDate: selectForm.value.scenicDate | 186 | scenicDate: selectForm.value.scenicDate |
| 184 | }) | 187 | }) |
| 185 | ticketList.value = res.data | 188 | ticketList.value = res.data |
| 189 | console.log(33333, ticketList.value) | ||
| 186 | for (const v of ticketList.value) { | 190 | for (const v of ticketList.value) { |
| 187 | v.leftNum = v.num - v.orderCount | 191 | v.leftNum = v.num - v.orderCount |
| 188 | v.count = 0 | 192 | v.count = 0 |
| ... | @@ -230,6 +234,12 @@ async function toSelectSeat() { | ... | @@ -230,6 +234,12 @@ async function toSelectSeat() { |
| 230 | await proxy.$modal.confirm(language.value == 0 ? '请选择日期' : 'Please select a date') | 234 | await proxy.$modal.confirm(language.value == 0 ? '请选择日期' : 'Please select a date') |
| 231 | return | 235 | return |
| 232 | } | 236 | } |
| 237 | |||
| 238 | if (ticketList.value.length <= 0) { | ||
| 239 | await proxy.$modal.confirm(language.value == 0 ? `${selectForm.value.scenicDate}的票型已售完,请选择其它日期。` : `The ticket type for ${selectForm.value.scenicDate} is sold out. Please select another date.`) | ||
| 240 | return | ||
| 241 | } | ||
| 242 | |||
| 233 | if (!selectForm.value.price == '--' || selectForm.value.price == '--') { | 243 | if (!selectForm.value.price == '--' || selectForm.value.price == '--') { |
| 234 | await proxy.$modal.confirm(language.value == 0 ? '请选择购票数量' : 'Please select the number of tickets to purchase') | 244 | await proxy.$modal.confirm(language.value == 0 ? '请选择购票数量' : 'Please select the number of tickets to purchase') |
| 235 | return | 245 | return | ... | ... |
-
Please register or sign in to post a comment