index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view>
  3. <u-tabbar :value="tabbarValues" @change="name => tabbarValues = name" :fixed="true" :placeholder="true"
  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/20240106/57895bbc5414416ea5de2a537ed23dc3.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/20240106/584d0a4108c44fa5bc566d0d0082e07d.png',
  29. inactiveImg: 'https://i.ringzle.com/file/20240106/9561cd3843694891998a34ed41be0ec8.png',
  30. text: '扫码核验',
  31. paths: '/pagesHouse/Verification/index'
  32. },
  33. {
  34. activeImg: 'https://i.ringzle.com/file/20240106/daf6362d4d6745c29501cf30a4d99bc2.png',
  35. inactiveImg: 'https://i.ringzle.com/file/20240106/8c1f9fc0b5604ef7b966d98f2ffb1d2e.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: 40rpx;
  78. height: 40rpx;
  79. margin: 8rpx 0 4rpx;
  80. }
  81. </style>