footTabs.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="hover_content">
  3. <div class="hover_menu flex">
  4. <div
  5. class="menu_icon"
  6. v-for="(menu, i) in menus"
  7. :key="i"
  8. @tap="click(i, menu.pagePath)"
  9. >
  10. <!-- <uni-transition mode-class="fade" show="true" v-if="selectedIndex == i"> -->
  11. <!-- <img :src="menu.selectedIconPath" /> -->
  12. <image class="tabbar-list-li-icon-image" :src="selectedIndex == i ? menu.selectedIconPath : menu.iconPath" mode=""></image>
  13. <!-- </uni-transition> -->
  14. <!-- <uni-transition mode-class="fade" show="true" v-else>
  15. <img :src="menu.iconPath" />
  16. </uni-transition> -->
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <style lang="scss" scoped>
  22. .hover_content {
  23. z-index: 999;
  24. width: 30%;
  25. padding: 1.5% 1%;
  26. border-radius: 100rpx;
  27. position: fixed;
  28. left: 50%;
  29. top: 90%;
  30. transform: translateX(-50%);
  31. box-shadow: rgba(100, 100, 111, 0.2) 0rpx 7rpx 29rpx 0rpx;
  32. background-color: #fff;
  33. .hover_menu {
  34. display: flex;
  35. justify-content: space-around;
  36. margin-top: 10rpx;
  37. .menu_icon {
  38. transition: all 0.5s;
  39. image {
  40. width: 60rpx;
  41. height: 60rpx;
  42. border-radius: 100rpx;
  43. }
  44. }
  45. }
  46. }
  47. </style>
  48. <script>
  49. export default {
  50. props: ['selectedIndex'],
  51. data() {
  52. return {
  53. // selectedIndex: 0,
  54. // showselected: false,
  55. menus: [
  56. {
  57. pagePath: "/pages/index/index",
  58. iconPath: "/static/tabbar/home-select.png",
  59. selectedIconPath: "/static/tabbar/home-selected.png",
  60. text: "Ê×Ò³",
  61. },
  62. {
  63. pagePath: "/pages/selfCenter/index",
  64. iconPath: "/static/tabbar/user-select.png",
  65. selectedIconPath: "/static/tabbar/user-selected.png",
  66. text: "ÎÒµÄ",
  67. },
  68. ],
  69. };
  70. },
  71. methods: {
  72. click(index, src) {
  73. // let that = this;
  74. // that.selectedIndex = index
  75. // getApp().globalData.selectedIndex = index
  76. // if (index == 0) {
  77. // that.isSider = false;
  78. // getApp().globalData.isSider = false;
  79. // } else {
  80. // that.isSider = true;
  81. // getApp().globalData.isSider = true;
  82. // }
  83. uni.switchTab({
  84. url:src,
  85. })
  86. // var pages = getCurrentPages();
  87. // uni.navigateTo({
  88. // url: "/" + src,
  89. // // animationType: 'pop-in',
  90. // // animationDuration: 200
  91. // });
  92. // if(pages.length > 9){
  93. // uni.reLaunch({
  94. // url: "/" + src,
  95. // });
  96. // }
  97. },
  98. },
  99. };
  100. </script>