nav.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="main-top">
  3. <view class="main-top-nav">
  4. <view class="main-top-nav-logo" @tap="handleTo('/pagesB/headhunting/index')">
  5. <image
  6. src="https://minio.citupro.com/dev/menduner/poster.png"
  7. mode="aspectFill"
  8. />
  9. <view class="gun"></view>
  10. <text>中国</text>
  11. </view>
  12. <view class="main-top-nav-title">
  13. <uni-icons :type="show ? 'closeempty' : 'bars'" color="#FFF" size="30" @tap="handleShow"/>
  14. </view>
  15. </view>
  16. <view class="panel" :class="{active: show}">
  17. <uni-list>
  18. <uni-list-item class="panel-item" showArrow title="我们的服务" @tap="handleTo('/pagesB/headhunting/pages/service')" />
  19. <uni-list-item class="panel-item" showArrow title="候选人" @tap="handleClick('/pages/index/position')"/>
  20. <uni-list-item class="panel-item" showArrow title="联系我们" />
  21. </uni-list>
  22. </view>
  23. </view>
  24. </template>
  25. <script setup>
  26. import { ref } from 'vue'
  27. const show = ref(false)
  28. const handleShow = () => {
  29. show.value = !show.value
  30. }
  31. const handleClick = (path) => {
  32. uni.switchTab({ url: path })
  33. }
  34. const handleTo = (path) => {
  35. uni.navigateTo({ url: path })
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. $rootColor: #00695c;
  40. .main-top {
  41. position: sticky;
  42. top: 0;
  43. background: $rootColor;
  44. z-index: 999;
  45. &-nav {
  46. display: flex;
  47. justify-content: space-between;
  48. align-items: center;
  49. width: 100%;
  50. height: 120rpx;
  51. padding: 10rpx 20rpx;
  52. box-sizing: border-box;
  53. &-logo {
  54. // width: 300rpx;
  55. height: 100%;
  56. display: flex;
  57. align-items: center;
  58. .gun {
  59. height: 75rpx;
  60. width: 6rpx;
  61. background: #fff;
  62. margin: 0 20rpx;
  63. }
  64. text {
  65. color: #fff;
  66. font-size: 32rpx;
  67. font-weight: 600;
  68. }
  69. image {
  70. width: 180rpx;
  71. height: 75rpx;
  72. // margin-bottom: 12rpx;
  73. }
  74. }
  75. &-title {
  76. height: 100%;
  77. display: flex;
  78. align-items: center;
  79. color: #fff;
  80. }
  81. }
  82. }
  83. .panel {
  84. overflow: hidden;
  85. height: 0;
  86. transition: all 0.3s;
  87. &.active {
  88. height: auto;
  89. }
  90. &-item {
  91. }
  92. }
  93. :deep(.uni-list-item) {
  94. background: #000 !important;
  95. background-color: #000 !important;
  96. }
  97. </style>