App.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. // this.init()
  5. console.log('App Launch')
  6. },
  7. onShow: function() {
  8. this.init()
  9. console.log('App Show')
  10. },
  11. onLoad() {
  12. this.init()
  13. },
  14. onHide: function() {
  15. console.log('App Hide')
  16. },
  17. methods: {
  18. init() {
  19. let state = this.$store.state.admin
  20. // console.log(state, 778)
  21. if (state == 0) {
  22. uni.setTabBarItem({
  23. index: 0,
  24. pagePath: "pages/index/index",
  25. text: "合同列表",
  26. iconPath: "/static/icon/home.png",
  27. selectedIconPath: "/static/icon/achome.png",
  28. visible: true
  29. })
  30. uni.setTabBarItem({
  31. index: 1,
  32. pagePath: "pages/acceptor/acceptor",
  33. text: "承兑人",
  34. iconPath: "/static/icon/per.png",
  35. selectedIconPath: "/static/icon/out.png",
  36. })
  37. uni.setTabBarItem({
  38. index: 2,
  39. pagePath: "pages/drawer/drawer",
  40. text: "出票人",
  41. iconPath: "/static/icon/acsip.png",
  42. selectedIconPath: "/static/icon/biao.png",
  43. visible: true
  44. })
  45. uni.setTabBarItem({
  46. index: 3,
  47. pagePath: "pages/supplier/supplier",
  48. text: "供应商",
  49. iconPath: "/static/icon/acsup.png",
  50. selectedIconPath: "/static/icon/sup.png",
  51. visible: false
  52. })
  53. uni.setTabBarItem({
  54. index: 4,
  55. pagePath: "pages/mine/mine",
  56. text: "我的",
  57. iconPath: "/static/icon/my.png",
  58. selectedIconPath: "/static/icon/acmy.png",
  59. visible: false
  60. })
  61. } else if (state == 1) {
  62. uni.setTabBarItem({
  63. index: 0,
  64. pagePath: "pages/index/index",
  65. text: "合同列表",
  66. iconPath: "/static/icon/home.png",
  67. selectedIconPath: "/static/icon/achome.png",
  68. visible: true
  69. })
  70. uni.setTabBarItem({
  71. index: 1,
  72. pagePath: "pages/acceptor/acceptor",
  73. text: "承兑人",
  74. iconPath: "/static/icon/card-2x.png",
  75. selectedIconPath: "/static/icon/card_active-2x.png",
  76. visible:false
  77. })
  78. uni.setTabBarItem({
  79. index: 2,
  80. pagePath: "pages/drawer/drawer",
  81. text: "出票人",
  82. iconPath: "/static/icon/counter-2x.png",
  83. selectedIconPath: "/static/icon/counter_active-2x.png",
  84. visible:false
  85. })
  86. uni.setTabBarItem({
  87. index: 3,
  88. pagePath: "pages/supplier/supplier",
  89. text: "供应商",
  90. iconPath: "/static/icon/record-2x.png",
  91. selectedIconPath: "/static/icon/record_active-2x.png",
  92. visible:false
  93. })
  94. uni.setTabBarItem({
  95. index:4,
  96. pagePath: "pages/mine/mine",
  97. text: "我的",
  98. iconPath: "/static/icon/my.png",
  99. selectedIconPath: "/static/icon/acmy.png",
  100. visible: true
  101. })
  102. }
  103. },
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. page {
  109. color: #1F242A;
  110. }
  111. @import 'uview-ui/theme.scss';
  112. @import "@/static/css/flex.scss";
  113. page {
  114. font-family: Source Han Sans CN-Medium;
  115. }
  116. .safebt{
  117. padding-bottom: 150rpx;
  118. }
  119. .statues_bar {
  120. height: var(--status-bar-height);
  121. width: 100%;
  122. }
  123. </style>