From 737516743bb3e2d75ec23660c77687dd49490ecf Mon Sep 17 00:00:00 2001 From: merelendor Date: Mon, 8 Aug 2022 07:05:49 +0300 Subject: [PATCH] events, graphic changes, support --- actions/authActions.js | 51 +- actions/contractActions.js | 221 +++ actions/eventsActions.js | 91 +- actions/fileActions.js | 31 +- constants/actionTypes.js | 11 +- css/components/style.css | 543 +++++++- css/components/style.less | 2 +- css/var.css | 534 +++++++- css/var.less | 11 + lib/CRMRequest/index.js | 68 + next.config.js | 29 +- pages/api/auth/offstage.js | 44 + pages/api/contract/change/calculations.js | 7 + .../api/contract/change/graphic/calculate.js | 7 + .../contract/change/graphic/calculation.js | 7 + pages/api/contract/change/graphic/current.js | 7 + pages/api/contract/change/signatories.js | 7 + pages/api/contract/change/variants.js | 7 + pages/api/contract/penalties.js | 51 + pages/api/contracts.js | 2 +- pages/api/events.js | 17 +- pages/api/events/get.js | 0 pages/api/events/read.js | 0 pages/api/file/image.js | 56 +- pages/appeal/detail.js | 152 --- pages/appeal/events.js | 245 ---- pages/appeal/index.js | 258 ---- pages/appeal/new.js | 220 --- pages/components/Company/index.js | 10 +- pages/components/Events/InnerMenu/index.js | 59 +- .../Events/NotificationMessage/index.js | 170 +++ .../Header/NotificationsList/index.js | 103 +- pages/components/Header/index.js | 28 +- pages/components/Manager/index.js | 66 + pages/contract/__change.js | 329 +++++ pages/contract/agreement.js | 434 +++--- pages/contract/change.js | 475 ------- .../components/CalculationsList/index.js | 86 ++ .../change/components/Comparison/index.js | 311 +++++ .../contract/change/components/Final/index.js | 28 + .../change/components/Options/index.js | 121 ++ .../components/SignatoriesList/index.js | 75 ++ .../change/components/VariantsList/index.js | 96 ++ pages/contract/change/index.js | 415 ++++++ pages/contract/compare.js | 923 ++++++------- .../components/FinesCalculatorForm/index.js | 99 ++ pages/contract/components/InnerMenu/index.js | 29 +- pages/contract/documents.js | 1198 ++++++++--------- pages/contract/events.js | 302 ++--- pages/contract/fine.js | 173 --- pages/contract/fines.js | 687 ++++++++++ pages/contract/index.js | 40 +- pages/contract/materials.js | 3 +- pages/contract/penalties.js | 216 +++ pages/contract/services.js | 3 +- pages/events.js | 361 ++--- pages/index.js | 24 +- pages/login.js | 45 + pages/offstage.js | 102 ++ .../components}/InnerMenu/index.js | 6 +- pages/support/detail.js | 145 ++ pages/support/index.js | 221 +++ pages/support/messages.js | 217 +++ pages/support/new.js | 220 +++ reducers/contractReducer.js | 8 + reducers/eventsReducer.js | 8 + reducers/initialState.js | 11 + 67 files changed, 7118 insertions(+), 3408 deletions(-) create mode 100644 lib/CRMRequest/index.js create mode 100644 pages/api/auth/offstage.js create mode 100644 pages/api/contract/change/calculations.js create mode 100644 pages/api/contract/change/graphic/calculate.js create mode 100644 pages/api/contract/change/graphic/calculation.js create mode 100644 pages/api/contract/change/graphic/current.js create mode 100644 pages/api/contract/change/signatories.js create mode 100644 pages/api/contract/change/variants.js create mode 100644 pages/api/contract/penalties.js create mode 100644 pages/api/events/get.js create mode 100644 pages/api/events/read.js delete mode 100644 pages/appeal/detail.js delete mode 100644 pages/appeal/events.js delete mode 100644 pages/appeal/index.js delete mode 100644 pages/appeal/new.js create mode 100644 pages/components/Events/NotificationMessage/index.js create mode 100644 pages/components/Manager/index.js create mode 100644 pages/contract/__change.js delete mode 100644 pages/contract/change.js create mode 100644 pages/contract/change/components/CalculationsList/index.js create mode 100644 pages/contract/change/components/Comparison/index.js create mode 100644 pages/contract/change/components/Final/index.js create mode 100644 pages/contract/change/components/Options/index.js create mode 100644 pages/contract/change/components/SignatoriesList/index.js create mode 100644 pages/contract/change/components/VariantsList/index.js create mode 100644 pages/contract/change/index.js create mode 100644 pages/contract/components/FinesCalculatorForm/index.js delete mode 100644 pages/contract/fine.js create mode 100644 pages/contract/fines.js create mode 100644 pages/contract/penalties.js create mode 100644 pages/offstage.js rename pages/{components/Appeals => support/components}/InnerMenu/index.js (82%) create mode 100644 pages/support/detail.js create mode 100644 pages/support/index.js create mode 100644 pages/support/messages.js create mode 100644 pages/support/new.js diff --git a/actions/authActions.js b/actions/authActions.js index 0667f8e..410d9f5 100644 --- a/actions/authActions.js +++ b/actions/authActions.js @@ -152,8 +152,9 @@ export const logout = ({ dispatch }) => { const cookies = new Cookies(); cookies.remove('jwt'); + cookies.remove('observer'); - dispatch({ type: actionTypes.AUTH, data: { logged: false } }); + dispatch({ type: actionTypes.AUTH, data: { logged: false, observer: false } }); dispatch({ type: actionTypes.USER, data: {} }); dispatch({ type: actionTypes.COMPANY, data: {} }); @@ -161,3 +162,51 @@ export const logout = ({ dispatch }) => Router.push('/'); }); } + +export const sendOffstageToken = ({ token, dispatch }) => +{ + console.log("ACTION", "sendOffstageToken()", `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/auth/offstage/`); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/auth/offstage/`, { token }) + .then((response) => + { + console.log("sendOffstageToken RESPONSE"); + console.log(response.data); + + if(response.data.status === "success") + { + const cookies = new Cookies(); + cookies.set('jwt', response.data.token, new Date(moment().add(7, 'day').toDate())); + cookies.set('observer', true, new Date(moment().add(7, 'day').toDate())); + + getCompanyInfo({ dispatch }) + .then(() => + { + dispatch({ type: actionTypes.AUTH, data: { logged: true, observer: true } }); + dispatch({ type: actionTypes.USER, data: response.data.user }); + + resolve(); + Router.push('/'); + }) + .catch(() => + { + reject(); + }); + //dispatch({ type: actionTypes.COMPANY, data: response.data.company }); + } + else + { + reject(); + } + }) + .catch((error) => + { + console.log("error"); + console.error(error); + + reject(); + }); + }); +} \ No newline at end of file diff --git a/actions/contractActions.js b/actions/contractActions.js index 1ba0b1c..4c4e87f 100644 --- a/actions/contractActions.js +++ b/actions/contractActions.js @@ -318,4 +318,225 @@ export const getContractMaterials = ({ dispatch, }) => reject(); }); }); +} + +export const getContractPenalties = ({ number, date }) => +{ + console.log("ACTION", "getContractPenalties", { number, date }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/penalties`, { + number, date + }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("getContractPenalties", "response.data", response.data); + resolve(response.data); + }) + .catch((error) => + { + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChange = ({ dispatch, number }) => +{ + return new Promise(async (resolve, reject) => + { + await Promise.all([ + getContractGraphicChangeSignatories({ dispatch, number }), + getContractGraphicChangeVariants({ dispatch, number, variants: { + change_payment_date: false, + insurance_change: false, + last_payment_change: false, + date_offset_change: false, + contract_term_change: false, + sum_pay_change: false, + early_redemption_change: false, + } }), + getContractGraphicChangeCalculationsList({ dispatch, number }), + ]) + .then(() => + { + resolve(); + }); + }); +} + +export const getContractGraphicChangeSignatories = ({ dispatch, number }) => +{ + console.log("ACTION", "getContractGraphicChangeSignatories", { number }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/signatories`, { number }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeSignatories", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { signatories: response.data.signatories } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeSignatories", "error"); + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChangeVariants = ({ dispatch, number, variants = {} }) => +{ + console.log("ACTION", "getContractGraphicChangeVariants", { ...{ number }, ...variants }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/variants`, { ...{ number }, ...variants }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeVariants", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { variants: response.data } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeVariants", "error"); + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChangeCalculationsList = ({ dispatch, number }) => +{ + console.log("ACTION", "getContractGraphicChangeCalculationsList", { number }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/calculations`, { number }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeCalculationsList", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { calculations: response.data.pre_calculations } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeCalculationsList", "error"); + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChangeOptions = ({ dispatch, number }) => +{ + return new Promise((resolve, reject) => + { + resolve(); + }); +} + +export const getContractGraphicChangeCalculate = ({ dispatch, number, calculation }) => +{ + console.log("ACTION", "getContractGraphicChangeCurrent", { number }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/calculations`, { number }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeCurrent", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { calculations: response.data.pre_calculations } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeCurrent", "error"); + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChangeGetCurrent = ({ dispatch, number }) => +{ + console.log("ACTION", "getContractGraphicChangeGetCurrent", { number }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/graphic/current`, { number }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeGetCurrent", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { current: response.data.planpayments } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeGetCurrent", "error"); + console.error(error); + reject(); + }); + }); +} + +export const getContractGraphicChangeGetCalculated = ({ dispatch, calculation }) => +{ + console.log("ACTION", "getContractGraphicChangeGetCalculated", { calculation }); + + return new Promise((resolve, reject) => + { + axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/contract/change/graphic/calculation`, { calculation }, + { + withCredentials: true, + }) + .then(async (response) => + { + console.log("ACTION", "getContractGraphicChangeGetCalculated", "response.data", response.data); + + dispatch({ type: actionTypes.CONTRACT_CHANGE, data: { calculated: response.data.planpayments } }); + resolve(); + }) + .catch((error) => + { + console.error("ACTION", "getContractGraphicChangeGetCalculated", "error"); + console.error(error); + reject(); + }); + }); +} + +export const signContractGraphicChange = ({ dispatch, number }) => +{ + return new Promise((resolve, reject) => + { + resolve(); + }); } \ No newline at end of file diff --git a/actions/eventsActions.js b/actions/eventsActions.js index 6f226c0..aee0508 100644 --- a/actions/eventsActions.js +++ b/actions/eventsActions.js @@ -2,6 +2,7 @@ import axios from 'axios'; import { Cookies } from 'react-cookie'; import Router from 'next/router'; import moment from 'moment'; +import { nSQL } from "@nano-sql/core"; import * as actionTypes from '../constants/actionTypes'; @@ -21,9 +22,10 @@ if(process.browser) }; } -export const getEvents = ({ dispatch }) => +export const getEvents = ({ dispatch, type, contract }) => { - console.log("getEvents"); + console.log("getEvents", `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/events`); + return new Promise((resolve, reject) => { axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/events`, {}, { @@ -32,8 +34,13 @@ export const getEvents = ({ dispatch }) => .then((response) => { console.log("getEvents", "response", response.data); + const events = response.data; + const filtered_events = []; - dispatch({ type: actionTypes.EVENTS, data: { list: response.data } }); + console.log("events"); + console.log(events); + + dispatch({ type: actionTypes.EVENTS, data: { list: events, loaded: true } }); resolve(); }) .catch((error) => @@ -45,3 +52,81 @@ export const getEvents = ({ dispatch }) => }); }); } + +export const getFilteredEvents = ({ dispatch, type, search, contract }) => +{ + return new Promise((resolve, reject) => + { + console.log("getFilteredEvents"); + + const types = { + "restrictions": "restrictions", + "payments": [ "kasko_prolong", "fingap_prolong", "osago_prolong" ], + "additional": "graph_change", + "finance": "end_contract", + "fines": "fine_gibdd", + "pts": "return_pts", + }; + + if(type !== undefined || (search !== undefined || search !== null || search !== "")) + { + console.log(global.store.getState().events); + const events = global.store.getState().events.list; + + let query = nSQL(events) + .query("select"); + + if(type !== undefined) + { + if(typeof types[ type ] === "string") + { + query.where([ [ "event_type", "=", types[ type ] ] ]) + } + else + { + let array_of_queries = []; + for(let i in types[ type ]) + { + array_of_queries.push([ "event_type", "=", types[ type ][ i ] ]); + if(parseInt(i, 10) < parseInt(types[ type ].length - 1)) + { + console.log(parseInt(i, 10), "<", types[ type ].length - 1); + array_of_queries.push("OR"); + } + } + console.log("array_of_queries", array_of_queries); + query.where(array_of_queries); + } + } + + if(contract !== undefined && contract !== null && contract !== "") + { + query.where([ [ "contract_number", "=", contract ] ]); + } + + if(search !== undefined && search !== null && search !== "") + { + query.where([ [ "contract_number", "LIKE", `%${ search }%` ], "OR", [ "add_info", "LIKE", `%${ search }%` ]]); + } + + query.exec().then((rows) => + { + console.log("rows"); + console.log(rows); + dispatch({ type: actionTypes.EVENTS_FILTERED, data: { filtered: rows } }); + resolve(); + + //callback(null, rows); + }); + + /* + .orderBy("number", "asc") + */ + } + else + { + dispatch({ type: actionTypes.EVENTS_FILTERED, data: { filtered: undefined } }); + resolve(); + } + }); +} diff --git a/actions/fileActions.js b/actions/fileActions.js index 5844cc0..12091d8 100644 --- a/actions/fileActions.js +++ b/actions/fileActions.js @@ -22,18 +22,29 @@ if(process.browser) }; } -export const getImage = async ({ id }) => +export const getImage = ({ id }) => { - console.log("getImage"); - const response = await axios.get(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/file/image`, { - params: { id }, - responseType: 'blob', + console.log("getImage\n\n"); + console.log("getImage", `${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/file/image`); + + return new Promise((resolve, reject) => + { + axios.get(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/file/image`, { + params: { id }, + //responseType: 'blob', + }) + .then((response) => + { + resolve(response.data); + }) + .catch((error) => + { + console.error("getImage error"); + console.error(error); + + reject(); + }); }); - - console.log("getImage", "response"); - console.log(response); - - return response; } export const getFile = ({ id, filename }) => diff --git a/constants/actionTypes.js b/constants/actionTypes.js index 0bbe48f..3a2b11e 100644 --- a/constants/actionTypes.js +++ b/constants/actionTypes.js @@ -13,5 +13,14 @@ export const CONTRACT_AGREEMENT = 'CONTRACT_AGREEMENT'; export const CONTRACT_DOCUMENTS = 'CONTRACT_DOCUMENTS'; export const CONTRACT_RULES = 'CONTRACT_RULES'; export const CONTRACT_MATERIALS = 'CONTRACT_MATERIALS'; + +export const CONTRACT_CHANGE = 'CONTRACT_CHANGE'; +export const CONTRACT_SIGNATORIES = 'CONTRACT_SIGNATORIES'; +export const CONTRACT_VARIANTS = 'CONTRACT_VARIANTS'; +export const CONTRACT_OPTIONS = 'CONTRACT_OPTIONS'; +export const CONTRACT_CURRENT = 'CONTRACT_CURRENT'; +export const CONTRACT_CALCULATED = 'CONTRACT_CALCULATED'; + export const CALENDAR = 'CALENDAR'; -export const EVENTS = 'EVENTS'; \ No newline at end of file +export const EVENTS = 'EVENTS'; +export const EVENTS_FILTERED = 'EVENTS_FILTERED'; \ No newline at end of file diff --git a/css/components/style.css b/css/components/style.css index a48cb73..108e26e 100644 --- a/css/components/style.css +++ b/css/components/style.css @@ -1 +1,542 @@ -.bx-breadcrumb{display:flex;flex-wrap:wrap;width:100%;max-width:1310px;margin:25px auto -40px auto;position:relative;z-index:2}.bx-breadcrumb .bx-breadcrumb-item{color:rgba(0,0,0,0.5)}.bx-breadcrumb .bx-breadcrumb-item a{text-decoration:none;color:rgba(0,0,0,0.5)}.bx-breadcrumb .bx-breadcrumb-item a:hover{color:#000}.bx-breadcrumb .bx-breadcrumb-item:before{content:"<";display:inline-block;margin:0 4px}@media all and (max-width:1420px){.bx-breadcrumb{width:calc(100% - 160px);margin:25px 80px -40px 80px}}@media all and (max-width:960px){.bx-breadcrumb{margin:25px 80px -25px 80px}}@media all and (max-width:768px){.bx-breadcrumb{margin:12px 16px -25px 16px;width:calc(100% - 32px)}}hr{display:block;width:100%;height:1px;background:#EDEFF5;border:0;margin:20px 0}button,.button{border:0;background:transparent;appearance:none;box-shadow:none;cursor:pointer;box-sizing:border-box;padding:0px 15px;display:inline-flex;align-items:center;justify-content:center;height:40px;font-weight:600;font-size:15px;line-height:20px}@media all and (max-width:1600px){button,.button{font-size:13px}}.button{color:var(--blue);background:#fff}.button:disabled{opacity:.48;cursor:default}.button.icon:before{content:"";display:block;width:16px;height:16px;margin-right:12px}.button.button-blue{background:var(--blue);color:#fff}.button.button-blue.icon:before{background:url("/assets/images/icons/btn_icon_white.svg") no-repeat center}.button.button-blue.transparent{color:var(--blue);background:transparent}.button.button-blue.transparent.icon:before{background:url("/assets/images/icons/btn_icon_blue.svg") no-repeat center}.button.button-gray{color:var(--gray);background:var(--gray-light)}.button.button-gray.transparent{color:var(--gray);background:transparent}.button.button-gray.icon:before{background:url("/assets/images/icons/btn_icon_gray.svg") no-repeat center}.button.button-compact{width:40px;height:40px;text-indent:-9999px;overflow:hidden}.button.button-compact.icon:before{margin-right:0}@media all and (max-width:768px){.button.download-icon{width:24px;height:24px;background:url("/assets/images/icons/download_icon.svg") no-repeat center;overflow:hidden;text-indent:-999px}.button.download-icon svg{color:var(--blue) !important;background:#fff}}.form_field{position:relative}input[type="checkbox"]{display:none;visibility:hidden;position:relative}input[type="checkbox"]+label{cursor:pointer;padding-left:28px;display:block}input[type="checkbox"]+label:before{content:"";display:block;width:16px;min-width:16px;height:16px;border:1px solid rgba(0,16,61,0.12);box-sizing:border-box;border-radius:4px;margin-right:12px;position:absolute;left:0;top:2px}input[type="checkbox"]:checked+label:before{background:url("/assets/images/icons/checkbox_white.svg") no-repeat center var(--primary);border-color:var(--primary)}input[type="checkbox"]:disabled+label:before{background:url("/assets/images/icons/checkbox_gray.svg") no-repeat center var(--gray-light);cursor:none;border-color:var(--gray-light)}input[type="radio"]{display:none;visibility:hidden}input[type="radio"]+label{display:block;padding-left:28px;cursor:pointer}input[type="radio"]+label:before{content:"";display:block;border:1px solid rgba(0,16,61,0.12);box-sizing:border-box;border-radius:100%;width:16px;min-width:16px;height:16px;position:absolute;left:0;top:2px}input[type="radio"]:checked+label:before{background:#fff;box-shadow:inset 0 0 0 5px #005FF9;border-color:#005FF9;border:0}input[type="radio"]:disabled+label:before{background:var(--gray);cursor:none}.selected_item{display:flex;align-items:center;justify-content:center;background:var(--gray-light);box-sizing:border-box;padding:0 2px}.selected_item img{width:24px;height:24px;object-fit:cover;object-position:center;margin-right:8px}.selected_item .delete{margin-left:8px;width:28px;height:28px;background:url("/assets/images/icons/delete_gray.svg") no-repeat center}.list-column{column-gap:20px;list-style:disc;margin:15px 0 15px 20px}.list-column li{line-height:25px}.list-column[data-column="2"]{column-count:2}@media all and (max-width:768px){.list-column[data-column="2"]{column-count:1}}.list-column[data-column="3"]{column-count:3}@media all and (max-width:768px){.list-column[data-column="3"]{column-count:1}}.form_field{position:relative}.form_field .clear{position:absolute;top:0;right:0;width:40px;height:40px;background:url("/assets/images/icons/delete_black.svg") no-repeat center;z-index:2}.form_field.error input,.form_field.error textarea,.form_field.error select{border-color:#FFADAD;margin-bottom:30px !important}.form_field.error:after{content:attr(data-error);display:block;font-size:11px;line-height:15px;color:#FFADAD;position:absolute;left:0;bottom:12px}@media all and (max-width:1600px){.form_field.error:after{font-size:9px}}.form_field input,.form_field textarea,.form_field select{border:1px solid rgba(0,16,61,0.12);box-sizing:border-box;height:40px;background:#fff;padding:0 12px;width:100%;outline:none;font-size:15px}.form_field input::placeholder,.form_field textarea::placeholder,.form_field select::placeholder{font-size:15px;line-height:24px;color:#919399;font-family:'Montserrat',sans-serif;font-weight:400}.form_field input.error,.form_field textarea.error,.form_field select.error{border-color:var(--red)}.form_field input.filled,.form_field textarea.filled,.form_field select.filled{border-color:rgba(0,16,61,0.48)}.form_field input:disabled,.form_field textarea:disabled,.form_field select:disabled{background:var(--gray-light)}.form_field input[type="search"],.form_field textarea[type="search"],.form_field select[type="search"]{padding-left:32px;background-image:url("/assets/images/icons/icon-search.svg");background-repeat:no-repeat;background-position:8px 50%}.form_field input[type="date"],.form_field textarea[type="date"],.form_field select[type="date"],.form_field input.date_input,.form_field textarea.date_input,.form_field select.date_input{padding-left:32px;background-image:url("/assets/images/icons/icon-date.svg");background-repeat:no-repeat;background-position:8px 50%}.form_field input[type="date"]::-webkit-inner-spin-button,.form_field textarea[type="date"]::-webkit-inner-spin-button,.form_field select[type="date"]::-webkit-inner-spin-button,.form_field input.date_input::-webkit-inner-spin-button,.form_field textarea.date_input::-webkit-inner-spin-button,.form_field select.date_input::-webkit-inner-spin-button,.form_field input[type="date"]::-webkit-calendar-picker-indicator,.form_field textarea[type="date"]::-webkit-calendar-picker-indicator,.form_field select[type="date"]::-webkit-calendar-picker-indicator,.form_field input.date_input::-webkit-calendar-picker-indicator,.form_field textarea.date_input::-webkit-calendar-picker-indicator,.form_field select.date_input::-webkit-calendar-picker-indicator{display:none;-webkit-appearance:none}@media all and (max-width:1600px) and (min-width:1280px){.form_field input,.form_field textarea,.form_field select{font-size:14px}.form_field input::placeholder,.form_field textarea::placeholder,.form_field select::placeholder{font-size:14px}}@media all and (max-width:960px){.form_field input,.form_field textarea,.form_field select{font-size:13px}}.form_field select{background-image:url("/assets/images/icons/icon-select.svg");background-repeat:no-repeat;background-position:calc(100% - 16px) 50%;-webkit-appearance:none;-moz-appearance:none}.form_field select::-ms-expand{display:none}.form_field textarea{padding-top:10px;height:80px}.fieldgroup{display:flex;justify-content:space-between}.socials{display:flex}.socials a{display:block;width:32px;height:32px;text-decoration:none}.socials a:not(:last-child){margin-right:22px}@media all and (max-width:1279px){.socials a:not(:last-child){margin-right:6px}}.tabs{display:flex}.tabs .tab{line-height:40px;margin-right:8px;padding:0 20px;cursor:pointer}.tabs .tab.active{background:var(--blue);color:#fff;font-weight:700;cursor:default}@media all and (max-width:960px){.tabs .tab{font-size:10px;line-height:35px}.tabs .tab.active{font-weight:400}}@media all and (max-width:768px){.tabs .tab{margin-right:0;padding:0 16px}}.pagination{margin-top:40px}@media all and (max-width:1600px) and (min-width:1280px){.pagination{margin-top:20px}}.pagination ul{display:flex;align-items:flex-end;justify-content:flex-end}.pagination ul li{font-size:26px;line-height:35px;color:var(--blue)}@media all and (max-width:1600px) and (min-width:1280px){.pagination ul li{font-size:20px;line-height:30px}}.pagination ul li a{display:block;padding:0 5px}@media all and (max-width:1279px){.pagination ul{justify-content:center}.pagination ul li{font-size:13px;line-height:28px;min-width:30px}.pagination ul li a{text-align:center;font-weight:600}}.image-full{width:100%;margin-bottom:50px;height:450px;background:var(--gray-light)}.image-full img{width:100%;height:100%;object-fit:cover}ul.custom-dots{list-style:none;padding:0}ul.custom-dots li{padding-left:15px;position:relative}ul.custom-dots li:before{content:"";display:block;position:absolute;width:2px;height:2px;background:#000;border-radius:2px;top:9px;left:5px}.date_input_wrapper{position:relative}.date_input_wrapper .rw-widget-picker{border:1px solid rgba(0,16,61,0.12) !important;box-shadow:none !important;box-sizing:border-box;height:40px;background:#fff;border-radius:0;width:100%;outline:none;font-size:15px}.date_input_wrapper .rw-widget-input{padding:0 12px 0 32px;outline:none;box-shadow:none !important;border:0}.date_input_wrapper .rw-input-addon.rw-picker-btn{border:0;width:100%;background-image:url("/assets/images/icons/icon-date.svg");background-repeat:no-repeat;background-position:8px 50%;position:absolute;top:0;left:0;height:40px}.date_input_wrapper .rw-input-addon.rw-picker-btn:hover{background-color:transparent}.date_input_wrapper .rw-input-addon.rw-picker-btn svg{display:none}/*# sourceMappingURL=./style.css.map */ \ No newline at end of file +.bx-breadcrumb { + display: flex; + flex-wrap: wrap; + width: 100%; + max-width: 1310px; + margin: 25px auto -40px auto; + position: relative; + z-index: 2; +} +.bx-breadcrumb .bx-breadcrumb-item { + color: rgba(0, 0, 0, 0.5); +} +.bx-breadcrumb .bx-breadcrumb-item a { + text-decoration: none; + color: rgba(0, 0, 0, 0.5); +} +.bx-breadcrumb .bx-breadcrumb-item a:hover { + color: #000; +} +.bx-breadcrumb .bx-breadcrumb-item:before { + content: "<"; + display: inline-block; + margin: 0 4px; +} +@media all and (max-width: 1420px) { + .bx-breadcrumb { + width: calc(100% - 160px); + margin: 25px 80px -40px 80px; + } +} +@media all and (max-width: 960px) { + .bx-breadcrumb { + margin: 25px 80px -25px 80px; + } +} +@media all and (max-width: 768px) { + .bx-breadcrumb { + margin: 12px 16px -25px 16px; + width: calc(100% - 32px); + } +} +hr { + display: block; + width: 100%; + height: 1px; + background: #EDEFF5; + border: 0; + margin: 20px 0; +} +button, +.button { + border: 0; + background: transparent; + appearance: none; + box-shadow: none; + cursor: pointer; + box-sizing: border-box; + padding: 0px 15px; + display: inline-flex; + align-items: center; + justify-content: center; + height: 40px; + font-weight: 600; + font-size: 15px; + line-height: 20px; +} +@media all and (max-width: 1600px) { + button, + .button { + font-size: 13px; + } +} +.button { + color: var(--blue); + background: #fff; +} +.button:disabled { + opacity: 0.48; + cursor: default; +} +.button.icon:before { + content: ""; + display: block; + width: 16px; + height: 16px; + margin-right: 12px; +} +.button.button-blue { + background: var(--blue); + color: #fff; +} +.button.button-blue.icon:before { + background: url("/assets/images/icons/btn_icon_white.svg") no-repeat center; +} +.button.button-blue.transparent { + color: var(--blue); + background: transparent; +} +.button.button-blue.transparent.icon:before { + background: url("/assets/images/icons/btn_icon_blue.svg") no-repeat center; +} +.button.button-gray { + color: var(--gray); + background: var(--gray-light); +} +.button.button-gray.transparent { + color: var(--gray); + background: transparent; +} +.button.button-gray.icon:before { + background: url("/assets/images/icons/btn_icon_gray.svg") no-repeat center; +} +.button.button-compact { + width: 40px; + height: 40px; + text-indent: -9999px; + overflow: hidden; +} +.button.button-compact.icon:before { + margin-right: 0; +} +@media all and (max-width: 768px) { + .button.download-icon { + width: 24px; + height: 24px; + background: url("/assets/images/icons/download_icon.svg") no-repeat center; + overflow: hidden; + text-indent: -999px; + } + .button.download-icon svg { + color: var(--blue) !important; + background: #fff; + } +} +.form_field { + position: relative; +} +input[type="checkbox"] { + display: none; + visibility: hidden; + position: relative; +} +input[type="checkbox"] + label { + cursor: pointer; + padding-left: 28px; + display: block; +} +input[type="checkbox"] + label:before { + content: ""; + display: block; + width: 16px; + min-width: 16px; + height: 16px; + border: 1px solid rgba(0, 16, 61, 0.12); + box-sizing: border-box; + border-radius: 4px; + margin-right: 12px; + position: absolute; + left: 0; + top: 2px; +} +input[type="checkbox"]:checked + label:before { + background: url("/assets/images/icons/checkbox_white.svg") no-repeat center var(--primary); + border-color: var(--primary); +} +input[type="checkbox"]:disabled + label:before { + cursor: none; + border-color: var(--gray-light); +} +input[type="radio"] { + display: none; + visibility: hidden; +} +input[type="radio"] + label { + display: block; + padding-left: 28px; + cursor: pointer; +} +input[type="radio"] + label:before { + content: ""; + display: block; + border: 1px solid rgba(0, 16, 61, 0.12); + box-sizing: border-box; + border-radius: 100%; + width: 16px; + min-width: 16px; + height: 16px; + position: absolute; + left: 0; + top: 2px; +} +input[type="radio"]:checked + label:before { + background: #fff; + box-shadow: inset 0px 0 0px 5px #005FF9; + border-color: #005FF9; + border: 0; +} +input[type="radio"]:disabled + label:before { + background: var(--gray); + cursor: none; +} +.selected_item { + display: flex; + align-items: center; + justify-content: center; + background: var(--gray-light); + box-sizing: border-box; + padding: 0 2px; +} +.selected_item img { + width: 24px; + height: 24px; + object-fit: cover; + object-position: center; + margin-right: 8px; +} +.selected_item .delete { + margin-left: 8px; + width: 28px; + height: 28px; + background: url("/assets/images/icons/delete_gray.svg") no-repeat center; +} +.list-column { + column-gap: 20px; + list-style: disc; + margin: 15px 0 15px 20px; +} +.list-column li { + line-height: 25px; +} +.list-column[data-column="2"] { + column-count: 2; +} +@media all and (max-width: 768px) { + .list-column[data-column="2"] { + column-count: 1; + } +} +.list-column[data-column="3"] { + column-count: 3; +} +@media all and (max-width: 768px) { + .list-column[data-column="3"] { + column-count: 1; + } +} +.form_field { + position: relative; +} +.form_field .clear { + position: absolute; + top: 0; + right: 0; + width: 40px; + height: 40px; + background: url("/assets/images/icons/delete_black.svg") no-repeat center; + z-index: 2; +} +.form_field.error input, +.form_field.error textarea, +.form_field.error select { + border-color: #FFADAD; + margin-bottom: 30px !important; +} +.form_field.error:after { + content: attr(data-error); + display: block; + font-size: 11px; + line-height: 15px; + color: #FFADAD; + position: absolute; + left: 0; + bottom: 12px; +} +@media all and (max-width: 1600px) { + .form_field.error:after { + font-size: 9px; + } +} +.form_field input, +.form_field textarea, +.form_field select { + border: 1px solid rgba(0, 16, 61, 0.12); + box-sizing: border-box; + height: 40px; + background: #fff; + padding: 0 12px; + width: 100%; + outline: none; + font-size: 15px; +} +.form_field input::placeholder, +.form_field textarea::placeholder, +.form_field select::placeholder { + font-size: 15px; + line-height: 24px; + color: #919399; + font-family: 'Montserrat', sans-serif; + font-weight: 400; +} +.form_field input.error, +.form_field textarea.error, +.form_field select.error { + border-color: var(--red); +} +.form_field input.filled, +.form_field textarea.filled, +.form_field select.filled { + border-color: rgba(0, 16, 61, 0.48); +} +.form_field input:disabled, +.form_field textarea:disabled, +.form_field select:disabled { + background: var(--gray-light); +} +.form_field input[type="search"], +.form_field textarea[type="search"], +.form_field select[type="search"] { + padding-left: 32px; + background-image: url("/assets/images/icons/icon-search.svg"); + background-repeat: no-repeat; + background-position: 8px 50%; +} +.form_field input[type="date"], +.form_field textarea[type="date"], +.form_field select[type="date"], +.form_field input.date_input, +.form_field textarea.date_input, +.form_field select.date_input { + padding-left: 32px; + background-image: url("/assets/images/icons/icon-date.svg"); + background-repeat: no-repeat; + background-position: 8px 50%; +} +.form_field input[type="date"]::-webkit-inner-spin-button, +.form_field textarea[type="date"]::-webkit-inner-spin-button, +.form_field select[type="date"]::-webkit-inner-spin-button, +.form_field input.date_input::-webkit-inner-spin-button, +.form_field textarea.date_input::-webkit-inner-spin-button, +.form_field select.date_input::-webkit-inner-spin-button, +.form_field input[type="date"]::-webkit-calendar-picker-indicator, +.form_field textarea[type="date"]::-webkit-calendar-picker-indicator, +.form_field select[type="date"]::-webkit-calendar-picker-indicator, +.form_field input.date_input::-webkit-calendar-picker-indicator, +.form_field textarea.date_input::-webkit-calendar-picker-indicator, +.form_field select.date_input::-webkit-calendar-picker-indicator { + display: none; + -webkit-appearance: none; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .form_field input, + .form_field textarea, + .form_field select { + font-size: 14px; + } + .form_field input::placeholder, + .form_field textarea::placeholder, + .form_field select::placeholder { + font-size: 14px; + } +} +@media all and (max-width: 960px) { + .form_field input, + .form_field textarea, + .form_field select { + font-size: 13px; + } +} +.form_field select { + background-image: url("/assets/images/icons/icon-select.svg"); + background-repeat: no-repeat; + background-position: calc(100% - 16px) 50%; + -webkit-appearance: none; + -moz-appearance: none; +} +.form_field select::-ms-expand { + display: none; +} +.form_field textarea { + padding-top: 10px; + height: 80px; +} +.fieldgroup { + display: flex; + justify-content: space-between; +} +.socials { + display: flex; +} +.socials a { + display: block; + width: 32px; + height: 32px; + text-decoration: none; +} +.socials a:not(:last-child) { + margin-right: 22px; +} +@media all and (max-width: 1279px) { + .socials a:not(:last-child) { + margin-right: 6px; + } +} +.tabs { + display: flex; +} +.tabs .tab { + line-height: 40px; + margin-right: 8px; + padding: 0 20px; + cursor: pointer; +} +.tabs .tab.active { + background: var(--blue); + color: #fff; + font-weight: 700; + cursor: default; +} +@media all and (max-width: 960px) { + .tabs .tab { + font-size: 10px; + line-height: 35px; + } + .tabs .tab.active { + font-weight: 400; + } +} +@media all and (max-width: 768px) { + .tabs .tab { + margin-right: 0; + padding: 0 16px; + } +} +.pagination { + margin-top: 40px; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .pagination { + margin-top: 20px; + } +} +.pagination ul { + display: flex; + align-items: flex-end; + justify-content: flex-end; +} +.pagination ul li { + font-size: 26px; + line-height: 35px; + color: var(--blue); +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .pagination ul li { + font-size: 20px; + line-height: 30px; + } +} +.pagination ul li a { + display: block; + padding: 0 5px; +} +@media all and (max-width: 1279px) { + .pagination ul { + justify-content: center; + } + .pagination ul li { + font-size: 13px; + line-height: 28px; + min-width: 30px; + } + .pagination ul li a { + text-align: center; + font-weight: 600; + } +} +.image-full { + width: 100%; + margin-bottom: 50px; + height: 450px; + background: var(--gray-light); +} +.image-full img { + width: 100%; + height: 100%; + object-fit: cover; +} +ul.custom-dots { + list-style: none; + padding: 0; +} +ul.custom-dots li { + padding-left: 15px; + position: relative; +} +ul.custom-dots li:before { + content: ""; + display: block; + position: absolute; + width: 2px; + height: 2px; + background: #000; + border-radius: 2px; + top: 9px; + left: 5px; +} +.date_input_wrapper { + position: relative; +} +.date_input_wrapper .rw-widget-picker { + border: 1px solid rgba(0, 16, 61, 0.12) !important; + box-shadow: none !important; + box-sizing: border-box; + height: 40px; + background: #fff; + border-radius: 0; + width: 100%; + outline: none; + font-size: 15px; +} +.date_input_wrapper .rw-widget-input { + padding: 0 12px 0 32px; + outline: none; + box-shadow: none !important; + border: 0; +} +.date_input_wrapper .rw-input-addon.rw-picker-btn { + border: 0; + width: 100%; + background-image: url("/assets/images/icons/icon-date.svg"); + background-repeat: no-repeat; + background-position: 8px 50%; + position: absolute; + top: 0; + left: 0; + height: 40px; +} +.date_input_wrapper .rw-input-addon.rw-picker-btn:hover { + background-color: transparent; +} +.date_input_wrapper .rw-input-addon.rw-picker-btn svg { + display: none; +} diff --git a/css/components/style.less b/css/components/style.less index 8607f04..d2106c7 100644 --- a/css/components/style.less +++ b/css/components/style.less @@ -198,7 +198,7 @@ input[type="checkbox"] { } &:disabled + label { &:before { - background: url("/assets/images/icons/checkbox_gray.svg") no-repeat center var(--gray-light); + //background: url("/assets/images/icons/checkbox_gray.svg") no-repeat center var(--gray-light); cursor: none; border-color: var(--gray-light); } diff --git a/css/var.css b/css/var.css index 2ef763d..72ec6fc 100644 --- a/css/var.css +++ b/css/var.css @@ -1 +1,533 @@ -:root{--blue:#1C01A9;--blue-secondary:#85B2FC;--gray:#2C2D2E;--gray-light:rgba(0,16,61,0.06);--primary:#005FF9;--primary-light:rgba(0,95,249,0.1);--red:#ED0A34;--inactive:#EDEFF5;--green:#04A8A4;--text_not_active:#8E94A7}body{font-size:15px;line-height:20px;color:#0C0C0C;font-family:'Montserrat',sans-serif;font-weight:400}@media all and (max-width:1600px) and (min-width:1280px){body{font-size:13px;line-height:20px}}@media all and (max-width:960px){body{font-size:13px;line-height:20px}}.overflow{overflow:hidden}.container{padding-top:80px;padding-bottom:0;width:100%;max-width:1310px;margin:auto;position:relative}.container:after{content:"";display:block;position:absolute;top:0;left:0;right:-4px;bottom:0;z-index:-1}@media all and (max-width:1600px) and (min-width:1280px){.container{padding-top:40px;padding-bottom:0}}@media all and (max-width:1279px){.container{padding-top:30px}}@media all and (max-width:960px){.container{padding-top:30px;padding-bottom:0}}@media all and (max-width:1420px){.container{width:calc(100% - 160px);margin:0 80px}}@media all and (max-width:768px){.container{margin:0 16px;width:calc(100% - 32px)}}.aside_container{display:flex;justify-content:space-between;position:relative}@media all and (min-width:1280px){.aside_container:before{content:"";display:block;position:absolute;width:1px;top:-135px;left:0;bottom:0;z-index:-1;background:var(--inactive)}}.aside_container aside{width:415px}@media all and (max-width:960px){.aside_container aside{width:100%}}.aside_container article{width:calc(100% - 550px)}.aside_container article:only-child{width:100%}.aside_container article .info_column{padding:20px 40px;display:flex;flex-wrap:wrap;justify-content:space-between;border-bottom:1px solid #EDEFF5}.aside_container article .info_column div{width:calc(50% - 55px)}@media all and (max-width:960px){.aside_container article .info_column{padding:0}.aside_container article .info_column div{width:100%}}@media all and (max-width:960px){.aside_container article{width:100%}.aside_container article .info_column{padding:25px 0}}.aside_container.about aside{width:255px;border-right:1px solid var(--inactive);padding-bottom:80px}@media all and (max-width:1600px) and (min-width:1280px){.aside_container.about aside{width:255px;padding-bottom:40px}}@media all and (max-width:1279px){.aside_container.about aside{border-right:0;padding-bottom:20px}}.aside_container.about article{width:calc(100% - 285px);padding-bottom:80px}.aside_container.about article.full{width:100%}@media all and (max-width:1600px) and (min-width:1280px){.aside_container.about article{width:calc(100% - 295px);padding-bottom:40px}}@media all and (max-width:960px){.aside_container.about article{padding-bottom:30px}}@media all and (max-width:1279px){.aside_container.about{display:block}.aside_container.about aside,.aside_container.about article{width:100%}}.section_title{font-size:50px;line-height:60px;font-weight:700;color:#0C0C0C;margin-bottom:35px}.section_title.no-margin{margin-bottom:0}@media all and (max-width:1600px) and (min-width:1280px){.section_title{font-size:36px;line-height:48px}}@media all and (max-width:1279px){.section_title{font-size:32px;line-height:44px}}@media all and (max-width:960px){.section_title{font-size:22px;line-height:33px}}@media all and (max-width:768px){.section_title{margin-bottom:25px}}h1{font-size:32px;line-height:40px}h2{font-size:24px;line-height:28px;margin-top:1.5em;margin-bottom:10px}@media all and (max-width:1600px) and (min-width:1280px){h2{font-size:22px;line-height:26px}}h2.model{font-size:26px;line-height:35px;color:var(--text_not_active);margin-top:0;margin-bottom:0}@media all and (max-width:768px){h2.model{font-size:19px;line-height:26px}}h2:first-child{margin-top:0}h3{font-size:17px;line-height:24px;margin-top:1.5em;margin-bottom:10px}h3:first-child{margin-top:0}h4{font-size:15px;line-height:20px;margin-top:1.5em;margin-bottom:10px}h4:first-child{margin-top:0}.secondary{font-size:13px;line-height:20px}.secondary.not_active{color:#8E94A7}@media all and (max-width:960px){.secondary{font-size:10px;line-height:15px}}b,strong{font-weight:700}p.primary{color:var(--blue)}a{text-decoration:none;color:var(--blue)}div{box-sizing:border-box}.clear{display:block;clear:both}@media all and (max-width:736px){h1{font-size:24px;line-height:32px}h2{font-size:20px;line-height:24px}}.i-phone{padding-left:28px;background:url("/assets/images/icons/icon-phone-hot.svg") no-repeat 0 2px}.i-phone-secondary{padding-left:28px;background:url("/assets/images/icons/icon-phone-secondary.svg") no-repeat 0 2px}.i-address{padding-left:28px;background:url("/assets/images/icons/icon-address.svg") no-repeat 0 2px}.i-worktime{padding-left:28px;background:url("/assets/images/icons/icon-worktime.svg") no-repeat 0 2px}.i-pdf{padding-left:80px;background:url("/assets/images/icons/icon-pdf.svg") no-repeat left center}.i-pdf[data-format]{background:url("/assets/images/icons/icon-file.svg") no-repeat left center;position:relative}.i-pdf[data-format]:before{content:attr(data-format);color:#fff;font-weight:700;position:absolute;left:3px;right:1px;bottom:1px;top:0;font-size:8px;width:27px;display:flex;align-content:center;justify-content:center;align-items:center;text-transform:uppercase}@media all and (max-width:1600px) and (min-width:1280px){.i-pdf[data-format]{padding-left:56px;background-size:42px}.i-pdf[data-format]:before{width:27px;font-size:8px}}@media all and (max-width:960px){.i-pdf[data-format]{padding-left:55px;background-size:32px;background-position:0 5px}.i-pdf[data-format]:before{font-size:8px;width:31px;height:42px;left:0;right:0}}@media all and (max-width:1600px) and (min-width:1280px){.i-pdf{padding-left:56px;background-size:42px}}@media all and (max-width:960px){.i-pdf{padding-left:55px;background-size:32px;background-position:0 5px}}.extension[data-format]{background:url("/assets/images/icons/icon-file.svg") no-repeat left center;position:relative}.extension[data-format]:before{content:attr(data-format);color:#fff;font-weight:700;position:absolute;left:14px;right:1px;bottom:1px;top:0;font-size:14px;width:27px;display:flex;align-content:center;justify-content:center;align-items:center;text-transform:uppercase}@media all and (max-width:1600px) and (min-width:1280px){.extension[data-format]{padding-left:56px;background-size:42px}.extension[data-format]:before{width:27px;font-size:8px;left:8px}}@media all and (max-width:960px){.extension[data-format]{padding-left:55px;background-size:32px;background-position:0 5px}.extension[data-format]:before{font-size:8px;width:31px;height:42px;left:0;right:0}}.i-doc{padding-left:80px;background:url("/assets/images/icons/icon-doc.svg") no-repeat left center;background-size:56px}@media all and (max-width:1600px) and (min-width:1280px){.i-doc{padding-left:56px;background-size:42px}}@media all and (max-width:960px){.i-doc{padding-left:55px;background-size:32px;background-position:0 5px}}.success{color:var(--green)}.danger{color:var(--red)}@media all and (max-width:768px){::-webkit-scrollbar{display:none}}.avans{display:flex;justify-content:flex-start;margin-bottom:80px}.avans p{font-weight:700;font-size:15px;line-height:23px;color:#000;padding-bottom:0px}@media all and (max-width:1280px){.avans p{font-size:14px;padding-bottom:10px}}@media all and (max-width:1279px){.avans{margin-bottom:30px}.avans p{font-size:13px;line-height:20px}}.rw-calendar-btn-view{font-weight:bold;font-size:12px !important}@media all and (max-width:768px){.rw-calendar-btn-view{font-size:12px !important;line-height:20px}}@media (max-width:1600px) and (min-width:1280px){.rw-calendar-btn-view{font-size:12px !important;line-height:20px}}/*# sourceMappingURL=./var.css.map */ \ No newline at end of file +:root { + --blue: #1C01A9; + --blue-secondary: #85B2FC; + --gray: #2C2D2E; + --gray-light: rgba(0, 16, 61, 0.06); + --primary: #005FF9; + --primary-light: rgba(0, 95, 249, 0.1); + --red: #ED0A34; + --inactive: #EDEFF5; + --green: #04A8A4; + --text_not_active: #8E94A7; +} +html { + /* + @media all and (max-width: 1420px) and (min-width: 1280px) { + zoom: 0.7; + + .container, .bx-breadcrumb { + margin-left: auto; + margin-right: auto; + } + } + */ +} +body { + font-size: 15px; + line-height: 20px; + color: #0C0C0C; + font-family: 'Montserrat', sans-serif; + font-weight: 400; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + body { + font-size: 13px; + line-height: 20px; + } +} +@media all and (max-width: 960px) { + body { + font-size: 13px; + line-height: 20px; + } +} +.overflow { + overflow: hidden; +} +.container { + padding-top: 80px; + padding-bottom: 0; + width: 100%; + max-width: 1310px; + margin: auto; + position: relative; +} +.container:after { + content: ""; + display: block; + position: absolute; + top: 0; + left: 0; + right: -4px; + bottom: 0; + z-index: -1; + /* + background: repeating-linear-gradient( + 90deg, + #fff, + #EDEFF5 1px, + transparent 0px, + transparent 25%); + background: repeating-linear-gradient(to right, transparent 1px, transparent calc(25% - 1px), #EDEFF5 25%, #EDEFF5 25%); + */ +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .container { + padding-top: 40px; + padding-bottom: 0; + } +} +@media all and (max-width: 1279px) { + .container { + padding-top: 30px; + } +} +@media all and (max-width: 960px) { + .container { + padding-top: 30px; + padding-bottom: 0; + } +} +@media all and (max-width: 1420px) { + .container { + width: calc(100% - 160px); + margin: 0 80px; + } +} +@media all and (max-width: 768px) { + .container { + margin: 0 16px; + width: calc(100% - 32px); + } +} +.aside_container { + display: flex; + justify-content: space-between; + position: relative; +} +@media all and (min-width: 1280px) { + .aside_container:before { + content: ""; + display: block; + position: absolute; + width: 1px; + top: -135px; + left: 0; + bottom: 0; + z-index: -1; + background: var(--inactive); + } +} +.aside_container aside { + width: 415px; +} +@media all and (max-width: 960px) { + .aside_container aside { + width: 100%; + } +} +.aside_container article { + width: calc(100% - 550px); +} +.aside_container article:only-child { + width: 100%; +} +.aside_container article .info_column { + padding: 20px 40px; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + border-bottom: 1px solid #EDEFF5; +} +.aside_container article .info_column div { + width: calc(50% - 55px); +} +@media all and (max-width: 960px) { + .aside_container article .info_column { + padding: 0; + } + .aside_container article .info_column div { + width: 100%; + } +} +@media all and (max-width: 960px) { + .aside_container article { + width: 100%; + } + .aside_container article .info_column { + padding: 25px 0; + } +} +.aside_container.about aside { + width: 255px; + border-right: 1px solid var(--inactive); + padding-bottom: 80px; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .aside_container.about aside { + width: 255px; + padding-bottom: 40px; + } +} +@media all and (max-width: 1279px) { + .aside_container.about aside { + border-right: 0; + padding-bottom: 20px; + } +} +.aside_container.about article { + width: calc(100% - 285px); + padding-bottom: 80px; +} +.aside_container.about article.full { + width: 100%; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .aside_container.about article { + width: calc(100% - 295px); + padding-bottom: 40px; + } +} +@media all and (max-width: 960px) { + .aside_container.about article { + padding-bottom: 30px; + } +} +@media all and (max-width: 1279px) { + .aside_container.about { + display: block; + } + .aside_container.about aside, + .aside_container.about article { + width: 100%; + } +} +.section_title { + font-size: 50px; + line-height: 60px; + font-weight: 700; + color: #0C0C0C; + margin-bottom: 35px; +} +.section_title.no-margin { + margin-bottom: 0; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .section_title { + font-size: 36px; + line-height: 48px; + } +} +@media all and (max-width: 1279px) { + .section_title { + font-size: 32px; + line-height: 44px; + } +} +@media all and (max-width: 960px) { + .section_title { + font-size: 22px; + line-height: 33px; + } +} +@media all and (max-width: 768px) { + .section_title { + margin-bottom: 25px; + } +} +h1 { + font-size: 32px; + line-height: 40px; +} +h2 { + font-size: 24px; + line-height: 28px; + margin-top: 1.5em; + margin-bottom: 10px; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + h2 { + font-size: 22px; + line-height: 26px; + } +} +h2.model { + font-size: 26px; + line-height: 35px; + color: var(--text_not_active); + margin-top: 0; + margin-bottom: 0; +} +@media all and (max-width: 768px) { + h2.model { + font-size: 19px; + line-height: 26px; + } +} +h2:first-child { + margin-top: 0; +} +h3 { + font-size: 17px; + line-height: 24px; + margin-top: 1.5em; + margin-bottom: 10px; +} +h3:first-child { + margin-top: 0; +} +h4 { + font-size: 15px; + line-height: 20px; + margin-top: 1.5em; + margin-bottom: 10px; +} +h4:first-child { + margin-top: 0; +} +.secondary { + font-size: 13px; + line-height: 20px; +} +.secondary.not_active { + color: #8E94A7; +} +@media all and (max-width: 960px) { + .secondary { + font-size: 10px; + line-height: 15px; + } +} +b, +strong { + font-weight: 700; +} +p.primary { + color: var(--blue); +} +a { + text-decoration: none; + color: var(--blue); +} +div { + box-sizing: border-box; +} +.clear { + display: block; + clear: both; +} +@media all and (max-width: 736px) { + h1 { + font-size: 24px; + line-height: 32px; + } + h2 { + font-size: 20px; + line-height: 24px; + } +} +.i-phone { + padding-left: 28px; + background: url("/assets/images/icons/icon-phone-hot.svg") no-repeat 0 2px; +} +.i-phone-secondary { + padding-left: 28px; + background: url("/assets/images/icons/icon-phone-secondary.svg") no-repeat 0 2px; +} +.i-address { + padding-left: 28px; + background: url("/assets/images/icons/icon-address.svg") no-repeat 0 2px; +} +.i-worktime { + padding-left: 28px; + background: url("/assets/images/icons/icon-worktime.svg") no-repeat 0 2px; +} +.i-pdf { + padding-left: 80px; + background: url("/assets/images/icons/icon-pdf.svg") no-repeat left center; +} +.i-pdf[data-format] { + background: url("/assets/images/icons/icon-file.svg") no-repeat left center; + position: relative; +} +.i-pdf[data-format]:before { + content: attr(data-format); + color: #fff; + font-weight: 700; + position: absolute; + left: 3px; + right: 1px; + bottom: 1px; + top: 0; + font-size: 8px; + width: 27px; + display: flex; + align-content: center; + justify-content: center; + align-items: center; + text-transform: uppercase; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .i-pdf[data-format] { + padding-left: 56px; + background-size: 42px; + } + .i-pdf[data-format]:before { + width: 27px; + font-size: 8px; + } +} +@media all and (max-width: 960px) { + .i-pdf[data-format] { + padding-left: 55px; + background-size: 32px; + background-position: 0 5px; + } + .i-pdf[data-format]:before { + font-size: 8px; + width: 31px; + height: 42px; + left: 0; + right: 0; + } +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .i-pdf { + padding-left: 56px; + background-size: 42px; + } +} +@media all and (max-width: 960px) { + .i-pdf { + padding-left: 55px; + background-size: 32px; + background-position: 0 5px; + } +} +.extension[data-format] { + background: url("/assets/images/icons/icon-file.svg") no-repeat left center; + position: relative; +} +.extension[data-format]:before { + content: attr(data-format); + color: #fff; + font-weight: 700; + position: absolute; + left: 14px; + right: 1px; + bottom: 1px; + top: 0; + font-size: 14px; + width: 27px; + display: flex; + align-content: center; + justify-content: center; + align-items: center; + text-transform: uppercase; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .extension[data-format] { + padding-left: 56px; + background-size: 42px; + } + .extension[data-format]:before { + width: 27px; + font-size: 8px; + left: 8px; + } +} +@media all and (max-width: 960px) { + .extension[data-format] { + padding-left: 55px; + background-size: 32px; + background-position: 0 5px; + } + .extension[data-format]:before { + font-size: 8px; + width: 31px; + height: 42px; + left: 0; + right: 0; + } +} +.i-doc { + padding-left: 80px; + background: url("/assets/images/icons/icon-doc.svg") no-repeat left center; + background-size: 56px; +} +@media all and (max-width: 1600px) and (min-width: 1280px) { + .i-doc { + padding-left: 56px; + background-size: 42px; + } +} +@media all and (max-width: 960px) { + .i-doc { + padding-left: 55px; + background-size: 32px; + background-position: 0 5px; + } +} +.success { + color: var(--green); +} +.danger { + color: var(--red); +} +@media all and (max-width: 768px) { + ::-webkit-scrollbar { + display: none; + } +} +.avans { + display: flex; + justify-content: flex-start; + margin-bottom: 80px; +} +.avans p { + font-weight: 700; + font-size: 15px; + line-height: 23px; + color: #000; + padding-bottom: 0px; +} +@media all and (max-width: 1280px) { + .avans p { + font-size: 14px; + padding-bottom: 10px; + } +} +@media all and (max-width: 1279px) { + .avans { + margin-bottom: 30px; + } + .avans p { + font-size: 13px; + line-height: 20px; + } +} +.rw-calendar-btn-view { + font-weight: bold; + font-size: 12px !important; +} +@media all and (max-width: 768px) { + .rw-calendar-btn-view { + font-size: 12px !important; + line-height: 20px; + } +} +@media (max-width: 1600px) and (min-width: 1280px) { + .rw-calendar-btn-view { + font-size: 12px !important; + line-height: 20px; + } +} +.interactive { + cursor: pointer; +} +.unselectable { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} diff --git a/css/var.less b/css/var.less index 15740ce..e307e0c 100644 --- a/css/var.less +++ b/css/var.less @@ -552,3 +552,14 @@ div { line-height: 20px; } } + +.interactive { + cursor: pointer; +} + +.unselectable { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} \ No newline at end of file diff --git a/lib/CRMRequest/index.js b/lib/CRMRequest/index.js new file mode 100644 index 0000000..080568a --- /dev/null +++ b/lib/CRMRequest/index.js @@ -0,0 +1,68 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import axios from 'axios'; +import { Cookies } from 'react-cookie'; +import cookie from 'cookie'; +import moment from 'moment'; +import jwt from 'jsonwebtoken'; +import { cors } from '../cors'; + +export default async function CRMRequest(req, res, path, params) +{ + await cors(req, res); + + if(req.headers.cookie !== undefined) + { + const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : ""); + + console.log("-".repeat(50)); + console.log("CRMRequest", "req.body"); + console.log(req.body); + + if(cookies.jwt !== undefined && cookies.jwt !== null) + { + console.log("cookies.jwt"); + console.log(cookies.jwt); + + var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT); + var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true }); + + console.log("client_jwt_decoded", client_jwt_decoded); + console.log("crm_jwt", crm_jwt); + + console.log("path", path); + console.log("params", { ...client_jwt_decoded, ...params }); + + try + { + await axios.get(path, { + params: { ...client_jwt_decoded, ...params }, + headers: { + "Authorization": `Bearer ${ crm_jwt }`, + }, + withCredentials: true, + }) + .then((crm_response) => + { + console.log("crm_response for", path); + console.log(crm_response.data); + + res.status(200).json(crm_response.data); + }) + .catch((error) => + { + console.error(error); + res.status(500); + }); + } + catch(e) + { + console.error(e); + res.status(500); + } + } + else + { + res.status(403); + } + } +} \ No newline at end of file diff --git a/next.config.js b/next.config.js index ca58360..49aeaf0 100644 --- a/next.config.js +++ b/next.config.js @@ -6,7 +6,7 @@ module.exports = withImages(withFonts(withLess({ images: { domains: [ 'lk-evo.quickcode.ru', 'wow.evoleasing.ru', 'www.evoleasing.ru', 'lk.evoleasing.ru', 'evoleasing.ru', 'localhost', 'localhost:3000'], }, - reactStrictMode: true, + reactStrictMode: false, /* async headers() { @@ -30,6 +30,11 @@ module.exports = withImages(withFonts(withLess({ async redirects() { return [ + { + source: '/support', + destination: '/support/faq/', + permanent: false, + }, //{ //source: '/special', //destination: '/special/with_producer', @@ -57,10 +62,30 @@ module.exports = withImages(withFonts(withLess({ source: "/contract/:number/documents", destination: "/contract/documents", }, + { + source: "/contract/:number/penalties", + destination: "/contract/penalties", + }, { source: "/contract/:number/materials", destination: "/contract/materials", - } + }, + { + source: "/contract/:number/events", + destination: "/contract/events", + }, + { + source: "/contract/:number/fines", + destination: "/contract/fines", + }, + { + source: "/contract/:number/change", + destination: "/contract/change", + }, + { + source: "/support/faq", + destination: "/support", + }, //{ //source: "/about/reviews/:page(\\d{1,})", //destination: "/about/reviews", diff --git a/pages/api/auth/offstage.js b/pages/api/auth/offstage.js new file mode 100644 index 0000000..087e2d7 --- /dev/null +++ b/pages/api/auth/offstage.js @@ -0,0 +1,44 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import axios from 'axios'; +import { Cookies } from 'react-cookie'; +import cookie from 'cookie'; +import moment from 'moment'; +import jwt from 'jsonwebtoken'; + +import { cors } from '../../../lib/cors'; + +export default async function handler(req, res) +{ + await cors(req, res); + let { token } = req.body; + + if(token !== undefined && token !== null) + { + console.log("API", "offstage", `${ process.env.NEXT_PUBLIC_API_HOST }/api/user/check/`); + + await axios.post(`${ process.env.NEXT_PUBLIC_API_HOST }/api/user/check/`, { + token, + }) + .then((api_response) => + { + console.log("RESPONSE"); + console.log(api_response.data); + + res.status(200).send(api_response.data); + + //resolve(api_response.data); + }) + .catch((error) => + { + console.log("error"); + console.error(error); + + res.status(403).json(); + //reject(); + }); + } + else + { + res.status(404).json(); + } +} \ No newline at end of file diff --git a/pages/api/contract/change/calculations.js b/pages/api/contract/change/calculations.js new file mode 100644 index 0000000..1ba280d --- /dev/null +++ b/pages/api/contract/change/calculations.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetPreCalculations`, { contract_number: req.body.number }); +} \ No newline at end of file diff --git a/pages/api/contract/change/graphic/calculate.js b/pages/api/contract/change/graphic/calculate.js new file mode 100644 index 0000000..48719ee --- /dev/null +++ b/pages/api/contract/change/graphic/calculate.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/CreateCalculation`, { contract_number: req.body.number }); +} \ No newline at end of file diff --git a/pages/api/contract/change/graphic/calculation.js b/pages/api/contract/change/graphic/calculation.js new file mode 100644 index 0000000..9007bfb --- /dev/null +++ b/pages/api/contract/change/graphic/calculation.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetPreCalculationGraph`, { addcontract_number: req.body.calculation }); +} \ No newline at end of file diff --git a/pages/api/contract/change/graphic/current.js b/pages/api/contract/change/graphic/current.js new file mode 100644 index 0000000..d338d87 --- /dev/null +++ b/pages/api/contract/change/graphic/current.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetCurrentGraph`, { contract_number: req.body.number }); +} \ No newline at end of file diff --git a/pages/api/contract/change/signatories.js b/pages/api/contract/change/signatories.js new file mode 100644 index 0000000..22f6727 --- /dev/null +++ b/pages/api/contract/change/signatories.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetSignatories`, {}); +} \ No newline at end of file diff --git a/pages/api/contract/change/variants.js b/pages/api/contract/change/variants.js new file mode 100644 index 0000000..3bb057e --- /dev/null +++ b/pages/api/contract/change/variants.js @@ -0,0 +1,7 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import CRMRequest from '../../../../lib/CRMRequest'; + +export default async function handler(req, res) +{ + await CRMRequest(req, res, `${ process.env.CRM_API_HOST }/lk/add-contract/GetAvaliableGraphChangeTypes`, { ...{ contract_number: req.body.number }, ...req.body.variants }); +} \ No newline at end of file diff --git a/pages/api/contract/penalties.js b/pages/api/contract/penalties.js new file mode 100644 index 0000000..ab9cf05 --- /dev/null +++ b/pages/api/contract/penalties.js @@ -0,0 +1,51 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import axios from 'axios'; +import { Cookies } from 'react-cookie'; +import cookie from 'cookie'; +import moment from 'moment'; +import jwt from 'jsonwebtoken'; +import { cors } from '../../../lib/cors'; + +export default async function handler(req, res) +{ + console.log("API", "penalties"); + await cors(req, res); + + if(req.headers.cookie !== undefined) + { + const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : ""); + if(cookies.jwt !== undefined && cookies.jwt !== null) + { + var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT); + var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true }); + + const response = await new Promise((resolve) => + { + console.log("API", "penalties", `${ process.env.CRM_API_HOST }/lk/Contract/GetPlannedFines`, { contract_number: req.body.number, planned_date: req.body.date }); + + axios.get(`${ process.env.CRM_API_HOST }/lk/Contract/GetPlannedFines`, { + params: { ...client_jwt_decoded, contract_number: req.body.number, planned_date: req.body.date }, + headers: { "Authorization": `Bearer ${ crm_jwt }`, }, + withCredentials: true, + }) + .then((crm_response) => + { + console.log("API", "penalties", "crm_response.data", crm_response.data); + + resolve(crm_response.data); + }) + .catch((error) => + { + console.error(error); + resolve(error); + }); + }); + + res.status(200).json(response); + } + else + { + res.status(403); + } + } +} \ No newline at end of file diff --git a/pages/api/contracts.js b/pages/api/contracts.js index a7e6e24..6c28f2f 100644 --- a/pages/api/contracts.js +++ b/pages/api/contracts.js @@ -36,7 +36,7 @@ export default async function handler(req, res) try { - axios.get(`${ process.env.CRM_API_HOST }/lk/Account/GetContracts/`, { + await axios.get(`${ process.env.CRM_API_HOST }/lk/Account/GetContracts/`, { params: client_jwt_decoded, headers: { "Authorization": `Bearer ${ crm_jwt }`, diff --git a/pages/api/events.js b/pages/api/events.js index 59ceae8..516eb90 100644 --- a/pages/api/events.js +++ b/pages/api/events.js @@ -10,6 +10,8 @@ export default async function handler(req, res) { await cors(req, res); + console.log("API", "events", req.headers); + if(req.headers.cookie !== undefined) { const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : ""); @@ -19,9 +21,12 @@ export default async function handler(req, res) var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT); var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true }); + console.log("client_jwt_decoded"); + console.log(client_jwt_decoded); + try { - axios.get(`${ process.env.CRM_API_HOST }/lk/Account/GetEvents/`, { + await axios.get(`${ process.env.CRM_API_HOST }/lk/Account/GetEvents/`, { params: client_jwt_decoded, headers: { "Authorization": `Bearer ${ crm_jwt }`, @@ -34,18 +39,22 @@ export default async function handler(req, res) .catch((error) => { console.error(error); - res.status(500); + res.status(500).send(); }); } catch(e) { console.error(e); - res.status(500); + res.status(500).send(); } } else { - res.status(403); + res.status(403).send(); } } + else + { + res.status(403).send(); + } } \ No newline at end of file diff --git a/pages/api/events/get.js b/pages/api/events/get.js new file mode 100644 index 0000000..e69de29 diff --git a/pages/api/events/read.js b/pages/api/events/read.js new file mode 100644 index 0000000..e69de29 diff --git a/pages/api/file/image.js b/pages/api/file/image.js index 1c0f1fb..7b55707 100644 --- a/pages/api/file/image.js +++ b/pages/api/file/image.js @@ -8,46 +8,64 @@ import { cors } from '../../../lib/cors'; export default async function handler(req, res) { + console.log("API\n\n\n\n\n\n\n"); + console.log("API", "file", "image"); + await cors(req, res); if(req.headers.cookie !== undefined) { + console.log("api 1"); const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : ""); if(cookies.jwt !== undefined && cookies.jwt !== null) { + console.log("api 2"); var client_jwt_decoded = jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT); var crm_jwt = jwt.sign(client_jwt_decoded, process.env.JWT_SECRET_CRM, { noTimestamp: true }); - try + console.log("api 3"); + console.log("API", "file", "image", "/file/GetImage", "req.query.id", req.query.id); + + await axios.get(`${ process.env.CRM_API_HOST }/file/GetImage`, { + params: { id: req.query.id }, + responseType: 'arraybuffer', + headers: { + "Authorization": `Bearer ${ crm_jwt }`, + } + }) + .then((crm_response) => { - console.log("/lk/GetImage", "req.query.id", req.query.id); - axios.get(`${ process.env.CRM_API_HOST }/lk/GetImage`, { - params: { id: req.query.id }, - //responseType: 'arraybuffer', - headers: { - "Authorization": `Bearer ${ crm_jwt }`, - } - }) - .then((crm_response) => + try { - res.status(200).send(crm_response.data); - }) - .catch((error) => + console.log("crm_response.data"); + console.log(crm_response.data); + const base64image = `data:${ crm_response['headers']['content-type'] };base64,${ Buffer.from(crm_response.data, 'binary').toString('base64') }`; + + console.log("base64image"); + console.log(base64image); + + res.status(200).send(base64image); + } + catch(e) { - console.error(error); + console.error(e); res.status(500); - }); - } - catch(e) + } + }) + .catch((error) => { - console.error(e); + console.error(error); res.status(500); - } + }); } else { res.status(403); } } + else + { + console.log("WTF?!?!?!!?"); + } } \ No newline at end of file diff --git a/pages/appeal/detail.js b/pages/appeal/detail.js deleted file mode 100644 index af9b0e4..0000000 --- a/pages/appeal/detail.js +++ /dev/null @@ -1,152 +0,0 @@ -import React from "react"; -import Head from "next/head"; -import Image from "next/image"; -import { connect } from "react-redux"; -import { withRouter } from "next/router"; -import moment from "moment"; -import { SpinnerCircular } from "spinners-react"; - -import { reduxWrapper } from "../../store"; - -import Header from "../components/Header"; -import Footer from "../components/Footer"; -import Company from "../components/Company"; -import InnerMenu from "../components/Appeals/InnerMenu"; - -import { - getContractInfo, - getContractAgreement, - getContractRules, - getFile, -} from "../../actions"; - -class ContractPage extends React.Component { - constructor(props) { - super(props); - this.state = { - date: null, - car: null, - contract_date: null, - agreement: null, - rules: null, - loading: false, - }; - } - - static getDerivedStateFromProps(nextProps, prevState) { - return { - date: nextProps.date, - car: nextProps.car, - contract_date: nextProps.contract_date, - agreement: nextProps.agreement, - rules: nextProps.rules, - }; - } - - componentDidMount() {} - - render() { - const { loading, date, car, contract_date, agreement, rules } = this.state; - const { number } = this.props; - - console.log("rules", rules); - - const types = { - contracts: "Договор", - redemptions: "Выкупные документы", - agreements: "Дополнительное соглашение", - assignments: "Договор цессии", - }; - - return ( - - - ЛК Эволюция автолизинга - - -
-
-
-
-
-
-
-

Обращение

-
-
-
-
-
-
-
-

- Досрочное прекращение срока действия договора лизинга -

- -

- Процедура -

-

- К каждой теме свободное html поле для миниинструкции - (со ссылками на формы документов и{" "} - документы). Привязка к теме обращения в CRM -

-
- -
-

- Документы -

-
-
-

- №2021_1655 от 20.04.2021 - 2021_1655 от 20.04.2021 -

-
- -
-

- №2021_1655 от 20.04.2021 - 2021_1655 от 20.04.2021 -

-
-
-
- -
-
-
-
-
-
-
-