新版梦工厂手机端官网
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.

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