You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

2 years ago
  1. <template>
  2. <div>
  3. <div id="fb-root"></div>
  4. <div id="fb-customer-chat" class="fb-customerchat"></div>
  5. </div>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. page_id: "100918545835171", // 1126866797415176
  12. };
  13. },
  14. mounted() {
  15. if (process.browser && process.env.ENV !== "local") {
  16. var chatbox = document.getElementById("fb-customer-chat");
  17. chatbox.setAttribute("page_id", this.page_id);
  18. chatbox.setAttribute("attribution", "biz_inbox");
  19. window.fbAsyncInit = function () {
  20. FB.init({
  21. xfbml: true,
  22. version: "v14.0",
  23. });
  24. };
  25. (function (d, s, id) {
  26. var js,
  27. fjs = d.getElementsByTagName(s)[0];
  28. if (d.getElementById(id)) return;
  29. js = d.createElement(s);
  30. js.id = id;
  31. js.src = "https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js";
  32. fjs.parentNode.insertBefore(js, fjs);
  33. })(document, "script", "facebook-jssdk");
  34. }
  35. },
  36. methods: {},
  37. };
  38. </script>
  39. <style lang="scss" scoped>
  40. :deep() {
  41. #fb-root .fb_dialog_content.hasBar>iframe:first-child {
  42. bottom: 120px !important;
  43. @media screen and (min-width: 768px) {
  44. bottom: 100px !important;
  45. }
  46. }
  47. }
  48. </style>