|
|
@ -1,6 +1,5 @@ |
|
|
import React, { useState, useEffect } from "react"; |
|
|
import React, { useState, useEffect } from "react"; |
|
|
import car from "./car.png"; |
|
|
import car from "./car.png"; |
|
|
import axios from "axios"; |
|
|
|
|
|
import "./Car.scss"; |
|
|
import "./Car.scss"; |
|
|
import plus from "./plus.svg"; |
|
|
import plus from "./plus.svg"; |
|
|
import Keyboard from "../Keyboard/Keyboard"; |
|
|
import Keyboard from "../Keyboard/Keyboard"; |
|
|
@ -8,10 +7,10 @@ import platepng from "./plate.png"; |
|
|
import plateActive from "./plate_active.png"; |
|
|
import plateActive from "./plate_active.png"; |
|
|
import lot from "./lot.png"; |
|
|
import lot from "./lot.png"; |
|
|
import lotActive from "./lot_active.png"; |
|
|
import lotActive from "./lot_active.png"; |
|
|
|
|
|
|
|
|
|
|
|
import { post } from "../../js/helpers/data-helper"; |
|
|
const Car = ({ lots, onLot = () => {}, plate, hasReverse }) => { |
|
|
const Car = ({ lots, onLot = () => {}, plate, hasReverse }) => { |
|
|
const [isPlate, setIsPlate] = useState(hasReverse); |
|
|
const [isPlate, setIsPlate] = useState(hasReverse); |
|
|
const [qArr, setQArr] = useState(hasReverse ? ["苏", "A"] : []); |
|
|
|
|
|
|
|
|
const [qArr, setQArr] = useState(hasReverse ? ["川", "A"] : []); |
|
|
const [opened, setOpened] = useState(false); |
|
|
const [opened, setOpened] = useState(false); |
|
|
const [showKeyBoard, setShowKeyBoard] = useState(true); |
|
|
const [showKeyBoard, setShowKeyBoard] = useState(true); |
|
|
const [focusedIndex, setFocusedIndex] = useState(hasReverse ? 2 : 0); |
|
|
const [focusedIndex, setFocusedIndex] = useState(hasReverse ? 2 : 0); |
|
|
@ -33,7 +32,7 @@ const Car = ({ lots, onLot = () => {}, plate, hasReverse }) => { |
|
|
return window.weui.toast("敬请期待", { |
|
|
return window.weui.toast("敬请期待", { |
|
|
className: "toast", |
|
|
className: "toast", |
|
|
}); |
|
|
}); |
|
|
setQ("苏A"); |
|
|
|
|
|
|
|
|
setQ("川A"); |
|
|
setIsPlate(true); |
|
|
setIsPlate(true); |
|
|
setFocusedIndex(2); |
|
|
setFocusedIndex(2); |
|
|
setShowKeyBoard(true); |
|
|
setShowKeyBoard(true); |
|
|
@ -54,17 +53,17 @@ const Car = ({ lots, onLot = () => {}, plate, hasReverse }) => { |
|
|
} |
|
|
} |
|
|
const { |
|
|
const { |
|
|
data: { data, code, msg }, |
|
|
data: { data, code, msg }, |
|
|
} = { data: { data: null, code: "201", msg: "123" } }; |
|
|
|
|
|
|
|
|
} = await post("/api/ar/v1/applet/GetCarSpace", { CarNum: q }); |
|
|
if (code !== 200) |
|
|
if (code !== 200) |
|
|
return window.weui.toast(msg, { |
|
|
return window.weui.toast(msg, { |
|
|
className: "toast", |
|
|
className: "toast", |
|
|
}); |
|
|
}); |
|
|
else { |
|
|
else { |
|
|
if (!lots.includes(data.spaceNo)) |
|
|
|
|
|
return window.weui.toast(`未找到车位号:${data.spaceNo}`, { |
|
|
|
|
|
|
|
|
if (!lots.includes(data.spaceNum)) |
|
|
|
|
|
return window.weui.toast(`未找到车位号:${data.spaceNum}`, { |
|
|
className: "toast", |
|
|
className: "toast", |
|
|
}); |
|
|
}); |
|
|
return onLot(data.spaceNo); |
|
|
|
|
|
|
|
|
return onLot(data.spaceNum); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// if (!q || !lots.includes(floor + q.toUpperCase())) {
|
|
|
// if (!q || !lots.includes(floor + q.toUpperCase())) {
|
|
|
|