index.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view>
  3. <u-tabbar :value="tabbarValues" @change="name => tabbarValues = name" :fixed="true" :placeholder="true" activeColor="#007A69"
  4. :safeAreaInsetBottom="true" :border="false">
  5. <u-tabbar-item :text="item.text" v-for="(item,index) in list" :key="index"
  6. @click="changeTabbars(item,index)">
  7. <image class="u-page__item__slot-icon" slot="active-icon" :src="item.activeImg"></image>
  8. <image class="u-page__item__slot-icon" slot="inactive-icon" :src="item.inactiveImg"></image>
  9. </u-tabbar-item>
  10. </u-tabbar>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. tabbarid: 0
  17. },
  18. data() {
  19. return {
  20. tabbarValues: 0,
  21. list: [{
  22. activeImg: 'https://i.ringzle.com/file/20240320/eb54f2488b4f45c9929d2fa78b104b80.png',
  23. inactiveImg: 'https://i.ringzle.com/file/20240106/29bd09ef7eb748f1820c335f86f74c61.png',
  24. text: '首页',
  25. paths: '/pagesHouse/home/index'
  26. },
  27. {
  28. activeImg: 'https://i.ringzle.com/file/20240320/df1512af95ff4f639e37b2fa905d7808.png',
  29. inactiveImg: 'https://i.ringzle.com/file/20240320/07590c34e1fc45e2af4786607418039b.png',
  30. text: '扫码核验',
  31. paths: '/pagesHouse/Verification/index'
  32. },
  33. {
  34. activeImg: 'https://i.ringzle.com/file/20240320/319f9665e40b40c7b056e1e50c8e1ce5.png',
  35. inactiveImg: 'https://i.ringzle.com/file/20240320/81146a88ac964a8ab1effff76f44c9d1.png',
  36. text: '我的',
  37. paths: '/pagesHouse/Mine/index'
  38. }
  39. ]
  40. }
  41. },
  42. mounted() {
  43. this.tabbarValues = this.tabbarid;
  44. },
  45. methods: {
  46. changeTabbars(e, i) {
  47. console.log(e, i, '000');
  48. if (i == 1) {
  49. console.log('111111111111111111', )
  50. if (uni.getStorageSync('merchantType') == 4) {
  51. // Verification/ems
  52. uni.navigateTo({
  53. url: "/pagesHouse/Verification/ems"
  54. });
  55. } else {
  56. this.tabbarValues = i;
  57. uni.reLaunch({
  58. url: this.list[i].paths
  59. })
  60. }
  61. } else {
  62. this.tabbarValues = i;
  63. uni.reLaunch({
  64. url: this.list[i].paths
  65. })
  66. }
  67. // this.tabbarValues = i;
  68. // uni.reLaunch({
  69. // url: this.list[i].paths
  70. // })
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="less">
  76. /deep/.u-page__item__slot-icon {
  77. width: 38rpx;
  78. height: 38rpx;
  79. margin: 8rpx 0 4rpx;
  80. }
  81. /deep/.u-tabbar-item__text{
  82. color: #007A69;
  83. }
  84. /deep/.u-tabbar-item {
  85. &:nth-child(2){
  86. .u-page__item__slot-icon,image {
  87. width: 72rpx;
  88. height: 54rpx;
  89. }
  90. }
  91. }
  92. </style>