tabNav.vue 2.0 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. padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
  65. padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
  66. }
  67. .tab_nav_item{
  68. width: 33.3%;
  69. height: 100rpx;
  70. background: #fff;
  71. .title{
  72. color: #1A1A1A;
  73. font-size: 24rpx;
  74. }
  75. .iconfont{
  76. font-size: 36rpx;
  77. }
  78. }
  79. .icon-kehu-xuanzhong,.icon-dingdan-xuanzhong,.icon-jilu-xuanzhong{
  80. color: #1890FF;
  81. }
  82. .on{
  83. color: #1890FF;
  84. }
  85. </style>