加工手机端
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.

205 lines
4.6 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
  1. <template>
  2. <div
  3. :class="
  4. istop && isFirstSwiper ? 'top_container' : 'top_container container_bg'
  5. "
  6. >
  7. <img class="newlogo" :src="Logo4" alt="" />
  8. <img
  9. class="fold_icon"
  10. :src="istop && isFirstSwiper ? Icon : Icon1"
  11. alt=""
  12. v-if="!drawer"
  13. @click="openDrawer"
  14. />
  15. </div>
  16. <div class="modal_drawer" v-if="drawer" @click="hidePanel">
  17. <img :src="Close" class="close" alt="" @click="drawer = false" />
  18. <div class="content" id="content_tab">
  19. <div class="icon_wrap">
  20. <p class="icon"></p>
  21. </div>
  22. <div class="btn_wrap">
  23. <div class="btn" @click="toPage('/')">首页</div>
  24. <div class="btn" @click="toPage('/company')">公司简介</div>
  25. <div class="btn" @click="toPage('/contact')">联系我们</div>
  26. <div class="btn" @click="toPage('/recruit')">招贤纳士</div>
  27. <div class="btn" @click="toPage('/factory')">工厂展示</div>
  28. <div class="btn" @click="toPage('/design')">工业设计</div>
  29. <div class="btn" @click="toPage('/hardware')">软硬件研发</div>
  30. <div class="btn" @click="toPage('/onestep')">整机开发</div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script setup>
  36. import { ref, onMounted } from 'vue'
  37. import Close from '@/static/img/banner/x.png'
  38. import Icon from '@/static/img/banner/liebiao.png'
  39. import Icon1 from '@/static/img/banner/liebiao2.png'
  40. import Logo4 from '@/static/img/banner/logl.png'
  41. import { useRouter, useRoute } from 'vue-router'
  42. const route = useRoute()
  43. const router = useRouter()
  44. const drawer = ref(false)
  45. const props = defineProps({
  46. isFirstSwiper: {
  47. type: Boolean,
  48. },
  49. newpage: {
  50. type: Boolean,
  51. },
  52. hardLogo: {
  53. type: Boolean,
  54. },
  55. })
  56. const openDrawer = () => {
  57. drawer.value = true
  58. }
  59. const toPage = path => {
  60. const origin = window.location.origin
  61. const pathname = window.location.pathname
  62. const p = `${origin}${pathname}#${path}`
  63. if (path == '/hardware') {
  64. window.location.href = 'https://iflytop.com/mobile/hardware/#/'
  65. return
  66. }
  67. if (path == '/design') {
  68. window.location.href = 'https://iflytop.com/mobile/design/#/'
  69. return
  70. }
  71. if (path == '/onestep') {
  72. window.location.href = 'https://iflytop.com/mobile/onestep/#/'
  73. return
  74. }
  75. window.location.href = p
  76. drawer.value = false
  77. }
  78. const hidePanel = event => {
  79. let dom = document.getElementById('content_tab')
  80. if (dom) {
  81. if (!dom.contains(event.target)) {
  82. //这句是说如果我们点击到了id为child以外的区域
  83. drawer.value = false
  84. }
  85. }
  86. }
  87. const isHard = ref(false)
  88. onMounted(() => {
  89. window.addEventListener('scroll', scrollToTop)
  90. if (route.path.indexOf('/hardware') != -1) {
  91. isHard.value = true
  92. }
  93. })
  94. const istop = ref(true)
  95. const scrollToTop = () => {
  96. var scrollTop =
  97. window.pageYOffset ||
  98. document.documentElement.scrollTop ||
  99. document.body.scrollTop
  100. if (scrollTop == 0) {
  101. istop.value = true
  102. } else {
  103. istop.value = false
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .top_container {
  109. padding: 14px 14px;
  110. overflow: hidden;
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. position: fixed;
  115. top: 0;
  116. right: 0;
  117. width: 100%;
  118. box-sizing: border-box;
  119. .logo {
  120. width: 85px;
  121. height: 17px;
  122. }
  123. .newlogo {
  124. width: 80px;
  125. height: auto;
  126. }
  127. .fold_icon {
  128. width: 18px;
  129. height: 12px;
  130. }
  131. }
  132. .modal_drawer {
  133. position: fixed;
  134. top: 0;
  135. left: 0;
  136. right: 0;
  137. bottom: 0;
  138. z-index: 999;
  139. background: rgba(0, 0, 0, 0.67);
  140. .close {
  141. position: absolute;
  142. right: 20px;
  143. width: 13px;
  144. height: 13px;
  145. top: 17px;
  146. }
  147. .content {
  148. position: absolute;
  149. left: 0;
  150. right: 0;
  151. bottom: 0;
  152. height: 348px;
  153. background: #fff;
  154. z-index: 999;
  155. border-top-right-radius: 20px;
  156. border-top-left-radius: 20px;
  157. display: flex;
  158. flex-direction: column;
  159. .icon_wrap {
  160. display: flex;
  161. align-items: center;
  162. justify-content: center;
  163. padding: 12px 0 0 0;
  164. .icon {
  165. width: 24px;
  166. height: 2px;
  167. border-radius: 1px;
  168. background: #000;
  169. }
  170. }
  171. .btn_wrap {
  172. flex: 1;
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. justify-content: space-evenly;
  177. .btn {
  178. font-size: 13px;
  179. font-family: Alibaba PuHuiTi;
  180. font-weight: 400;
  181. color: #000000;
  182. width: 100vw;
  183. flex: 1;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. }
  188. }
  189. }
  190. }
  191. .container_bg {
  192. background: rgba(255, 255, 255, 0.9);
  193. backdrop-filter: blur(30px);
  194. transition-property: all;
  195. transition-duration: 0.7s;
  196. animation-fill-mode: forwards;
  197. }
  198. </style>