footer.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="footer d-flex p-y-xs2 bg-tab-nav fn-center"
  3. ><!-- p-y-xs -->
  4. <view
  5. class="item line-height-1 flex-fill"
  6. :class="{ 'router-link-active': tab == item.tel }"
  7. v-for="item in navList"
  8. :key="item.tel"
  9. @click="tabChange(item.tel)"
  10. >
  11. <view class="icon">
  12. <img
  13. class="h-15"
  14. v-if="tab == item.tel"
  15. :src="item.activeIcon"
  16. alt=""
  17. />
  18. <img class="h-15" v-else :src="item.icon" alt="" />
  19. </view>
  20. <view class="fn-12" style="margin-top: 4px">{{ $t(item.label) }}</view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { navList } from "./list.js";
  26. export default {
  27. props: {
  28. tab: {
  29. type: String,
  30. default: "home",
  31. },
  32. },
  33. data() {
  34. return {
  35. navList: navList(this),
  36. };
  37. },
  38. methods: {
  39. tabChange(v) {
  40. uni.switchTab({
  41. url: "/pages/base/" + v,
  42. });
  43. // console.log(v);
  44. // console.log(this.$router);
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .p-y-xs2 {
  51. padding-top: 25rpx !important;
  52. padding-bottom: 30rpx !important;
  53. }
  54. .footer {
  55. box-shadow: $tab-nav-shadow;
  56. position: fixed;
  57. bottom: 0;
  58. width: 100%;
  59. z-index: 999 !important;
  60. height: 65rpx;
  61. // color: rgba(#fff, 0.3);
  62. }
  63. .router-link-active {
  64. color: $theme-1;
  65. // color: var(--tab-nav-active);
  66. }
  67. .bg-tab-nav{
  68. // background-color: #31313f;
  69. }
  70. </style>