updates for graphic changes, manager

This commit is contained in:
merelendor 2022-08-31 03:49:41 +03:00
parent 09f904a44b
commit dc6f9ce052
5 changed files with 36 additions and 12 deletions

View File

@ -68,7 +68,7 @@ class Manager extends React.Component
<div className="info"> <div className="info">
<a href={ `mailto:${ company.manager_email }` }>{ company.manager_email }</a> <a href={ `mailto:${ company.manager_email }` }>{ company.manager_email }</a>
{ company.manager_mobilephone !== undefined && company.manager_mobilephone !== null && company.manager_mobilephone !== "" && ( { company.manager_mobilephone !== undefined && company.manager_mobilephone !== null && company.manager_mobilephone !== "" && (
<a href={ `tel:+${ company.manager_mobilephone.replace('/[^\d]/m', '') }` }>{ company.manager_mobilephone }</a> <a href={ `tel:+${ company.manager_mobilephone.replace(/[^\d]/mg, '') }` }>{ company.manager_mobilephone }</a>
) } ) }
{ company.manager_telegram !== undefined && company.manager_telegram !== null && company.manager_telegram !== "" && ( { company.manager_telegram !== undefined && company.manager_telegram !== null && company.manager_telegram !== "" && (
<a href={ `https://telegram.me/${ company.manager_telegram.replace("@", "") }` } target="_blank">{ `@${ company.manager_telegram.replace("@", "")}` }</a> <a href={ `https://telegram.me/${ company.manager_telegram.replace("@", "") }` } target="_blank">{ `@${ company.manager_telegram.replace("@", "")}` }</a>

View File

@ -50,7 +50,7 @@ export default class CalculationsList extends React.Component
dots: false, dots: false,
infinite: false, infinite: false,
speed: 500, speed: 500,
slidesToShow: 2.5, slidesToShow: 2.3,
slidesToScroll: 1, slidesToScroll: 1,
centerMode: false, centerMode: false,
variableWidth: false, variableWidth: false,

View File

@ -291,7 +291,7 @@ class SumSelector extends React.Component
const { onOption } = this.props; const { onOption } = this.props;
const { min, max } = this.state; const { min, max } = this.state;
const value = parseFloat(event.target.value.replace('/[^\d]/m', '')); const value = parseFloat(event.target.value.replace(/[^\d]/mg, ''));
if(value >= min && value <= max && !isNaN(value)) if(value >= min && value <= max && !isNaN(value))
{ {
this.setState({ value: value }, () => this.setState({ value: value }, () =>
@ -380,7 +380,7 @@ class InsurancePriceSelector extends React.Component
//} //}
//else //else
//{ //{
const value = parseFloat(event.target.value.replace('/[^\d]/m', '')); const value = parseFloat(event.target.value.replace(/[^\d]/mg, ''));
if(value >= min && value <= max && !isNaN(value)) if(value >= min && value <= max && !isNaN(value))
{ {
this.setState({ value: value }, () => this.setState({ value: value }, () =>

View File

@ -191,7 +191,9 @@ class ContractPage extends React.Component
</div> </div>
</div> </div>
) } ) }
<button className="button button-blue" onClick={ () => this._handle_onRequest(question.id) }>Создать обращение</button> { question.request && (
<button className="button button-blue" onClick={ () => this._handle_onRequest(question.id) }>Создать обращение</button>
) }
</div> </div>
</div> </div>
</div> </div>

View File

@ -113,6 +113,7 @@ class SupportRequestPage extends React.Component
loading: false, loading: false,
contracts: null, contracts: null,
themes: null, themes: null,
themes_filtered: null,
name: "", name: "",
phone: "", phone: "",
email: "", email: "",
@ -169,7 +170,26 @@ class SupportRequestPage extends React.Component
opened_theme++; opened_theme++;
} }
this.setState({ loading: false, opened_theme: found ? opened_theme : 0, opened_question: found ? opened_question : 0 }); let themes_filtered = [];
for(let t in this.state.themes)
{
let questions = [];
for(let q in this.state.themes[t].questions)
{
if(this.state.themes[t].questions[q].request)
{
questions.push(this.state.themes[t].questions[q]);
}
}
if(questions.length > 0)
{
themes_filtered.push({ ...this.state.themes[t], ...{ questions } });
}
}
this.setState({ loading: false, themes_filtered, opened_theme: found ? opened_theme : 0, opened_question: found ? opened_question : 0 });
}) })
.catch(() => {}); .catch(() => {});
}); });
@ -301,7 +321,7 @@ class SupportRequestPage extends React.Component
_renderForm = () => _renderForm = () =>
{ {
const { loading, contracts, themes, name, phone, email, question, file, files, opened_theme, opened_question } = this.state; const { loading, contracts, themes, themes_filtered, name, phone, email, question, file, files, opened_theme, opened_question } = this.state;
const contracts_list = []; const contracts_list = [];
for(let i in contracts) for(let i in contracts)
@ -346,9 +366,11 @@ class SupportRequestPage extends React.Component
render() render()
{ {
const { number } = this.props; const { number } = this.props;
const { loading, success, themes, opened_theme, opened_question } = this.state; const { loading, success, themes, themes_filtered, opened_theme, opened_question } = this.state;
const procedure = themes !== undefined && themes !== null ? themes[opened_theme].questions[opened_question] : undefined; const procedure = themes_filtered !== undefined && themes_filtered !== null ? themes_filtered[ opened_theme ].questions[ opened_question ] : undefined;
console.log("themes_filtered", themes_filtered);
return ( return (
<React.Fragment> <React.Fragment>
@ -379,9 +401,9 @@ class SupportRequestPage extends React.Component
<div className="new_appeal"> <div className="new_appeal">
<div className="column"> <div className="column">
<div className="dropdown_blocks_list appeal_list visible"> <div className="dropdown_blocks_list appeal_list visible">
{ themes !== undefined && themes !== null && themes.map((theme, theme_index) => { themes_filtered !== undefined && themes_filtered !== null && themes_filtered.map((theme, theme_index) =>
( (
<React.Fragment key={ `theme_${ theme_index }` } > <React.Fragment key={ `theme_${ theme_index }` }>
<div className={ `appeal_item dropdown_block ${ theme_index === opened_theme && "open" }` } style={ theme_index === opened_theme ? { backgroundColor: "unset"} : {} } onClick={ () => this._handle_onChangeTheme(theme_index) }> <div className={ `appeal_item dropdown_block ${ theme_index === opened_theme && "open" }` } style={ theme_index === opened_theme ? { backgroundColor: "unset"} : {} } onClick={ () => this._handle_onChangeTheme(theme_index) }>
<div className="block_header"> <div className="block_header">
<p style={{ fontWeight: "bold" }}>{ theme.name }</p> <p style={{ fontWeight: "bold" }}>{ theme.name }</p>
@ -400,7 +422,7 @@ class SupportRequestPage extends React.Component
)) } )) }
</div> </div>
</div> </div>
{ themes !== undefined && themes !== null && ( { themes_filtered !== undefined && themes_filtered !== null && (
<div className="column"> <div className="column">
<div className="column_text_block"> <div className="column_text_block">
<p><b>Процедура</b></p> <p><b>Процедура</b></p>