| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
- <!-- Google Fonts -->
- <script type="text/javascript">
- window.__lc = window.__lc || {};
- window.__lc.license = 18945964;
- (function (n, t, c) {
- function i(n) {
- return e._h ? e._h.apply(null, n) : e._q.push(n);
- }
- var e = {
- _q: [],
- _h: null,
- _v: "2.0",
- on: function () {
- i(["on", c.call(arguments)]);
- },
- once: function () {
- i(["once", c.call(arguments)]);
- },
- off: function () {
- i(["off", c.call(arguments)]);
- },
- get: function () {
- if (!e._h)
- throw new Error(
- "[LiveChatWidget] You can't use getters before load."
- );
- return i(["get", c.call(arguments)]);
- },
- call: function () {
- i(["call", c.call(arguments)]);
- },
- init: function () {
- var n = t.createElement("script");
- (n.async = !0),
- (n.type = "text/javascript"),
- (n.src = "https://cdn.livechatinc.com/tracking.js"),
- t.head.appendChild(n);
- },
- };
- !n.__lc.asyncInit && e.init(),
- (n.LiveChatWidget = n.LiveChatWidget || e);
- })(window, document, [].slice);
- </script>
- <noscript>
- <a href="https://www.livechat.com/chat-with/18945964/" rel="nofollow">Chat with us</a>, powered by
- <!-- <a
- href="https://www.livechat.com/?welcome"
- rel="noopener nofollow"
- target="_blank"
- >LiveChat</a
- > -->
- </noscript>
- <style>
- @media (max-width: 760px) {
- #chat-widget-container {
- left: 0 !important;
- bottom: 0px !important;
- }
- }
- </style>
- <title>CWGMarkets</title>
- </head>
- <body>
- <script src="assets/vendor/jquery/jquery.min.js"></script>
- <script>
- //客服
- var $zopim = null
- let rep = setInterval(aTimer, 1000)
- function aTimer() {
- if ($zopim) {
- $zopim(function () {
- let lang = window.localStorage.getItem("lang")
- if (['cn', 'zhHant'].indexOf(localStorage.getItem('lang')) != -1) {
- $zopim.livechat.setLanguage('zh_CN');
- } else {
- $zopim.livechat.setLanguage('en');
- }
- window.clearInterval(rep)
- // $("#launcher") && $("#launcher").css("display", "none")
- });
- if ($("body").width() > 768) {
- $("#launcher") && $("#launcher").css("bottom", $("#footer-body").height() + "px")
- $("#webWidget") && $("#webWidget").css("bottom", $("#footer-body").height() + "px")
- }
- }
- }
- </script>
- <script>
- function adjustChatWidgetContainerHeight() {
- const $chatWidget = $('#chat-widget');
- const $chatWidgetContainer = $('#chat-widget-container');
- const href = window.location.href;
- const queryString = href.includes('?') ? href.split('?')[1] : '';
- const urlParams = new URLSearchParams(queryString);
- const statusBarHeight = urlParams.get('statusBarHeight') || 0;
- if ($chatWidget.length && $chatWidgetContainer.length) {
- const isHidden = $chatWidget.css('display') === 'none';
- window.parent.postMessage({
- type: 'chatWidgetStatus',
- isHidden: isHidden
- }, '*');
- $chatWidget.css({
- 'padding-top': statusBarHeight + 'px',
- 'box-sizing': 'border-box',
- 'background-color': 'rgb(248, 248, 248)'
- });
- const $dragHandle = $('#chat-drag-handle');
- if (isHidden) {
- if ($dragHandle.length) {
- $dragHandle.show();
- }
- } else {
- if ($dragHandle.length) {
- $dragHandle.hide();
- }
- }
- var newRule = ''
- if (isHidden) {
- newRule = `
- @media (max-width: 760px) {
- #chat-widget-container {
- left: 0 !important;
- height: 100px !important;
- width: 100px !important;
- bottom: 0px !important;
- }
- }
- `;
- } else {
- newRule = `
- @media (max-width: 760px) {
- #chat-widget-container {
- left: 0 !important;
- height: 100% !important;
- width: 100% !important;
- bottom: 0px !important;
- }
- }
- `;
- }
- const styleTag = document.createElement('style');
- styleTag.type = 'text/css';
- styleTag.appendChild(document.createTextNode(newRule));
- document.head.appendChild(styleTag);
- }
- }
- function waitForChatWidget() {
- const $chatWidget = $('#chat-widget');
- if ($chatWidget.length) {
- const observer = new MutationObserver(adjustChatWidgetContainerHeight);
- observer.observe($chatWidget[0], {
- attributes: true,
- attributeFilter: ['style']
- });
- adjustChatWidgetContainerHeight();
- } else {
- setTimeout(waitForChatWidget, 500);
- }
- }
- $(document).ready(() => {
- waitForChatWidget();
- // 检查 chat-widget-minimized 是否存在,并通知父页面
- function notifyParentChatMinimizedReady() {
- const minimized = document.getElementById('chat-widget-minimized') || document.querySelector('.chat-widget-minimized');
- if (minimized) {
- window.parent.postMessage({ type: 'chatWidgetMinimizedReady' }, '*');
- } else {
- setTimeout(notifyParentChatMinimizedReady, 300);
- }
- }
- notifyParentChatMinimizedReady();
- });
- window.addEventListener('message', function (event) {
- if (event.data && event.data.type === 'openChat') {
- const chatWidget = document.getElementById('chat-widget-minimized');
- const iframeDoc = chatWidget.contentDocument || chatWidget.contentWindow.document;
- const button = iframeDoc.querySelector('button');
- if (button) {
- button.click();
- }
- }
- });
- </script>
- </body>
- </html>
|