TabbarFinance.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template >
  2. <view>
  3. <u-tabbar v-model="myCurrent" :list="tabbarList"
  4. :before-switch="beforeSwitch"
  5. active-color="#1677ff"></u-tabbar>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name:"tabbarJob",
  11. props:{
  12. current: 0
  13. },
  14. data() {
  15. return {
  16. activeColor:"#5098FF",
  17. oldindex:this.current,
  18. myCurrent:this.current,
  19. tabbarList: [{
  20. iconPath: "bar-chart-box-fill",
  21. selectedIconPath: "bar-chart-box-fill",
  22. text: '统计',
  23. count: 0,
  24. isDot: true,
  25. customIcon: true,
  26. pagePath2:"/pagesFinance/statistics/index",
  27. },
  28. {
  29. iconPath: "article-fill",
  30. selectedIconPath: "article-fill",
  31. text: '明细',
  32. midButton: true,
  33. customIcon: true,
  34. pagePath2:"/pagesFinance/detailed/index",
  35. },
  36. {
  37. iconPath: "money-cny-box-fill",
  38. selectedIconPath: "money-cny-box-fill",
  39. text: '分润',
  40. midButton: true,
  41. customIcon: true,
  42. pagePath2:"/pagesFinance/share/index",
  43. },
  44. {
  45. iconPath: "account-pin-box-fill",
  46. selectedIconPath: "account-pin-box-fill",
  47. text: '我的',
  48. count: 0,
  49. isDot: false,
  50. customIcon: true,
  51. pagePath2:"/pagesFinance/user/index",
  52. }
  53. ],
  54. };
  55. },methods:{
  56. setcount(c){
  57. this.myCurrent=c
  58. },
  59. beforeSwitch(index){
  60. if(index==this.current){
  61. return false
  62. }
  63. var url =this.tabbarList[index].pagePath2;
  64. uni.navigateTo({
  65. url: url
  66. })
  67. if(index==1){
  68. this.myCurrent=this.oldindex;
  69. return false;
  70. }else{
  71. return true;
  72. }
  73. },
  74. },mounted(){
  75. },destroyed(){
  76. }
  77. }
  78. </script>
  79. <style>
  80. </style>