ქარ ENG РУС
client.sign_in

client.how_works

client.b_stage 1
client.b_stage1_h
client.b_stage1_t
client.b_stage 2
client.b_stage2_h
client.b_stage2_t
client.b_stage 3
client.b_stage3_h
client.b_stage3_t
client.b_stage 4
client.b_stage4_h
client.b_stage4_t

${item.percent}%
${item.effective_percent}%
₾ ${item.max_amount}
${item.max_period} თვე
გაგზავნე განაცხადი
`; }) $('#items_loan').html(html) }) $('#compare-popup').on('popup_opened',function (e){ let items = $(this).data('items') let currency = $('#compare_currency').data('value'); let ids = []; items.map((item,index) => { ids.push(item.id) }) console.log(items,ids,currency); axios.get(route('client.get-company-compare'),{params: {currency:currency.id,companies:ids.join(',')}}).then((response) => { console.log(response.data); let html = ``; response.data.map((item,index) => { html += `
${item.title}
განახლება: ${item.formatted_update_date}
${parseFloat(item.sell_rate_diff) < 0 ? ` ` : ` `} ${Math.abs(parseFloat(item.sell_rate_diff)).toFixed(4)}
client.sell ${parseFloat(item.sell_rate).toFixed(4)}
client.buy ${parseFloat(item.buy_rate).toFixed(4)}
`; }) $('#company_compare_list').html(html); }) }); $('#compare_currency').on('dd_changed',function (e){ console.log(e.detail.value) let items = $('#compare-popup').data('items'); let currency = e.detail.value; let ids = []; items.map((item,index) => { ids.push(item.id) }) axios.get(route('client.get-company-compare'),{params: {currency:currency.id,companies:ids.join(',')}}).then((response) => { console.log(response.data); let html = ``; response.data.map((item,index) => { html += `
${item.title}
განახლება: ${item.formatted_update_date}
${parseFloat(item.sell_rate_diff) < 0 ? ` ` : ` `} ${Math.abs(parseFloat(item.sell_rate_diff)).toFixed(4)}
client.sell ${parseFloat(item.sell_rate).toFixed(4)}
client.buy ${parseFloat(item.buy_rate).toFixed(4)}
`; }) $('#company_compare_list').html(html); }) }) Array.prototype.remove = function() { var what, a = arguments, L = a.length, ax; while (L && this.length) { what = a[--L]; while ((ax = this.indexOf(what)) !== -1) { this.splice(ax, 1); } } return this; }; let selectedCompanies = []; let removed = []; let product_id = null; let product_html = null; let product_code = null; let product_data = { product_id:null, company_id: [], product_code: null }; function renderCompaniesBtn(){ let html = ''; let html_all = ``; let html_selected = ``; if(product_data.product_id !== null){ if(!(product_data.company_id.length > 0)) html = html_all; else html = html_selected; } $('#selected-product-container').html(html); } function getSelectedCompanies() { //selectedCompanies = []; /* let input = document.getElementsByName('companies[]'); let val = []; for (let i = 0; i < input.length; i++) { let a = input[i]; if(a.checked) val.push(parseInt(a.value)); }*/ return selectedCompanies; } function setAllCompanies(){ selectedCompanies = []; } function setCompany(id){ selectedCompanies.push(parseInt(id)) } $('#application-popup').on('popup_opened',function (e){ console.log(e.detail) axios.get(route('client.get-products')) .then((response) => { console.log(response.data) let html = ``; response.data.map((item, index) => { html += `
${item.svg??''}
${item.title}
\n` }); $('#popup-product-list').html(html); }) .catch((error) => { }) }); $(document).on('click','[data-product_id]',function (e){ selectedCompanies = []; $('#all-comp-btn').addClass('active'); product_id = $(this).data('product_id'); product_code = $(this).data('product_code'); product_html = `
${$(this).html()}
`; /*let html = `
${$(this).html()}
`; $('#app-product_btn').addClass('selected') $('#app-product_btn').html(html)*/ }) $('#company-popup').on('popup_opened',function (e){ $('#company-popup-popup .popup-scroll').html(''); axios.get('https://metric.ge/ru/company/get-product-companies',{params : {product_id: product_id}}).then((response) => { console.log(response.data) let html = ``; response.data.map((item, index) => { html += `
${item.title}
\n` }) $('#company-popup .popup-scroll').html(html); Array.prototype.forEach.call( document.querySelectorAll('.popup-scroll'), (el) => new SimpleBar(el) ); }) }); $('#find-company-inp2').keyup(debounce(function (e){ $('#company-popup-popup .popup-scroll').html(''); axios.get('https://metric.ge/ru/company/get-product-companies',{params : {product_id: product_id,term: $(e.target).val()}}).then((response) => { console.log(response.data) selectedCompanies = []; $('#all-comp-btn').addClass('active'); let html = ``; response.data.map((item, index) => { html += `
${item.title}
\n` }) $('#company-popup .popup-scroll').html(html); Array.prototype.forEach.call( document.querySelectorAll('.popup-scroll'), (el) => new SimpleBar(el) ); }) },500)); $('#all-comp-btn').click(function (e){ if(!$(this).hasClass('active')){ $(this).addClass('active') setAllCompanies(); $('.popup-product-item').removeClass('checked'); $('input[name="companies[]"]').prop('checked',false); } console.log(selectedCompanies); }) $(document).on('click','a.popup-product-item',function (e){ $(this).toggleClass('checked'); $('#all-comp-btn').removeClass('active'); let ckbx = $(this).find('input[name="companies[]"]'); let svg_selected = $(this).find('svg.selected'); let svg_not_selected = $(this).find('svg.not-selected'); if($(this).hasClass('checked')){ ckbx.prop('checked',true); // svg_selected.addClass('svg-show'); // svg_selected.removeClass('svg-hide'); // svg_not_selected.removeClass('svg-show'); // svg_not_selected.addClass('svg-hide'); setCompany(ckbx.val()) } else { ckbx.prop('checked',false); // svg_selected.addClass('svg-hide'); // svg_selected.removeClass('svg-show'); // svg_not_selected.removeClass('svg-hide'); // svg_not_selected.addClass('svg-show'); selectedCompanies.remove(parseInt(ckbx.val())); if(!(selectedCompanies.length > 0)){ selectedCompanies = []; $('#all-comp-btn').addClass('active'); } } console.log(selectedCompanies); }) $('#selected-company-popup').on('popup_opened',function (e){ $('#selected-company-popup .popup-scroll').html(''); console.log(selectedCompanies) axios.get('https://metric.ge/ru/company/get-product-companies',{ params : { product_id: product_data.product_id, company_id: product_data.company_id.join(',') } }).then((response) => { console.log(response.data) let html = ``; response.data.map((item, index) => { html += `\n` }) $('#selected-company-popup .popup-scroll').html(html); Array.prototype.forEach.call( document.querySelectorAll('.popup-scroll'), (el) => new SimpleBar(el) ); }) }); $(document).on('click','#confirm-selection',function (){ product_data.product_id = product_id; product_data.company_id = getSelectedCompanies(); product_data.product_code = product_code; //console.log(product_code); if(product_code === 'auto'){ $('#auto-inputs').show(); } else $('#auto-inputs').hide(); autoErrors() $('#app-product_btn').addClass('selected') $('#app-product_btn').html(product_html) if(product_data.product_id !== null){ firstStepCheckSingleSetState('product_id',false); } //console.log($.param(product_data)); $('.popup-close').trigger('click'); renderCompaniesBtn() }); $(document).on('click','.del-company-btn',function (e){ e.stopPropagation(); let id = $(this).data('company_id'); removed.push(parseInt(id)); $(this).parents('.popup-product-item').remove(); }) $(document).on('click','#confirm-remove',function (){ removed.map((item, index) => { selectedCompanies.remove(item); }) removed = []; product_data.company_id = getSelectedCompanies(); if(product_data.product_id !== null){ firstStepCheckSingleSetState('product_id',false); } //console.log($.param(product_data)); $('.popup-close').trigger('click'); renderCompaniesBtn() }); -->