Tabbar.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template >
  2. <view>
  3. <u-tabbar v-model="myCurrent" :list="tabbarList"
  4. :before-switch="beforeSwitch" active-color="#2795FD" inactive-color="#B3BED1" ></u-tabbar>
  5. </view>
  6. </template>
  7. <script>
  8. var img1=require('@/components/home-3-line.png')
  9. var img2=require('@/components/home-3-fill.png')
  10. var img3=require('@/components/todo-line.png')
  11. var img4=require('@/components/todo-fill.png')
  12. var img5=require('@/components/add-circle-line.png')
  13. var img6=require('@/components/add-circle-fill.png')
  14. var img7=require('@/components/user-search-line.png')
  15. var img8=require('@/components/user-search-fill.png')
  16. var img9=require('@/components/user-4-line.png')
  17. var img10=require('@/components/user-4-fill.png')
  18. export default {
  19. name:"tabbarJob",
  20. props:{
  21. current: 0,
  22. elderStatus: false
  23. },
  24. data() {
  25. return {
  26. activeColor:"#1F4A99",
  27. oldindex:this.current,
  28. myCurrent:this.current,
  29. tabbarList: [
  30. {
  31. iconPath: img1,
  32. selectedIconPath: img2,
  33. text: '主页 ',
  34. pagePath2:"/",
  35. login:false,
  36. },
  37. {
  38. iconPath: img3,
  39. selectedIconPath: img4,
  40. text: '招工 ',
  41. pagePath2:"/pages/jobInformation/jobInformation",
  42. login:false,
  43. },
  44. {
  45. iconPath: img5,
  46. selectedIconPath: img6,
  47. text: '发布 ',
  48. pagePath2:"/pages/issue/issue",
  49. login:false,
  50. },
  51. {
  52. iconPath: img7,
  53. selectedIconPath: img8,
  54. text: '找人 ',
  55. pagePath2:"/pages/choreInformation/choreInformation",
  56. login:false,
  57. },
  58. {
  59. iconPath:img9,
  60. selectedIconPath: img10,
  61. text: '我的',
  62. login:false,
  63. pagePath2:"/pages/mine/mine",
  64. }
  65. ],
  66. };
  67. },methods:{
  68. setcount(c){
  69. //this.myCurrent=c
  70. },
  71. beforeSwitch(index){
  72. var bl=false
  73. if(index==this.current){
  74. return false
  75. }
  76. //this.myCurrent=index
  77. var url =this.tabbarList[index].pagePath2;
  78. if(this.tabbarList[index].login){
  79. var userInfo=this.carhelp.getPersonInfo()
  80. if(userInfo){
  81. }else{
  82. url="/pages/login/index"
  83. bl=true
  84. }
  85. }
  86. uni.navigateTo({
  87. url: url
  88. })
  89. },
  90. },
  91. mounted(){
  92. },destroyed(){
  93. }
  94. }
  95. </script>
  96. <style>
  97. </style>