seiminFooterNav.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="seiminFooterNav">
  3. <view class="seiminFooterNav_item" :class="{otherStyle:menu.otherStyle,active:menu.otherStyle?false:menu.active}"
  4. v-for="menu in menus" :key="menu.link">
  5. <text class="pda seiminFooterNav_item_icon" :class="menu.icon"></text>
  6. <text class="seiminFooterNav_item_text">{{menu.name}}</text>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import {
  12. getCurrentPagesSeimin
  13. } from '../../utils/index.js';
  14. export default {
  15. name: "seiminFooterNav",
  16. data() {
  17. return {
  18. // 当前路由地址
  19. curRoute: '',
  20. //底部菜单
  21. menus: [{
  22. name: '首页',
  23. link: '/pages/index/index',
  24. icon: 'pda-shouye2',
  25. otherStyle: false,
  26. active: false,
  27. },
  28. {
  29. name: '工单',
  30. link: '/pages/orders/orders',
  31. icon: 'pda-gongdan',
  32. otherStyle: false,
  33. active: false,
  34. },
  35. {
  36. name: '二维码',
  37. link: '/pages/qrcode/qrcode',
  38. icon: 'pda-ziyuan91',
  39. otherStyle: true,
  40. active: false,
  41. },
  42. {
  43. name: '患者',
  44. link: '/pages/patients/patients',
  45. icon: 'pda-wodehuanzhe',
  46. otherStyle: false,
  47. active: false,
  48. },
  49. {
  50. name: '我的',
  51. link: '/pages/personalCenter/personalCenter',
  52. icon: 'pda-shouye3',
  53. otherStyle: false,
  54. active: false,
  55. }
  56. ]
  57. };
  58. },
  59. methods: {
  60. // 高亮当前菜单
  61. activeCurrentMenu() {
  62. this.curRoute = `/${getCurrentPagesSeimin()}`;
  63. this.menus.forEach(v => v.active = v.link === this.curRoute);
  64. }
  65. },
  66. mounted() {
  67. this.activeCurrentMenu();
  68. },
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .seiminFooterNav {
  73. position: fixed;
  74. left: 0;
  75. bottom: 0;
  76. width: 100%;
  77. height: 100rpx;
  78. z-index: 9;
  79. background-color: #fff;
  80. border-top: 1px solid rgba(0, 0, 0, 0.1);
  81. padding: 0 60rpx;
  82. @include flex(space-between, center);
  83. .seiminFooterNav_item {
  84. color: #DDE1E5;
  85. @include flex(center, center, column);
  86. &.otherStyle {
  87. width: 120rpx;
  88. height: 120rpx;
  89. background: linear-gradient(180deg, #74C271 0%, #39B199 100%);
  90. border-radius: 50%;
  91. position: relative;
  92. top: -10rpx;
  93. color: #fff;
  94. }
  95. &.active {
  96. color: $defaultColor;
  97. }
  98. .seiminFooterNav_item_icon {
  99. font-size: 50rpx;
  100. }
  101. .seiminFooterNav_item_text {
  102. font-size: 28rpx;
  103. }
  104. }
  105. }
  106. </style>