float-button.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="floating-buttons">
  3. <view hover-class="hover" @click="navigateTo('https://pc.global-eservice.com/h5/?lang=cn&channel=xcx#/')">
  4. <view class="iconfont icon-bishi"></view>
  5. <view class="floating-button-label">参观登记</view>
  6. </view>
  7. <view hover-class="hover" @click="onContactClick()">
  8. <view class="iconfont icon-xiaochengxu-lianxiwomenicon"></view>
  9. <view class="floating-button-label">联系我们</view>
  10. </view>
  11. <contact-us :show.sync="contactData.showContactUs" :qrcode_url="contactData.q_url" />
  12. </view>
  13. </template>
  14. <script>
  15. import {getBuoyInfo} from "@/api";
  16. import ContactUs from '@/pages/index/components/contact-us.vue'
  17. export default {
  18. name: "float-button",
  19. components: {
  20. ContactUs
  21. },
  22. data() {
  23. return {
  24. contactData: {
  25. showContactUs: false,
  26. q_url: ''
  27. }
  28. }
  29. },
  30. methods: {
  31. onContactClick() {
  32. getBuoyInfo().then(res => {
  33. this.contactData.showContactUs = true
  34. this.contactData.q_url = res.data.contact_us_qrcode
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. .floating-buttons {
  42. position: fixed;
  43. right: 30rpx;
  44. bottom: 200rpx;
  45. display: grid;
  46. grid-template-columns: 1fr;
  47. grid-row-gap: 19rpx;
  48. z-index: 8;
  49. &>view {
  50. @include display-flex-center;
  51. flex-direction: column;
  52. width: 100rpx;
  53. height: 100rpx;
  54. background-color: #FFFFFF;
  55. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.25);
  56. border-radius: 50%;
  57. cursor: pointer;
  58. }
  59. .floating-button-label {
  60. margin-top: 4rpx;
  61. font-size: 17rpx;
  62. color: #94A3B8;
  63. white-space: nowrap;
  64. }
  65. .iconfont {
  66. font-size: 44rpx;
  67. color: $textActionColor;
  68. }
  69. }
  70. </style>