Mheader.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. :fixed="true"
  5. :border="false"
  6. class="headerSection"
  7. :class="isTop ? '' : 'top'"
  8. >
  9. <template #left>
  10. <router-link :to="{ path: '/index' }" class="logo">
  11. <img src="../assets/images/logoWhile.png" width="100%" alt="" />
  12. </router-link>
  13. </template>
  14. <template #right>
  15. <div class="navRight">
  16. <div class="bandBtn" @click="goKu">机构入驻</div>
  17. <img
  18. class="menu"
  19. src="../assets/images/menu.png"
  20. width="100%"
  21. alt=""
  22. @click="showPopup"
  23. />
  24. </div>
  25. </template>
  26. </van-nav-bar>
  27. <van-popup
  28. v-model="show"
  29. closeable
  30. close-icon-position="top-right"
  31. position="right"
  32. :style="{ width: '100%', height: '100%' }"
  33. get-container="#app"
  34. >
  35. <div>
  36. <div class="imgwrap">
  37. <img src="../assets/images/logo.png" width="100%" alt="" />
  38. </div>
  39. <van-cell-group>
  40. <van-cell :title-class="path=='/index'?'active':''" title="产品服务" @click="goto('/index')" />
  41. <van-cell :title-class="path=='/project'?'active':''" title="成功案例" @click="goto('/project')" />
  42. <van-cell :title-class="path=='/aboutUs'?'active':''" title="关于我们" @click="goto('/aboutUs')" />
  43. </van-cell-group>
  44. </div>
  45. </van-popup>
  46. <van-popup
  47. class="join"
  48. v-model="joinIn"
  49. closeable
  50. close-icon-position="top-right"
  51. position="bottom"
  52. :style="{ height: '6.8rem' }"
  53. get-container="#app"
  54. >
  55. <div class="joinWrap">
  56. <h2 class="joinTitle">机构入驻</h2>
  57. <minForm @close='joinIn=false'/>
  58. </div>
  59. </van-popup>
  60. </div>
  61. </template>
  62. <script>
  63. import minForm from "./minForm.vue";
  64. export default {
  65. components: { minForm },
  66. data() {
  67. return {
  68. isTop: false,
  69. show: false,
  70. joinIn: false,
  71. };
  72. },
  73. mounted() {
  74. window.addEventListener("scroll", (e) => {
  75. //函数体
  76. let scrollTop =
  77. document.documentElement.scrollTop | document.body.scrollTop;
  78. scrollTop > 0 ? (this.isTop = true) : (this.isTop = false);
  79. });
  80. },
  81. beforeDestroy() {
  82. window.removeEventListener("scroll", () => {});
  83. },
  84. methods: {
  85. goKu() {
  86. // window.open("https://kj.colexiu.com/#/login?returnUrl=%2F", "_blank");
  87. this.joinIn = true;
  88. },
  89. showPopup() {
  90. this.show = true;
  91. },
  92. goto(to) {
  93. this.show = false;
  94. this.$router.push(to);
  95. },
  96. },
  97. computed:{
  98. path(){
  99. return this.$route.path
  100. }
  101. }
  102. };
  103. </script>
  104. <style lang="less" scoped>
  105. .active {
  106. color: #2dc7aa;
  107. }
  108. /deep/.van-nav-bar__right:active {
  109. opacity: 1;
  110. }
  111. /deep/.van-nav-bar__content {
  112. height:1rem;
  113. align-items: center;
  114. }
  115. /deep/.van-popup__close-icon--top-right {
  116. top:.42rem;
  117. }
  118. /deep/.van-nav-bar__left,
  119. /deep/.van-nav-bar__right {
  120. padding: 0 0.4rem;
  121. }
  122. .join {
  123. border-radius: 20px 20px 0px 0px;
  124. }
  125. .logo {
  126. width: 1.8rem;
  127. height: 0.54rem;
  128. }
  129. .imgwrap {
  130. padding-left: 0.4rem;
  131. img {
  132. width: 1.8rem;
  133. height: 0.54rem;
  134. }
  135. }
  136. .headerSection.top {
  137. background-color: transparent !important;
  138. border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  139. }
  140. .headerSection {
  141. z-index: 2000;
  142. background-color: #002F33;
  143. }
  144. .navRight {
  145. display: flex;
  146. flex-direction: row;
  147. justify-content: space-between;
  148. align-items: center;
  149. .bandBtn {
  150. width: 1.56rem;
  151. height: 0.53rem;
  152. background: #2dc7aa;
  153. border-radius: 27px;
  154. line-height: 0.53rem;
  155. color: #fff;
  156. margin-right: 0.3rem;
  157. }
  158. .menu {
  159. width: 0.4rem;
  160. height: 0.3rem;
  161. &:hover {
  162. opacity: .8;
  163. }
  164. }
  165. }
  166. .joinWrap {
  167. display: flex;
  168. flex-direction: column;
  169. align-items: center;
  170. .joinTitle {
  171. height: 0.64rem;
  172. font-size: 0.38rem;
  173. font-weight: 600;
  174. color: #000000;
  175. line-height: 0.64rem;
  176. width: 100%;
  177. text-align: center;
  178. margin: .4rem 0 0;
  179. }
  180. .joinTitle {
  181. color: #000;
  182. font-weight: bold;
  183. }
  184. }
  185. </style>