f20b684b by zhangmeng

背号查询

1 parent 2f51406a
......@@ -137,6 +137,7 @@ import { triggerLanguage } from '@/utils/ruoyi'
import { useStorage } from '@vueuse/core/index'
import { useRoute, useRouter } from 'vue-router'
import { getCurrentInstance } from '@vue/runtime-core'
import dayjs from 'dayjs'
const language = useStorage('language', 0)
const useStore = useUserStore()
......@@ -170,7 +171,9 @@ onMounted(() => {
async function getLogexScenicVoById() {
const res = await booking.getLogexScenicVoById({ id: lasId.value })
travel.value = res.data
const nowDate = dayjs().format('YYYY-MM-DD')
selectForm.value.lasId = lasId.value
travel.value.dateList = travel.value.dateList.filter(val => dayjs(val).format('YYYY-MM-DD') >= nowDate)
if (travel.value.dateList && travel.value.dateList.length > 0) {
selectForm.value.scenicDate = travel.value.dateList[0]
await getGateListByLasId()
......@@ -183,6 +186,7 @@ async function getGateListByLasId() {
scenicDate: selectForm.value.scenicDate
})
ticketList.value = res.data
console.log(33333, ticketList.value)
for (const v of ticketList.value) {
v.leftNum = v.num - v.orderCount
v.count = 0
......@@ -230,6 +234,12 @@ async function toSelectSeat() {
await proxy.$modal.confirm(language.value == 0 ? '请选择日期' : 'Please select a date')
return
}
if (ticketList.value.length <= 0) {
await proxy.$modal.confirm(language.value == 0 ? `${selectForm.value.scenicDate}的票型已售完,请选择其它日期。` : `The ticket type for ${selectForm.value.scenicDate} is sold out. Please select another date.`)
return
}
if (!selectForm.value.price == '--' || selectForm.value.price == '--') {
await proxy.$modal.confirm(language.value == 0 ? '请选择购票数量' : 'Please select the number of tickets to purchase')
return
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!