Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleИнструкции
Code Block
<html>
<head></head>
<body>
<script type="application/javascript"
        defer
        src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js">
</script>
<script type="application/javascript">
    document.addEventListener("DOMContentLoaded", function(event) {
        const paramsString = window.location.search; //get url params
        const searchParams = new URLSearchParams(paramsString); //parse url params


        const floatingButton = new window.WFloatingButton({
            token: "5sqE3XBME9tOTgZfc8bI5IxritvBLfwuJWU7txisyrliCpifqKRa7LHYJ7cz",
            element: document.getElementsByTagName("body")[0]
        });

        floatingButton.set({ vendorCode: searchParams.get('product') }); //a product vendor code from url params

        floatingButton.render({
            parameters: JSON.stringify({
                room_uuid: searchParams.get('room'), //a room uuid from url params
            })
        });
        
        // open Visualizer after page load
        if (searchParams.get('open_visualizer') === "1") {
          floatingButton.open();
        }
    });
</script>
</body>
</html>

При помощи сервисов по генерации QR-кодов Вы также можете создавать QR-коды со ссылкой на сайт с определёнными конфигурациями.

...