tabbarNew.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <u-tabbar :value="value" @change="changeTabbar" :fixed="true" :border="false" :placeholder="true"
  3. activeColor="#F59A02" :safeAreaInsetBottom="true">
  4. <u-tabbar-item text="首页" name="home">
  5. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_02.png"></image>
  6. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_01.png">
  7. </image>
  8. </u-tabbar-item>
  9. <u-tabbar-item text="企业信息" name="firm">
  10. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_04.png"></image>
  11. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_03.png">
  12. </image>
  13. </u-tabbar-item>
  14. <u-tabbar-item text="我的" name="my">
  15. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_06.png"></image>
  16. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_05.png">
  17. </image>
  18. </u-tabbar-item>
  19. </u-tabbar>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. value: {
  25. type: String,
  26. default: "home",
  27. },
  28. },
  29. data() {
  30. return {
  31. }
  32. },
  33. methods: {
  34. changeTabbar(name){
  35. switch(name){
  36. case'home':
  37. this.$tab.navigateTo('/pages/home/index')
  38. break;
  39. case'firm':
  40. this.$tab.navigateTo('/pages/center/index')
  41. break;
  42. case'my':
  43. this.$tab.navigateTo('/pages/my/index')
  44. break;
  45. }
  46. console.log(name,'name');
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. /deep/ .u-tabbar__content {
  53. background-image: url('@/static/images/nav_bg.png');
  54. background-size: 100% 100%;
  55. }
  56. /deep/ .u-tabbar-item {
  57. height: 70px;
  58. }
  59. /deep/ .u-tabbar__content[data-v-542a922e] {
  60. background-color: transparent;
  61. }
  62. /deep/ .u-tabbar__content {
  63. height: 60px;
  64. }
  65. .u-page__item__slot-icon {
  66. width: 32px;
  67. height: 32px;
  68. }
  69. /deep/ .u-tabbar-item__text {
  70. font-size: 11px;
  71. font-weight: 400;
  72. color: #4A5D94;
  73. }
  74. </style>