footTabs.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="hover_content">
  3. <view class="hover_menu flex">
  4. <div class="sider" :class="isSider ? 'hoverd' : 'hover'"></div>
  5. <view
  6. class="menu_icon"
  7. v-for="(menu, i) in menus"
  8. :key="i"
  9. @tap="click(i, menu.pagePath)"
  10. >
  11. <view class="iconBox">
  12. <span class="iconfont" :class="[menu.icon, selectedIndex == i? '' : 'hover']"></span>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <style scoped src="../../static/iconfont.css">
  19. </style>
  20. <style lang="scss" scoped>
  21. .hover_content {
  22. z-index: 999;
  23. width: 30%;
  24. padding: 1.5% 1%;
  25. border-radius: 100rpx;
  26. position: fixed;
  27. left: 50%;
  28. top: 90%;
  29. transform: translateX(-50%);
  30. box-shadow: rgba(100, 100, 111, 0.2) 0rpx 7rpx 29rpx 0rpx;
  31. background-color: #fff;
  32. .hover_menu {
  33. display: flex;
  34. justify-content: space-around;
  35. align-items: center;
  36. margin-top: 10rpx;
  37. .sider {
  38. position: absolute;
  39. width: 60rpx;
  40. height: 60rpx;
  41. border-radius: 50%;
  42. left: 14%;
  43. transition: all 0.3s;
  44. background: rgb(14, 92, 246);
  45. &.hover {
  46. left: 14%;
  47. background: rgb(14, 92, 246);
  48. }
  49. &.hoverd {
  50. left: 61%;
  51. }
  52. }
  53. .menu_icon {
  54. position: relative;
  55. .iconBox {
  56. width: 60rpx;
  57. height: 60rpx;
  58. border-radius: 50%;
  59. display: flex;
  60. justify-content: center;
  61. align-items: center;
  62. .iconfont {
  63. z-index: 999;
  64. color: #fff;
  65. font-size: 30rpx;
  66. font-family: "iconfont" !important;
  67. -webkit-font-smoothing: antialiased;
  68. -moz-osx-font-smoothing: grayscale;
  69. &.hover{
  70. color: rgb(187, 187, 187);
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. </style>
  78. <script>
  79. export default {
  80. data() {
  81. return {
  82. selectedIndex: getApp().globalData.selectedIndex,
  83. showselected: false,
  84. isSider: getApp().globalData.isSider,
  85. menus: [
  86. {
  87. pagePath: "pages/index/index",
  88. icon: "icon-zhuye",
  89. text: "首页",
  90. },
  91. {
  92. pagePath: "pages/selfCenter/index",
  93. icon: "icon-geren",
  94. text: "我的",
  95. },
  96. ],
  97. };
  98. },
  99. methods: {
  100. click(index, src) {
  101. if (index == 0) {
  102. this.isSider = false;
  103. getApp().globalData.isSider = false
  104. } else {
  105. this.isSider = true;
  106. getApp().globalData.isSider = true
  107. }
  108. uni.navigateTo({
  109. url: "/" + src,
  110. });
  111. },
  112. },
  113. };
  114. </script>