zx-footer-bar.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="item" :class="[active == 0?'active':'']"
  5. @click="navTo(0,'/saomaDiancan/index/index?type=')">
  6. <image :src="active == 0 ?'/saomaDiancan/static/images/index_act.png':'/saomaDiancan/static/images/index.png'"
  7. mode="aspectFit" class="icon-img"></image>
  8. <text class="title">首页</text>
  9. </view>
  10. <view class="item" :class="[active == 1?'active':'']" @click="navTo(1,'/saomaDiancan/index/index?type=')">
  11. <image :src="active == 1 ?'/saomaDiancan/static/images/icon_20_on.png':'/saomaDiancan/static/images/icon_20.png'" mode="aspectFit" class="icon-img"></image>
  12. <text class="title">门店管理</text>
  13. </view>
  14. <view class="item" :class="[active == 2?'active':'']" @click="navTo(2,'/saomaDiancan/my/my?type=')">
  15. <image :src="active == 2 ?'/saomaDiancan/static/images/icon_21_on.png':'/saomaDiancan/static/images/icon_21.png'" class="icon-img"></image>
  16. <text class="title">个人中心</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. active: {
  25. type: Number,
  26. default: 1
  27. },
  28. type: {
  29. type: Number,
  30. default: 1
  31. },
  32. },
  33. data() {
  34. return {
  35. };
  36. },
  37. methods: {
  38. navTo(index, url) {
  39. console.log("index, url", this.active,index, url)
  40. if (index != this.active) {
  41. uni.redirectTo({
  42. url: url+this.type
  43. })
  44. }
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. .container {
  51. width: 100%;
  52. height: 100rpx;
  53. /*兼容 IOS<11.2*/
  54. padding-bottom: constant(safe-area-inset-bottom);
  55. /*兼容 IOS>11.2*/
  56. padding-bottom: env(safe-area-inset-bottom);
  57. box-sizing: content-box;
  58. }
  59. .content {
  60. background-color: #fff;
  61. width: 100vw;
  62. height: 100rpx;
  63. /*兼容 IOS<11.2*/
  64. padding-bottom: constant(safe-area-inset-bottom);
  65. /*兼容 IOS>11.2*/
  66. padding-bottom: env(safe-area-inset-bottom);
  67. display: flex;
  68. flex-flow: row nowrap;
  69. justify-content: space-around;
  70. align-items: center;
  71. /* box-shadow: 0 20rpx 20rpx #f6f6f6 inset; */
  72. position: fixed;
  73. left: 0;
  74. bottom: 0;
  75. z-index: 900;
  76. box-sizing: content-box;
  77. }
  78. .content .item {
  79. flex: auto;
  80. display: flex;
  81. flex-flow: column nowrap;
  82. justify-content: center;
  83. align-items: center;
  84. }
  85. .content .icon-img {
  86. display: block;
  87. width: 48rpx;
  88. height: 48rpx;
  89. }
  90. .content .title {
  91. font-size: 24rpx;
  92. height: 28rpx;
  93. line-height: 28rpx;
  94. text-align: center;
  95. color: #ABADC2;
  96. }
  97. .content .active .title {
  98. color: #3387FF;
  99. }
  100. </style>