footTabs.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="hover_content" v-show="isShow">
  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:{
  51. selectedIndex: {
  52. type: Number,
  53. default: 0,
  54. },
  55. isShow:{
  56. type:Boolean,
  57. default:true
  58. },
  59. },
  60. data() {
  61. return {
  62. // selectedIndex: 0,
  63. // showselected: false,
  64. menus: [
  65. {
  66. pagePath: "/pages/index/index",
  67. iconPath: "/static/tabbar/home-select.png",
  68. selectedIconPath: "/static/tabbar/home-selected.png",
  69. text: "��ҳ",
  70. },
  71. {
  72. pagePath: "/pages/selfCenter/index",
  73. iconPath: "/static/tabbar/user-select.png",
  74. selectedIconPath: "/static/tabbar/user-selected.png",
  75. text: "�ҵ�",
  76. },
  77. ],
  78. };
  79. },
  80. methods: {
  81. click(index, src) {
  82. // let that = this;
  83. // that.selectedIndex = index
  84. // getApp().globalData.selectedIndex = index
  85. // if (index == 0) {
  86. // that.isSider = false;
  87. // getApp().globalData.isSider = false;
  88. // } else {
  89. // that.isSider = true;
  90. // getApp().globalData.isSider = true;
  91. // }
  92. uni.switchTab({
  93. url:src,
  94. })
  95. // var pages = getCurrentPages();
  96. // uni.navigateTo({
  97. // url: "/" + src,
  98. // // animationType: 'pop-in',
  99. // // animationDuration: 200
  100. // });
  101. // if(pages.length > 9){
  102. // uni.reLaunch({
  103. // url: "/" + src,
  104. // });
  105. // }
  106. },
  107. },
  108. };
  109. </script>