en-tab.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="tab-box">
  3. <view class="tab-item " :class="{'tab-check':tabIndex===1}" @click="setTab(1)">
  4. <view class="tab-content">
  5. <image v-if="tabIndex===1" class="tab-img" src="/static/img/tabBar/home-select.png"></image>
  6. <image v-else class="tab-img" src="/static/img/tabBar/home-default.png"></image>
  7. <view class="tab-text sys-size-24 text-color-dominant">工作台</view>
  8. </view>
  9. </view>
  10. <view class="tab-item" :class="{'tab-check':tabIndex===2}" @click="setTab(2)">
  11. <view class="tab-content">
  12. <image v-if="tabIndex===2" class="tab-img" src="/static/img/tabBar/task-select.png"></image>
  13. <image v-else class="tab-img" src="/static/img/tabBar/task-default.png"></image>
  14. <view class="tab-text sys-size-24 text-color-dominant">任务</view>
  15. </view>
  16. </view>
  17. <view class="tab-item" :class="{'tab-check':tabIndex===3}" @click="setTab(3)">
  18. <view class="tab-content">
  19. <image v-if="tabIndex===3" class="tab-img" src="/static/img/tabBar/loan-select.png"></image>
  20. <image v-else class="tab-img" src="/static/img/tabBar/loan-default.png"></image>
  21. <view class="tab-text sys-size-24 text-color-dominant ">贷后</view>
  22. </view>
  23. </view>
  24. <view class="tab-item" :class="{'tab-check':tabIndex===4}" @click="setTab(3)">
  25. <view class="tab-content">
  26. <image v-if="tabIndex===4" class="tab-img" src="/static/img/tabBar/statistics-select.png"></image>
  27. <image v-else class="tab-img" src="/static/img/tabBar/statistics-default.png"></image>
  28. <view class="tab-text sys-size-24 text-color-dominant ">统计</view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. name:'en-tab',
  36. props:{
  37. 'tabIndex':{
  38. default:1
  39. }
  40. },
  41. data() {
  42. return {};
  43. },
  44. methods: {
  45. setTab(tabIndex){
  46. if(this.tabIndex!==tabIndex){
  47. }
  48. }
  49. },
  50. }
  51. </script>
  52. <style lang="scss">
  53. .tab-box{
  54. display: flex;
  55. justify-content: space-between;
  56. height: 120rpx;
  57. padding-bottom: 14rpx;
  58. .tab-item{
  59. width: 25%;
  60. display: flex;
  61. justify-content: center;
  62. .tab-content{
  63. padding-top: 25rpx;
  64. width: 108rpx;
  65. height: 130rpx;
  66. box-sizing: border-box;
  67. border-radius: 0 0 100rpx 100rpx;
  68. text-align: center;
  69. .tab-img{
  70. width: 42rpx;
  71. height: 42rpx;
  72. }
  73. .tab-text{
  74. font-weight: 400;
  75. line-height: 34rpx;
  76. color: #333333;
  77. }
  78. }
  79. }
  80. .tab-check{
  81. .tab-content{
  82. background-color: rgba(15, 177, 128, 0.1);
  83. .tab-text{
  84. font-weight: 500;
  85. color:#0FB180;
  86. }
  87. }
  88. }
  89. }
  90. </style>