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

184 lines
4.3 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
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 class="modal_drawer" v-if="drawer" @click="hidePanel">
  20. <img :src="Close" class="close" alt="" @click="drawer = false" />
  21. <div class="content" id="content_tab">
  22. <div class="icon_wrap">
  23. <p class="icon"></p>
  24. </div>
  25. <div class="btn_wrap">
  26. <div class="btn" @click="toPage('/company')">公司简介</div>
  27. <div class="btn" @click="toPage('/case-show')">案例展示</div>
  28. <div class="btn" @click="toPage('/contact')">联系我们</div>
  29. <div class="btn" @click="toPage('/recruit')">招贤纳士</div>
  30. <div class="btn" @click="toPage(`${isHard ? '/' : '/hardware'}`)">
  31. {{ isHard ? '工业设计' : '软硬件研发' }}
  32. </div>
  33. <!-- <div class="btn" @click="toPage('/product')">产品研发</div> -->
  34. </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. .modal_drawer {
  113. position: fixed;
  114. top: 0;
  115. left: 0;
  116. right: 0;
  117. bottom: 0;
  118. z-index: 999;
  119. background: rgba(0, 0, 0, 0.67);
  120. .close {
  121. position: absolute;
  122. right: 20px;
  123. width: 13px;
  124. height: 13px;
  125. top: 17px;
  126. }
  127. .content {
  128. position: absolute;
  129. left: 0;
  130. right: 0;
  131. bottom: 0;
  132. height: 348px;
  133. background: #fff;
  134. border-top-right-radius: 20px;
  135. border-top-left-radius: 20px;
  136. display: flex;
  137. flex-direction: column;
  138. .icon_wrap {
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. padding: 12px 0 0 0;
  143. .icon {
  144. width: 24px;
  145. height: 2px;
  146. border-radius: 1px;
  147. background: #000;
  148. }
  149. }
  150. .btn_wrap {
  151. flex: 1;
  152. display: flex;
  153. flex-direction: column;
  154. align-items: center;
  155. justify-content: space-evenly;
  156. .btn {
  157. font-size: 13px;
  158. font-family: Alibaba PuHuiTi;
  159. font-weight: 400;
  160. color: #000000;
  161. width: 100%;
  162. flex: 1;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. .container_bg {
  172. background: rgba(255, 255, 255, 0.9);
  173. transition-property: all;
  174. transition-duration: 0.7s;
  175. animation-fill-mode: forwards;
  176. }
  177. </style>