车辆
Showing
1 changed file
with
9 additions
and
2 deletions
| ... | @@ -174,9 +174,11 @@ import { useRouter, useRoute } from 'vue-router' | ... | @@ -174,9 +174,11 @@ import { useRouter, useRoute } from 'vue-router' |
| 174 | import { useStorage } from '@vueuse/core/index' | 174 | import { useStorage } from '@vueuse/core/index' |
| 175 | import useUserStore from '@/store/modules/user' | 175 | import useUserStore from '@/store/modules/user' |
| 176 | import { getVehicleByCheckIn } from '@/apiPc/booking' | 176 | import { getVehicleByCheckIn } from '@/apiPc/booking' |
| 177 | import { computed } from 'vue' | ||
| 177 | 178 | ||
| 179 | const useStore = useUserStore() | ||
| 180 | const user = computed(() => useUserStore().user) | ||
| 178 | const { proxy } = getCurrentInstance() | 181 | const { proxy } = getCurrentInstance() |
| 179 | const user = useUserStore().user | ||
| 180 | const router = useRouter() | 182 | const router = useRouter() |
| 181 | const route = useRoute() | 183 | const route = useRoute() |
| 182 | const language = useStorage('language', 0) | 184 | const language = useStorage('language', 0) |
| ... | @@ -245,6 +247,11 @@ async function changeSelectOut() { | ... | @@ -245,6 +247,11 @@ async function changeSelectOut() { |
| 245 | } | 247 | } |
| 246 | 248 | ||
| 247 | async function handleSubmit(v) { | 249 | async function handleSubmit(v) { |
| 250 | if (!user.value) { | ||
| 251 | useStore.setVisitor() | ||
| 252 | return | ||
| 253 | } | ||
| 254 | |||
| 248 | let checkOut = {} | 255 | let checkOut = {} |
| 249 | let obj = {} | 256 | let obj = {} |
| 250 | if (v == 0) { | 257 | if (v == 0) { |
| ... | @@ -292,7 +299,7 @@ async function handleSubmit(v) { | ... | @@ -292,7 +299,7 @@ async function handleSubmit(v) { |
| 292 | 299 | ||
| 293 | 300 | ||
| 294 | function goOrder(item, car) { | 301 | function goOrder(item, car) { |
| 295 | if (!user) { | 302 | if (!user.value) { |
| 296 | useUserStore().setReLogin() | 303 | useUserStore().setReLogin() |
| 297 | return | 304 | return |
| 298 | } | 305 | } | ... | ... |
-
Please register or sign in to post a comment