特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="">
  3. <view class="tabbar-box"></view>
  4. <view class="tabbar">
  5. <view
  6. :class="{item : true, active : select == index}"
  7. v-for="(item, index) in list"
  8. :key="index"
  9. v-if="!item.isNotShop || !userShop"
  10. @click="toPath(item, index)">
  11. <view class="icon">
  12. <image :src="select == index ?
  13. item.selectedIconPath :
  14. item.iconPath" class="icon-image" mode=""></image>
  15. </view>
  16. <view class="title">
  17. {{ item.title }}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { mapGetters } from 'vuex'
  25. export default {
  26. name:"tabbar",
  27. props : ['select'],
  28. computed : {
  29. ...mapGetters(['userShop']),
  30. },
  31. data() {
  32. return {
  33. list : [
  34. {
  35. "selectedIconPath": "/static/image/tabbar/home-a.png",
  36. "iconPath": "/static/image/tabbar/home.png",
  37. "pagePath": "/pages/index/index",
  38. "title": "找工作"
  39. },
  40. {
  41. "selectedIconPath": "/static/image/tabbar/order-a.png",
  42. "iconPath": "/static/image/tabbar/order.png",
  43. "pagePath": "/pages/index/keepAccounts",
  44. "title": "记工记账"
  45. },
  46. {
  47. "selectedIconPath": "/static/image/tabbar/order-a.png",
  48. "iconPath": "/static/image/tabbar/order.png",
  49. "pagePath": "/pages/index/consult",
  50. "title": "考证咨询",
  51. },
  52. {
  53. "selectedIconPath": "/static/image/tabbar/center-a.png",
  54. "iconPath": "/static/image/tabbar/center.png",
  55. "pagePath": "/pages/index/center",
  56. "title": "会员中心"
  57. }
  58. ]
  59. };
  60. },
  61. methods : {
  62. toPath(item, index){
  63. if(index == this.select){
  64. return
  65. }
  66. uni.redirectTo({
  67. url: item.pagePath
  68. })
  69. },
  70. }
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .tabbar-box{
  75. height: 120rpx;
  76. padding-bottom: env(safe-area-inset-bottom);
  77. }
  78. .tabbar{
  79. position: fixed;
  80. width: 750rpx;
  81. background-color: #fff;
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. flex-direction: row;
  86. height: 120rpx;
  87. padding-bottom: env(safe-area-inset-bottom);
  88. z-index: 999999;
  89. bottom: 0;
  90. left: 0;
  91. color: #BCBCBC;
  92. .item{
  93. flex: 1;
  94. display: flex;
  95. flex-direction: column;
  96. justify-content: center;
  97. align-items: center;
  98. .icon{
  99. width: 54rpx;
  100. height: 54rpx;
  101. .icon-image{
  102. width: 54rpx;
  103. height: 54rpx;
  104. }
  105. }
  106. .title{
  107. overflow: hidden;
  108. white-space: nowrap;
  109. text-overflow: ellipsis;
  110. -o-text-overflow: ellipsis;
  111. font-size: 23rpx;
  112. line-height: 35rpx;
  113. }
  114. }
  115. }
  116. .active{
  117. color: $uni-color !important;
  118. }
  119. </style>