diff --git a/pages/components/Header/index.js b/pages/components/Header/index.js index f55d7e7..4775d76 100644 --- a/pages/components/Header/index.js +++ b/pages/components/Header/index.js @@ -54,6 +54,7 @@ class Header extends React.Component if (route.indexOf("/settings/") > -1) return "Настройки"; if (route.indexOf("/contract") === 0) return "Договоры"; if (route.indexOf("/support") === 0) return "Обращения"; + if (route.indexOf("/events") === 0) return "События"; return null; }; diff --git a/pages/contract/change/components/Comparison/index.js b/pages/contract/change/components/Comparison/index.js index e156228..9fafee9 100644 --- a/pages/contract/change/components/Comparison/index.js +++ b/pages/contract/change/components/Comparison/index.js @@ -230,7 +230,7 @@ export default class Comparison extends React.Component ) } { calculation !== undefined && calculation !== null && calculation.insurance_price_result_comment !== null && (
-

{ calculation.insurance_price_result_comment.label }: { numeral(calculation.insurance_price_result_comment.value).format(' ., ') } ₽

+

{ calculation.insurance_price_result_comment.label }: { calculation.insurance_price_result_comment.value }

) } { calculation !== undefined && calculation !== null && calculation.number_paydate_comment !== null && ( @@ -245,7 +245,7 @@ export default class Comparison extends React.Component ) } { calculation !== undefined && calculation !== null && calculation.sum_comment !== null && (
-

{ calculation.sum_comment.label } { numeral(calculation.sum_comment.value).format(' ., ') } ₽

+

{ calculation.sum_comment.label } { calculation.sum_comment.value }

) } {/*} diff --git a/pages/contract/change/components/Options/index.js b/pages/contract/change/components/Options/index.js index 7a3c5a2..c0b22b7 100644 --- a/pages/contract/change/components/Options/index.js +++ b/pages/contract/change/components/Options/index.js @@ -51,7 +51,7 @@ class PaymentDate extends React.Component return (
- + { option.information !== undefined && option.information !== null && (
@@ -173,7 +173,7 @@ class DateOffestType extends React.Component return (
- +
{ (!option.disable || (option.disable && value === 100000001)) && ( <> @@ -246,7 +246,7 @@ class PeriodSelector extends React.Component { return (
- + от { numeral(min).format(' ., ') } ₽ @@ -402,7 +402,7 @@ class InsurancePriceSelector extends React.Component return (
- +
{ option.disable ? ( <>{ numeral(value).format(' ., ') } ₽ @@ -481,7 +481,7 @@ class InsuranceDateFromSelector extends React.Component return (
- + +

{ options !== undefined && options !== null && options.number_planpayment_header.value }

Параметры опций изменений графика платежей

{ loading ? (
diff --git a/pages/contract/change/components/VariantsList/index.js b/pages/contract/change/components/VariantsList/index.js index 2984513..ccf8026 100644 --- a/pages/contract/change/components/VariantsList/index.js +++ b/pages/contract/change/components/VariantsList/index.js @@ -8,6 +8,7 @@ export default class VariantsList extends React.Component { super(props); this.state = { + opened: [], }; } @@ -65,9 +66,27 @@ export default class VariantsList extends React.Component this.props.onOptions(); } + _handle_onMobileHelp = (index) => + { + console.log("_handle_onMobileHelp", index); + const opened = [ ...this.state.opened ]; + + if (opened.indexOf(index) === -1) + { + opened.push(index); + } + else + { + opened.splice(opened.indexOf(index), 1); + } + + this.setState({ opened: opened }); + } + render() { const { number, variants, variants_types, selected, blocked, loading } = this.props; + const { opened } = this.state; console.log(variants_types); return ( @@ -80,7 +99,7 @@ export default class VariantsList extends React.Component const disabled = this._checkVariant(variant.type); const help = this._getVariantHelp(variant.type); - console.log("help", help); + console.log("opened", opened); return (
@@ -89,19 +108,17 @@ export default class VariantsList extends React.Component style={ disabled ? { color: "#A8026B", textDecoration: "line-through", } : {} }>{ variant.title } { help !== null && (
-
+
this._handle_onMobileHelp(variant.type) }>
-
- {" "} - {/* opened */} +
-1 && "opened" }`}>

-

Закрыть

+

this._handle_onMobileHelp(variant.type) }>Закрыть

diff --git a/pages/contract/change/index.js b/pages/contract/change/index.js index cf341a2..7cbc9b1 100644 --- a/pages/contract/change/index.js +++ b/pages/contract/change/index.js @@ -57,11 +57,11 @@ class ChangeGraphicPage extends React.Component variants_unavailable: [], variants_loading: false, variants_types: [ - { title: "Изменить дату платежа", type: "change_payment_date", help: "Это подсказка по Изменить дату платежа" }, - { title: "Изменение параметров страхования", type: "insurance_change", help: "Это подсказка по Изменение параметров страхования" }, + { title: "Изменение даты платежей", type: "change_payment_date", help: "Это подсказка по Изменить дату платежа" }, + { title: "Включение КАСКО в график", type: "insurance_change", help: "Это подсказка по Изменение параметров страхования" }, //{ title: "Изменение выкупного платежа", type: "last_payment_change", help: "Это подсказка по Изменение формулировки выкупной платеж" }, { title: "Лизинговые каникулы", type: "date_offset_change", help: "Это подсказка по Лизинговые каникулы" }, - { title: "Изменение кол-ва платежей", type: "contract_term_change", help: "Это подсказка по Изменение кол-ва платежей" }, + { title: "Увеличение срока договора лизинга", type: "contract_term_change", help: "Это подсказка по Изменение кол-ва платежей" }, { title: "Изменение суммы платежей", type: "sum_pay_change", help: "Это подсказка по Изменение суммы платежей" }, { title: "Досрочный выкуп", type: "early_redemption_change", help: "Это подсказка по Досрочный выкуп" }, //{ title: "Изменение Лизингополучателя", type: "", help: "Это подсказка по Изменение Лизингополучателя" }, diff --git a/pages/events.js b/pages/events.js index 868d066..4910c19 100644 --- a/pages/events.js +++ b/pages/events.js @@ -165,7 +165,7 @@ class EventsPage extends React.Component
{ events_loaded && ( <> - { filtered !== undefined ? this._renderEvents(filtered) : this._rederEvents(events) } + { filtered !== undefined ? this._renderEvents(filtered) : this._renderEvents(events) } ) } diff --git a/pages/support/appeals.js b/pages/support/appeals.js index 3c03ca9..16b9e59 100644 --- a/pages/support/appeals.js +++ b/pages/support/appeals.js @@ -21,6 +21,7 @@ import { setAppealsRead, } from "../../actions"; import AccountLayout from "../components/Layout/Account"; +import RequestFile from "./components/RequestFile"; class SupportAppealsPage extends React.Component { @@ -136,13 +137,14 @@ class SupportAppealsPage extends React.Component <> { appeals.list.map((appeal, index) => { + console.log("appeal >>>>>>>", appeal); if(active) { if(appeal.status !== "active") { return null; } } return (

Номер обращения: { appeal.number } от { moment(appeal.created_date, "YYYY-MM-DD").format("DD.MM.YYYY") }

-

Отвественный сотрудник ОРК: { appeal.owner }

+

Ваш персональный менеджер: { appeal.owner }

{ appeal.contracts.length > 0 && (

Договор{ appeal.contracts.length > 1 && "ы" }: { appeal.contracts.map((contract, contract_index) => (№ { contract }{ contract_index < appeal.contracts.length - 1 && ", " })) }

) } @@ -152,21 +154,24 @@ class SupportAppealsPage extends React.Component

Тема запроса

{ appeal.subject }

+ { appeal.documents.length > 0 && ( +
+ { appeal.documents.map((file, index) => { + if(file.doc_direction !== "outgoing") { return null; } + return () + }) } +
+ ) }
-

Ответ ОРК

+

Ответ службы клиентского сервиса

{ appeal.answer === "" ? "Без ответа" : appeal.answer }

{ appeal.documents.length > 0 && (
- { appeal.documents.map((document, document_index) => - ( -
-

- { document.doc_name } - Скачать документ -

-
- )) } + { appeal.documents.map((file, index) => { + if(file.doc_direction !== "incoming") { return null; } + () + }) }
) }
diff --git a/pages/support/components/RequestFile/index.js b/pages/support/components/RequestFile/index.js new file mode 100644 index 0000000..c120fd3 --- /dev/null +++ b/pages/support/components/RequestFile/index.js @@ -0,0 +1,48 @@ +import React from "react"; +import { SpinnerCircular } from "spinners-react"; + +import { getFile } from "../../../../actions"; + +export default class RequestFile extends React.Component +{ + constructor(props) + { + super(props); + this.state = { + downloading: false + } + } + + _handle_onDownloadFile = () => + { + const { id, filename } = this.props; + const { downloading } = this.state; + + if(!downloading) + { + this.setState({ downloading: true }, () => + { + getFile({ id, filename }) + .then(() => { this.setState({ downloading: false }); }) + .catch(() => { this.setState({ downloading: false }); }); + }); + } + } + + render() + { + const { filename, extension } = this.props; + const { downloading } = this.state; + + return ( +
+

+ { filename } + + Скачать шаблон{ downloading ? () : null } + +

+
+ ) + } +} \ No newline at end of file diff --git a/pages/support/components/TemplateFile/index.js b/pages/support/components/TemplateFile/index.js new file mode 100644 index 0000000..3289023 --- /dev/null +++ b/pages/support/components/TemplateFile/index.js @@ -0,0 +1,48 @@ +import React from "react"; +import { SpinnerCircular } from "spinners-react"; + +import { getBitrixFile } from "../../../../actions"; + +export default class TemplateFile extends React.Component +{ + constructor(props) + { + super(props); + this.state = { + downloading: false + } + } + + _handle_onDownloadFile = () => + { + const { filename, url } = this.props.template; + const { downloading } = this.state; + + if(!downloading) + { + this.setState({ downloading: true }, () => + { + getBitrixFile({ url, filename }) + .then(() => { this.setState({ downloading: false }); }) + .catch(() => { this.setState({ downloading: false }); }); + }); + } + } + + render() + { + const { template } = this.props; + const { downloading } = this.state; + + return ( +
+

+ { template.filename } + + Скачать шаблон{ downloading ? () : null } + +

+
+ ) + } +} \ No newline at end of file diff --git a/pages/support/index.js b/pages/support/index.js index 31c7641..ba555ef 100644 --- a/pages/support/index.js +++ b/pages/support/index.js @@ -12,11 +12,12 @@ import Header from "../components/Header"; import Footer from "../components/Footer"; import Company from "../components/Company"; import InnerMenu from "./components/InnerMenu"; +import AccountLayout from "../components/Layout/Account"; +import TemplateFile from "./components/TemplateFile"; import { getSupportThemes, } from "../../actions"; -import AccountLayout from "../components/Layout/Account"; class ContractPage extends React.Component { @@ -182,12 +183,7 @@ class ContractPage extends React.Component

Шаблоны документов

- { question.templates.map((template, index) => - ( -
-

{ template.filename }

-
- )) } + { question.templates.map((template, index) => ()) }
) } diff --git a/pages/support/request.js b/pages/support/request.js index e330d40..218b05b 100644 --- a/pages/support/request.js +++ b/pages/support/request.js @@ -15,6 +15,8 @@ import Footer from "../components/Footer"; import Company from "../components/Company"; import InnerMenu from "./components/InnerMenu"; import SuccessMessage from "./components/SuccessMessage"; +import AccountLayout from "../components/Layout/Account"; +import TemplateFile from "./components/TemplateFile"; import { getSupportThemes, @@ -23,46 +25,7 @@ import { sendNewAppeal, sendAppealAttachments } from "../../actions"; -import AccountLayout from "../components/Layout/Account"; -class TemplateFile extends React.Component -{ - constructor(props) - { - super(props); - this.state = { - downloading: false - } - } - - _handle_onDownloadFile = () => - { - const { filename, url } = this.props.template; - const { downloading } = this.state; - - if(!downloading) - { - this.setState({ downloading: true }, () => - { - getBitrixFile({ url, filename }) - .then(() => { this.setState({ downloading: false }); }) - .catch(() => { this.setState({ downloading: false }); }); - }); - } - } - - render() - { - const { template } = this.props; - const { downloading } = this.state; - - return ( -
-

{ template.filename }Скачать шаблон{ downloading ? () : null }

-
- ) - } -} class FileDropzone extends React.Component { constructor(props)