tabNav.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <!-- 企业温馨导航 -->
  3. <view class="tab_nav">
  4. <view class="tab_list acea-row row-between">
  5. <view class="tab_nav_item acea-row row-center row-column row-middle"
  6. :class="active == 0 ? 'on' : ''" @click="switchTab(0)">
  7. <text class="iconfont" :class="active == 0 ? 'icon-kehu-xuanzhong' : 'icon-kehu'" ></text>
  8. <span>客户</span>
  9. </view>
  10. <view class="tab_nav_item acea-row row-center row-column row-middle"
  11. :class="active == 1 ? 'on' : ''" @click="switchTab(1)">
  12. <text class="iconfont " :class="active == 1 ? 'icon-dingdan-xuanzhong' : 'icon-dingdan1'"></text>
  13. <span>订单</span>
  14. </view>
  15. <view class="tab_nav_item acea-row row-center row-column row-middle"
  16. :class="active == 2 ? 'on' : ''" @click="switchTab(2)">
  17. <text class="iconfont" :class="active == 2 ? 'icon-zuji-xuanzhong' : 'icon-zuji'"></text>
  18. <span>足迹</span>
  19. </view>
  20. <slot name="bottom"></slot>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default{
  26. data() {
  27. return {
  28. active1:this.active
  29. }
  30. },
  31. props:{
  32. active:{
  33. type:Number,
  34. default:0
  35. }
  36. },
  37. methods:{
  38. switchTab(index){
  39. // this.active = index;
  40. let userid = this.$Cache.get('work_user_id')
  41. if(index == 0){
  42. uni.reLaunch({
  43. url:'/pages/work/userInfo/index?userid=' + userid
  44. })
  45. }else if(index == 1){
  46. uni.reLaunch({
  47. url:'/pages/work/orderList/index'
  48. })
  49. }else if(index == 2){
  50. uni.reLaunch({
  51. url:'/pages/work/record/index'
  52. })
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .tab_nav{
  60. width: 100%;
  61. position: fixed;
  62. bottom: 0;
  63. left: 0;
  64. }
  65. .tab_nav_item{
  66. width: 33.3%;
  67. height: 100rpx;
  68. background: #fff;
  69. .title{
  70. color: #1A1A1A;
  71. font-size: 24rpx;
  72. }
  73. .iconfont{
  74. font-size: 36rpx;
  75. }
  76. }
  77. .icon-kehu-xuanzhong,.icon-dingdan-xuanzhong,.icon-jilu-xuanzhong{
  78. color: #1890FF;
  79. }
  80. .on{
  81. color: #1890FF;
  82. }
  83. </style>