Merge branch 'master' of github.com:merelendor/evoleasing-account
This commit is contained in:
commit
ba12601dcd
@ -16,7 +16,7 @@ if(process.browser)
|
||||
};
|
||||
}
|
||||
|
||||
export const sendLeasingOrder = ({ name, phone, email, company }) =>
|
||||
export const sendLeasingOrder = ({ name, phone, email, company, recaptcha_token }) =>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
@ -28,6 +28,7 @@ export const sendLeasingOrder = ({ name, phone, email, company }) =>
|
||||
formData.append("FORM_FIELD_COMPANY", company);
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
formData.append("recaptcha_token", recaptcha_token);
|
||||
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/forms/`, formData)
|
||||
.then((response) =>
|
||||
@ -38,7 +39,7 @@ export const sendLeasingOrder = ({ name, phone, email, company }) =>
|
||||
}
|
||||
else
|
||||
{
|
||||
reject();
|
||||
reject(response.data);
|
||||
}
|
||||
})
|
||||
.catch((error) =>
|
||||
|
||||
@ -3990,6 +3990,9 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
|
||||
color: var(--blue);
|
||||
font-weight: 600;
|
||||
}
|
||||
.grecaptcha-badge {
|
||||
visibility: hidden;
|
||||
}
|
||||
@media all and (max-width: 1279px) {
|
||||
.changes {
|
||||
min-height: 60vh;
|
||||
|
||||
@ -4461,6 +4461,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
}
|
||||
}
|
||||
|
||||
.grecaptcha-badge { visibility: hidden; }
|
||||
.changes {
|
||||
@media all and (max-width:1279px) {
|
||||
min-height: 60vh;
|
||||
|
||||
@ -30,6 +30,7 @@ module.exports = withImages(withFonts(withLess({
|
||||
async redirects()
|
||||
{
|
||||
return [
|
||||
process.env.MAINTENANCE_MODE === "1" ? { source: "/((?!maintenance|!?assets).*)", destination: "/maintenance", permanent: false } : { source: "/maintenance", destination: "/login", permanent: false },
|
||||
{
|
||||
source: '/support',
|
||||
destination: '/support/faq',
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
"react": "17.0.2",
|
||||
"react-cookie": "^4.1.1",
|
||||
"react-dom": "17.0.2",
|
||||
"react-google-recaptcha-v3": "^1.10.0",
|
||||
"react-dropzone": "^14.2.2",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-select": "^5.4.0",
|
||||
|
||||
@ -18,6 +18,7 @@ export default async function handler(req, res)
|
||||
{
|
||||
if(jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT))
|
||||
{
|
||||
console.log("req.query.urlreq.query.urlreq.query.urlreq.query.urlreq.query.url", req.query.url);
|
||||
try
|
||||
{
|
||||
axios.get(req.query.url, {
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import React from "react";
|
||||
import { SpinnerCircular } from 'spinners-react';
|
||||
import { GoogleReCaptchaProvider, GoogleReCaptcha, withGoogleReCaptcha } from 'react-google-recaptcha-v3';
|
||||
|
||||
import { sendLeasingOrder } from "../../../actions";
|
||||
|
||||
export default class FormRequest extends React.Component
|
||||
class FormContent extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
@ -14,6 +16,7 @@ export default class FormRequest extends React.Component
|
||||
company: "",
|
||||
accept: true,
|
||||
success: false,
|
||||
fail: false,
|
||||
leasing_form_submitting: false,
|
||||
errors: {},
|
||||
};
|
||||
@ -70,16 +73,34 @@ export default class FormRequest extends React.Component
|
||||
|
||||
if(accept && !leasing_form_submitting && this.checkErrors())
|
||||
{
|
||||
const { executeRecaptcha } = this.props.googleReCaptchaProps;
|
||||
|
||||
this.setState({ leasing_form_submitting: true }, () =>
|
||||
{
|
||||
sendLeasingOrder(this.state)
|
||||
executeRecaptcha()
|
||||
.then((token) =>
|
||||
{
|
||||
sendLeasingOrder({ ...this.state, ...{ recaptcha_token: token } })
|
||||
.then(() =>
|
||||
{
|
||||
this.setState({ leasing_form_submitting: false, success: true });
|
||||
this.setState({ leasing_form_submitting: false, success: true, fail: false });
|
||||
})
|
||||
.catch(() =>
|
||||
.catch((response) =>
|
||||
{
|
||||
this.setState({ leasing_form_submitting: false, success: false });
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
this.setState({ leasing_form_submitting: false, success: false, fail: true });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ leasing_form_submitting: false, success: false, fail: false });
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.error("error", error);
|
||||
this.setState({ leasing_form_submitting: false });
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -122,7 +143,7 @@ export default class FormRequest extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { name, phone, email, company, accept, success, errors } = this.state;
|
||||
const { name, phone, email, company, accept, success, fail, errors, leasing_form_submitting } = this.state;
|
||||
|
||||
return (
|
||||
<section id="order">
|
||||
@ -132,8 +153,8 @@ export default class FormRequest extends React.Component
|
||||
<div className="order_email">
|
||||
<p>Напишите на <a href="mailto:">buy@evoleasing.ru</a> или заполните форму</p>
|
||||
</div>
|
||||
<form onSubmit={ (event) => this._onFormSubmit(event) }>
|
||||
{ !success ? (
|
||||
<form onSubmit={ (event) => this._onFormSubmit(event) } style={ !fail ? {} : { backgroundColor: "#2C2D2E" }}>
|
||||
{ !success ? !fail ? (
|
||||
<>
|
||||
<div className={`form_field ${ errors['name'] !== undefined ? 'error' : '' }`} data-error={ errors['name'] !== undefined ? errors['name'] : null }>
|
||||
<input type="text" value={ name } placeholder="Имя" onChange={ (event) => this._handle_onChange_name(event.target.value) }/>
|
||||
@ -151,7 +172,17 @@ export default class FormRequest extends React.Component
|
||||
<input type="checkbox" name="policy" id="policy" hidden checked={ accept } onChange={ (event) => this._handle_onChange_accept(event.target.checked) }/>
|
||||
<label htmlFor="policy">Даю свое согласие на обработку {`\u00A0`}<u onClick={ () => this._handle_onPersonaData() }>моих персональных данных</u></label>
|
||||
</div>
|
||||
<button className="button" disabled={ !accept }>Отправить</button>
|
||||
<button className="button" disabled={ !accept } style={{ minWidth: "100px" }}>
|
||||
{ leasing_form_submitting ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(28, 1, 169, 1)" secondaryColor="rgba(236, 239, 244, 1)" style={{ marginTop: "4px" }}/>
|
||||
) : "Отправить" }
|
||||
</button>
|
||||
<div style={{ position: "absolute", left: "10px", bottom: "9px", fontSize: "9px", color: "#FFF", opacity: "0.5", lineHeight: "11px" }}>защита от спама reCAPTCHA<br/><a href="https://policies.google.com/privacy" target="_blank" style={{ fontSize: "9px", color: "#FFF", textDecoration: "underline" }}>Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style={{ fontSize: "9px", color: "#FFF", textDecoration: "underline" }}>Условия использования</a></div>
|
||||
</>
|
||||
) : (<>
|
||||
<div style={{ minHeight: "400px", alignItems: "center", justifyContent: "center", display: "flex" }}>
|
||||
<p style={{ color: "#fff", fontSize: "24px", lineHeight: "34px" }}>Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div style={{ minHeight: "400px", alignItems: "center", justifyContent: "center", display: "flex" }}>
|
||||
@ -165,3 +196,59 @@ export default class FormRequest extends React.Component
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export const FormContentWithRecaptcha = withGoogleReCaptcha(FormContent);
|
||||
|
||||
export default class FormRequest extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
};
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<GoogleReCaptchaProvider reCaptchaKey={ process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY }>
|
||||
<FormContentWithRecaptcha/>
|
||||
</GoogleReCaptchaProvider>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
export default class FormRequest extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
recaptcha_token: null,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
setTimeout(() =>
|
||||
{
|
||||
this.setState({ recaptcha_token: null });
|
||||
}, 120000);
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { recaptcha_token } = this.state;
|
||||
|
||||
return (
|
||||
<GoogleReCaptchaProvider reCaptchaKey={ process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY }>
|
||||
{ recaptcha_token === null && (
|
||||
<GoogleReCaptcha onVerify={ (token) => { console.log("GoogleReCaptcha", "token response", token); this.setState({ recaptcha_token: token })} }/>
|
||||
) }
|
||||
<FormContent recaptcha_token={ recaptcha_token }/>
|
||||
</GoogleReCaptchaProvider>
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -35,9 +35,17 @@ export default class CalculationsList extends React.Component
|
||||
super(props);
|
||||
this.state = {
|
||||
company: {},
|
||||
width: 1920
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
this.setState({
|
||||
width: window.innerWidth
|
||||
})
|
||||
}
|
||||
|
||||
_handle_onCalculation = (calculation_id) =>
|
||||
{
|
||||
//href={ `/contract/${ number }/change/#${ calculation.addcontract_number }` }
|
||||
@ -50,10 +58,10 @@ export default class CalculationsList extends React.Component
|
||||
dots: false,
|
||||
infinite: false,
|
||||
speed: 500,
|
||||
slidesToShow: 2.3,
|
||||
slidesToScroll: 1,
|
||||
slidesToShow: this.state.width < 1279 ? 1 : 2.3,
|
||||
centerMode: false,
|
||||
variableWidth: false,
|
||||
variableWidth: this.state.width < 1279 ? true : false,
|
||||
dragFree: this.state.width < 1279 ? true : false,
|
||||
nextArrow: <NextArrow />,
|
||||
prevArrow: <PrevArrow />,
|
||||
};
|
||||
|
||||
@ -34,19 +34,28 @@ export default class SignatoriesList extends React.Component
|
||||
super(props);
|
||||
this.state = {
|
||||
company: {},
|
||||
width: 1920
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
this.setState({
|
||||
width: window.innerWidth
|
||||
})
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const settings = {
|
||||
dots: false,
|
||||
infinite: false,
|
||||
speed: 500,
|
||||
slidesToShow: 2.5,
|
||||
slidesToScroll: 1,
|
||||
slidesToShow: this.state.width < 1279 ? 1 : 2.5,
|
||||
centerMode: false,
|
||||
variableWidth: this.state.width < 1279 ? true : false,
|
||||
dragFree: this.state.width < 1279 ? true : false,
|
||||
centerMode: false,
|
||||
variableWidth: false,
|
||||
nextArrow: <NextArrow />,
|
||||
prevArrow: <PrevArrow />,
|
||||
};
|
||||
|
||||
56
pages/maintenance.js
Normal file
56
pages/maintenance.js
Normal file
@ -0,0 +1,56 @@
|
||||
import React from "react";
|
||||
import Head from "next/head";
|
||||
|
||||
import MainHeader from "./components/MainHeader";
|
||||
import Footer from "./components/Footer";
|
||||
|
||||
class Page503 extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
{
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
componentDidMount() {}
|
||||
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Head>
|
||||
<title>ЛК Эволюция автолизинга</title>
|
||||
<meta name="description" content="ЛК Эволюция автолизинга" />
|
||||
</Head>
|
||||
<MainHeader/>
|
||||
<main>
|
||||
<section>
|
||||
<div className="clear"></div>
|
||||
<div className="container">
|
||||
<div className="title_wrapper">
|
||||
<div className="left">
|
||||
<h1 className="section_title">Личный кабинет</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className="offline">
|
||||
<p>
|
||||
В настоящий момент ведутся технические работы. Если Вам
|
||||
необходимо получить информацию, пожалуйста, свяжитесь с нами
|
||||
по телефону: 8 800 333 75 75
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<Footer/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Page503;
|
||||
Loading…
x
Reference in New Issue
Block a user