._.
This commit is contained in:
parent
05f77f2ad6
commit
0bb21e8aab
@ -26,6 +26,8 @@ const DeliveryOrderDetails = () => {
|
|||||||
const [coordinates, setCoordinates] = useState([]);
|
const [coordinates, setCoordinates] = useState([]);
|
||||||
const [route, setRoute] = useState([]);
|
const [route, setRoute] = useState([]);
|
||||||
const [totalCost, setTotalCost] = useState(0);
|
const [totalCost, setTotalCost] = useState(0);
|
||||||
|
const [truckCount, setTruckCount] = useState(0);
|
||||||
|
const [truckName, settruckName] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchDeliveryAccessories();
|
fetchDeliveryAccessories();
|
||||||
@ -37,6 +39,8 @@ const DeliveryOrderDetails = () => {
|
|||||||
deliveryOrderId
|
deliveryOrderId
|
||||||
);
|
);
|
||||||
setTotalCost(deliveryOrderDetails.price);
|
setTotalCost(deliveryOrderDetails.price);
|
||||||
|
setTruckCount(deliveryOrderDetails.count_trucks);
|
||||||
|
settruckName(deliveryOrderDetails.truck_name);
|
||||||
|
|
||||||
const accessories = await getDeliveryAccessories(deliveryOrderId);
|
const accessories = await getDeliveryAccessories(deliveryOrderId);
|
||||||
setDeliveryAccessories(accessories);
|
setDeliveryAccessories(accessories);
|
||||||
@ -89,7 +93,9 @@ const DeliveryOrderDetails = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="content-container">
|
<div className="content-container">
|
||||||
<h2>Общая стоимость подзаказа: {totalCost} руб.</h2>{" "}
|
<h2>Общая стоимость подзаказа: {totalCost} руб.</h2>
|
||||||
|
<h3>Тип машины: {truckName}</h3>
|
||||||
|
<h3>Количество машин: {truckCount}</h3>
|
||||||
<ol className="city-list">
|
<ol className="city-list">
|
||||||
{deliveryAccessories.map((accessory, index) => {
|
{deliveryAccessories.map((accessory, index) => {
|
||||||
const coord = coordinates.find(
|
const coord = coordinates.find(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user