Skip to content
Snippets Groups Projects

Виджет формы

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Andrei Biriukov
    widget.html 1.76 KiB
    <div id="booking-car-form"></div>
    
    <script src="https://services.platform.prod.exeed.perx.ru/widgets/forms/exeed-widget-forms.js?v=1704872715588" async data-onload="initExeedBookingCarForm"></script>
    <script>
    function initExeedBookingCarForm() {
        try {
            var exeedForms = new ExeedForms({
                ids: {
                    space: 'cb6kstaeibkpl3dtsceg',
                    env: 'cb6kstaeibkpl3dtscf0',
                    cities: 'dealers_cities',
                    dealers: 'dealers_dealerships',
                    models: 'vehicles_models',
                    calltouch: 'calltouch_mod_id'
                },
            })
    
            // Вторым аргументом можно прокинуть функцию, которая выполниться перед рендером
            const bookingCarForm = exeedForms.render({
                tag: '#booking-car-form',
                name: 'booking-car',
                form_params: {
                    test_param: 'test_param',
                },
                form_data_params: {
                    test_data_param: 'test_data_param',
                },
                query_params: ['utm_source'],
                config: {
                    id: 'forms_booking_car',
                    title: 'Забронировать автомобиль',
                },
                theme: {
                    name: 'carstock',
                    mode: 'dark'
                }
            }, (widget) => {
                widget.emitter.on('widget.mount', function () {
                    console.log('widget.mount через колбэк')
                })
            })
    
            bookingCarForm.emitter.on('widget.mount', function () {
                console.log('widget.mount')
            })
        } catch (err) {
            console.warn('Не удалось запустить виджет exeed-booking-car-form', err)
        }
    }
    </script>
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment