hjyd的手机端
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.

137 lines
2.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div
  3. :class="
  4. isDrag
  5. ? isHard
  6. ? 'bottom_container drag h_bottom'
  7. : 'bottom_container drag'
  8. : isHard
  9. ? 'bottom_container h_bottom'
  10. : 'bottom_container'
  11. "
  12. >
  13. <div class="online">
  14. <img class="img1" :src="A1" alt="" />
  15. <span class="text1">在线咨询</span>
  16. </div>
  17. <div class="phone">
  18. <div :class="isHard ? 'box hard' : 'box'" @click="toPhone">
  19. <img class="img3" :src="A2" alt="" />
  20. <span class="text2">拨打电话</span>
  21. </div>
  22. </div>
  23. <div class="online" @click="addWeChat">
  24. <img class="img2" :src="A3" alt="" /> <span class="text1">添加微信</span>
  25. </div>
  26. </div>
  27. </template>
  28. <script setup>
  29. import A1 from '@/static/img/bottom/kefu.png'
  30. import A2 from '@/static/img/bottom/phone.png'
  31. import A3 from '@/static/img/bottom/wechat.png'
  32. import { useRoute } from 'vue-router'
  33. import { ref, onMounted } from 'vue'
  34. const route = useRoute()
  35. const props = defineProps({
  36. isDrag: {
  37. type: Boolean,
  38. },
  39. })
  40. const addWeChat = () => {
  41. console.log(window.location)
  42. const origin = window.location.origin
  43. const pathname = window.location.pathname
  44. const p = `${origin}${pathname}#/code`
  45. window.open(p)
  46. }
  47. const toPhone = () => {
  48. window.location.href = 'tel:13717892018'
  49. }
  50. const isHard = ref(false)
  51. onMounted(() => {
  52. if (route.path.indexOf('/hardware') != -1) {
  53. isHard.value = true
  54. }
  55. })
  56. </script>
  57. <style lang="scss" scoped>
  58. .bottom_container {
  59. position: fixed;
  60. bottom: 0;
  61. left: 0;
  62. right: 0;
  63. height: $bottom-height;
  64. background: #ffa18e;
  65. z-index: 100;
  66. display: flex;
  67. box-sizing: border-box;
  68. align-items: center;
  69. justify-content: space-between;
  70. padding: 0 35px;
  71. .online {
  72. display: flex;
  73. align-items: center;
  74. white-space: nowrap;
  75. box-sizing: border-box;
  76. .img1 {
  77. width: 14px;
  78. height: 14px;
  79. margin-right: 6px;
  80. }
  81. .img2 {
  82. width: 16px;
  83. height: 13px;
  84. margin-right: 6px;
  85. }
  86. .text1 {
  87. font-size: 9px;
  88. font-family: Alibaba PuHuiTi;
  89. font-weight: 400;
  90. color: #ffffff;
  91. }
  92. }
  93. .phone {
  94. flex: 1;
  95. display: flex;
  96. align-items: center;
  97. justify-content: center;
  98. .box {
  99. width: 110px;
  100. height: $bottom-height;
  101. background: linear-gradient(90deg, #f98222, #f94622);
  102. border-radius: 16px;
  103. display: flex;
  104. align-items: center;
  105. .img3 {
  106. width: 24px;
  107. height: 24px;
  108. margin-left: 4px;
  109. margin-right: 11px;
  110. }
  111. .text2 {
  112. font-size: 13px;
  113. font-family: Alibaba PuHuiTi;
  114. font-weight: 500;
  115. color: #ffffff;
  116. }
  117. }
  118. .hard {
  119. background: linear-gradient(90deg, #2beec3, #74fddf);
  120. }
  121. }
  122. }
  123. .drag {
  124. opacity: 0.3;
  125. transition-property: all;
  126. transition-duration: 0.7s;
  127. animation-fill-mode: forwards;
  128. }
  129. .h_bottom {
  130. background: #14e1b4;
  131. }
  132. </style>