footer.vue 1.4 KB

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