Tabbar.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template >
  2. <view>
  3. <u-tabbar v-model="myCurrent" :list="tabbarList"
  4. inactive-color="#A8B0AD"
  5. :before-switch="beforeSwitch" active-color="#009143" :height="elderStatus ? '110rpx' : '100rpx'" :icon-size="elderStatus ? '56rpx' : '40rpx'"></u-tabbar>
  6. </view>
  7. </template>
  8. <script>
  9. var img1=require('@/assets/img/riLine-vip-crown-2-line.svg')
  10. var img2=require('@/assets/img/riFill-vip-crown-2-fill.svg')
  11. var img3=require('@/assets/img/buy/riFill-gift-fill.svg')
  12. var img4=require('@/assets/img/buy/riLine-gift-line.svg')
  13. export default {
  14. name:"tabbarJob",
  15. props:{
  16. current: 0,
  17. elderStatus: false
  18. },
  19. data() {
  20. return {
  21. activeColor:"#5098FF",
  22. oldindex:this.current,
  23. myCurrent:this.current,
  24. tabbarList: [{
  25. iconPath: "home-3-line",
  26. selectedIconPath: "home-3-fill",
  27. text: '主页 ',
  28. count: 0,
  29. isDot: true,
  30. customIcon: true,
  31. pagePath2:"/pages/index/index",
  32. },
  33. {
  34. iconPath: img4,
  35. selectedIconPath: img3,
  36. text: '活动',
  37. midButton: true,
  38. //customIcon: true,
  39. pagePath2:"/pages/index/activity",
  40. },
  41. {
  42. iconPath: "road-map-line",
  43. selectedIconPath: "road-map-fill",
  44. text: '找桩',
  45. midButton: true,
  46. customIcon: true,
  47. pagePath2:"/pages/searchPile/searchPile",
  48. },
  49. {
  50. iconPath: "user-5-line",
  51. selectedIconPath: "user-5-fill",
  52. text: '我的',
  53. count: 0,
  54. isDot: false,
  55. customIcon: true,
  56. pagePath2:"/pages/user/index",
  57. }
  58. ],
  59. };
  60. },methods:{
  61. setcount(c){
  62. this.myCurrent=c
  63. },
  64. beforeSwitch(index){
  65. if(index==this.current){
  66. return false
  67. }
  68. var url =this.tabbarList[index].pagePath2;
  69. uni.navigateTo({
  70. url: url
  71. })
  72. if(index==1){
  73. this.myCurrent=this.oldindex;
  74. return false;
  75. }else{
  76. return true;
  77. }
  78. },
  79. },mounted(){
  80. },destroyed(){
  81. }
  82. }
  83. </script>
  84. <style>
  85. </style>