From 6ff2629b80173d8bb581c162e60a753b5ecec45f Mon Sep 17 00:00:00 2001 From: inmake Date: Wed, 19 Apr 2023 19:23:32 +0500 Subject: [PATCH] upd --- client/package.json | 1 + client/src/App.tsx | 177 ++++++++++++--------- client/src/components/Calc.tsx | 216 +++++--------------------- client/src/components/ComplexCard.tsx | 32 ++++ client/src/components/Map.tsx | 2 +- client/src/components/VRHemlet.tsx | 3 +- client/yarn.lock | 22 ++- server/app.js | 36 ++++- server/package.json | 3 +- server/yarn.lock | 5 + 10 files changed, 248 insertions(+), 249 deletions(-) create mode 100644 client/src/components/ComplexCard.tsx diff --git a/client/package.json b/client/package.json index ffb09ee..68eec41 100644 --- a/client/package.json +++ b/client/package.json @@ -11,6 +11,7 @@ "dependencies": { "@react-three/drei": "^9.62.2", "@react-three/fiber": "^8.12.0", + "@react-three/postprocessing": "^2.7.1", "framer-motion": "^10.11.6", "ky": "^0.33.3", "react": "^18.2.0", diff --git a/client/src/App.tsx b/client/src/App.tsx index 4add304..dd93f99 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -2,7 +2,7 @@ import "./App.css"; import { Canvas } from "@react-three/fiber"; import { FormEvent, Suspense, useEffect, useRef, useState } from "react"; import PieChart from "./components/PieChart/PieChart"; -import { Model } from "./components/govno"; +import { Model } from "./components/VRHemlet"; import Calc from "./components/Calc"; import Slider from "./components/Slider/Slider"; import Map from "./components/Map"; @@ -10,6 +10,7 @@ import { motion } from "framer-motion"; import InputMask from "react-input-mask"; import api from "./utils/api"; import { OrbitControls, PerspectiveCamera, Wireframe } from "@react-three/drei"; +import ComplexCard from "./components/ComplexCard"; function App() { const parallaxRef = useRef(null); @@ -19,6 +20,9 @@ function App() { const [company, setCompany] = useState(""); const [phone, setPhone] = useState(""); + const [isShowMoreComplexCards, setIsShowMoreComplexCards] = + useState(false); + function handleScroll() { if (parallaxRef.current) { parallaxRef.current.style.transform = `translateY(${ @@ -179,11 +183,11 @@ function App() { - + /> */} @@ -204,7 +208,7 @@ function App() {
-
+
Анализируем @@ -420,10 +424,10 @@ function App() {
-
-
-
-
+
+
+
+

Инструмент продаж поможет вам продавать удаленно

@@ -459,15 +463,15 @@ function App() {
+
+ +
-
- -
-
+
Можем оценить @@ -495,75 +499,108 @@ function App() {
-
+

Релевантный опыт

-
MAP
+ {/*
MAP
*/}
-
-
- + + + + {isShowMoreComplexCards && ( + <> + -
-
-
-

- ЖК «Авторский квартал Машаров» -

-

- Россия, Тюмень -

-
-
-
- -
-
- -
-
-
-

- ЖК «Авторский квартал Машаров» -

-

- Россия, Тюмень -

-
-
-
+ + + + + + + + + )} - {/*
*/} - - {/*
*/} + Показать больше + + + + + )}
diff --git a/client/src/components/Calc.tsx b/client/src/components/Calc.tsx index d7aee6b..a0e3616 100644 --- a/client/src/components/Calc.tsx +++ b/client/src/components/Calc.tsx @@ -2,6 +2,7 @@ import React, { ChangeEvent, useEffect, useState } from "react"; import SearchableSelect from "./SearchableSelect"; import RangeSlider from "./RangeSlider"; import ky from "ky"; +import { motion } from "framer-motion"; function Calc() { const [regions, setRegions] = useState([]); @@ -16,6 +17,8 @@ function Calc() { const [profitPerMonth, setProfitPerMonth] = useState(); const [implementationTime, setImplementationTime] = useState(); const [avgAreaInComplex, setAvgAreaInComplex] = useState(10000); + const [implementationTimeCase, setImplementationTimeCase] = + useState(""); async function getRegions() { const result: [] = await ky.get("http://localhost:3000/regions").json(); @@ -76,170 +79,25 @@ function Calc() { averagePrice, ]); + useEffect(() => { + if (implementationTime) { + const lastIndex = Number(implementationTime.toString().at(-1)); + + if (lastIndex === 1) { + setImplementationTimeCase("месяц"); + } else if (lastIndex > 1 && lastIndex < 5) { + setImplementationTimeCase("месяца"); + } else if ((lastIndex > 4 && lastIndex < 15) || lastIndex === 0) { + setImplementationTimeCase("месяцев"); + } + } + }, [implementationTime]); + useEffect(() => { getRegions(); }, []); return ( - //
- //
- //
- //
- // - // selectRegion(option.id)} - // /> - //
- //

- // Данные будут установлены в соответсвии со средними показателями по - // выбранному региону - //

- //
- //
- // - // - //
- //
- // - // - //
- //
- // - // setAverageApartmentArea(value)} - // /> - //
- //
- // - // setAveragePrice(value)} - // /> - //
- //
- //
- //
- //
- //
- //

- // Консультации, закончившиеся бронью - //

- //
- // {consultsInBooking} - // {!isEnabled ? "30" : "45"}% - //
- //
- //
- //
- //
- // 0 - // 50 - // 100 - //
- //
- - //
- //

Продажи

- //
- // {consultsInSales} - // {!isEnabled ? "10" : "20"}% - //
- //
- //
- //
- //
- // 0 - // 50 - // 100 - //
- //
- //
- - //
- //

Результаты расчета

- //
- //
- //

- // {implementationTime} - // месяцев - //

- //

- // На{" "} - // - // 12 месяцев - // {" "} - // вы сократили - //
- // срок реализации проекта - //

- //
- - //
- //

- // {profitPerMonth} - // млн. руб. - //

- //

- // На{" "} - // - // 37,8 млн. руб. - // {" "} - // в месяц вы заработали больше - //
с помощью нашего инструмента продаж - //

- //
- //
- //
- - // - //
- //
- //
-

@@ -256,7 +114,9 @@ function Calc() {

- Средняя площадь жилья в комплексе + Средняя площадь +
+ жилья в комплексе

{avgAreaInComplex} @@ -266,7 +126,9 @@ function Calc() {

- Средняя площадь квартиры + Средняя площадь +
+ квартиры

@@ -278,7 +140,9 @@ function Calc() {

- Средняя стоимость одного м2 + Средняя стоимость +
+ одного м2

{averagePrice} @@ -369,36 +233,42 @@ function Calc() {

Результаты расчета

-
-
-

Срок реализации

+
+
+

+ Срок реализации +

{implementationTime}

-

месяцa

+

+ {implementationTimeCase} +

-
-

Месячный доход

+
+

+ Месячный доход +

{profitPerMonth}

-

млн. р.

+

млн. р.

-
+