index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <oa-top-dropdown
  3. tui-top-dropdown="tui-top-dropdown"
  4. bgcolor="rgba(76, 76, 76, 0.95)"
  5. :show="popupShow"
  6. :height="0"
  7. @close="hide"
  8. >
  9. <view class="tui-menu-box tui-padding tui-ptop">
  10. <view class="tui-menu-header" :style="{ paddingTop: top + 'px' }">
  11. 功能直达
  12. </view>
  13. <view class="tui-menu-itembox">
  14. <block v-for="(item, index) in topMenu" :key="index">
  15. <view
  16. class="tui-menu-item"
  17. hover-class="tui-opcity"
  18. :hover-stay-time="150"
  19. @tap="navTo(item)"
  20. >
  21. <view class="tui-badge-box">
  22. <text class="iconfont" :class="item.icon"></text>
  23. </view>
  24. <view class="tui-menu-text">{{ item.text }}</view>
  25. </view>
  26. </block>
  27. </view>
  28. <text @tap.stop="hide" class="iconfont iconxiangxiajiantou"></text>
  29. </view>
  30. </oa-top-dropdown>
  31. </template>
  32. <script>
  33. import rfTopDropdown from '@/components/oa-top-dropdown';
  34. export default {
  35. name: 'rfNavDetail',
  36. components: { rfTopDropdown },
  37. props: {
  38. popupShow: {
  39. type: Boolean,
  40. detault: true
  41. }
  42. },
  43. data() {
  44. return {
  45. top: this.CustomBar,
  46. topMenu: this.$mConstDataConfig.menuTop
  47. };
  48. },
  49. methods: {
  50. hide() {
  51. this.$emit('hide');
  52. },
  53. navTo(item) {
  54. this.$emit('hide');
  55. if (!item.url) return;
  56. if (!this.$mStore.getters.hasLogin && !item.urlType) {
  57. this.$mHelper.backToLogin();
  58. return;
  59. }
  60. if (item.urlType === 'tab') {
  61. this.$mRouter.switchTab({ route: item.url });
  62. } else {
  63. this.$mRouter.push({ route: item.url });
  64. }
  65. }
  66. }
  67. };
  68. </script>
  69. <style scoped lang="scss">
  70. /*顶部菜单*/
  71. .tui-menu-box {
  72. box-sizing: border-box;
  73. }
  74. .tui-menu-header {
  75. font-size: 34rpx;
  76. color: #fff;
  77. height: 32px;
  78. margin-top: 45upx;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. }
  83. .tui-top-dropdown {
  84. z-index: 9999 !important;
  85. }
  86. .tui-menu-itembox {
  87. color: #fff;
  88. padding: 40rpx 10rpx 0 10rpx;
  89. box-sizing: border-box;
  90. display: flex;
  91. flex-wrap: wrap;
  92. font-size: 26rpx;
  93. }
  94. .tui-menu-item {
  95. width: 22%;
  96. height: 160rpx;
  97. border-radius: 24rpx;
  98. display: flex;
  99. align-items: center;
  100. flex-direction: column;
  101. justify-content: center;
  102. background: rgba(0, 0, 0, 0.4);
  103. margin-right: 4%;
  104. margin-bottom: 4%;
  105. }
  106. .tui-menu-item:nth-of-type(4n) {
  107. margin-right: 0;
  108. }
  109. .tui-badge-box {
  110. position: relative;
  111. .iconfont {
  112. font-size: 40upx;
  113. }
  114. }
  115. .tui-badge-box .tui-badge-class {
  116. position: absolute;
  117. top: -8px;
  118. right: -8px;
  119. }
  120. .tui-msg-badge {
  121. top: -10px;
  122. }
  123. .tui-icon-up {
  124. position: relative;
  125. display: inline-block;
  126. left: 50%;
  127. transform: translateX(-50%);
  128. }
  129. .tui-menu-text {
  130. padding-top: 12rpx;
  131. }
  132. .tui-opcity .tui-menu-text,
  133. .tui-opcity .tui-badge-box {
  134. opacity: 0.5;
  135. transition: opacity 0.2s ease-in-out;
  136. }
  137. .iconxiangxiajiantou {
  138. display: flex;
  139. justify-content: center;
  140. }
  141. /*顶部菜单*/
  142. </style>