box.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="container">
  3. <!-- 首页 -->
  4. <Home v-if="show === 'home'" />
  5. <!-- 工单管理 -->
  6. <Management v-if="show === 'management'" />
  7. <!-- 接单池 -->
  8. <Order v-if="show === 'order'" />
  9. <!-- 通讯录 -->
  10. <AddressBook v-if="show === 'addressBook'" />
  11. <!-- 待分配单 -->
  12. <WaitAllot v-if="show === 'waitAllot'" />
  13. <!-- 待处理池 -->
  14. <Pending v-if="show === 'pending'" />
  15. <!-- 报修 -->
  16. <Repairs v-if="show === 'repairs'" />
  17. <!-- 我的报修 -->
  18. <MyRepairs v-if="show === 'myRepairs'" />
  19. <!-- 底部导航栏 -->
  20. <Tabbar :list="list" @changeRouter="handleChangeRouter" />
  21. </view>
  22. </template>
  23. <script>
  24. import Home from '../home/home.vue'
  25. import Management from '../management/management.vue'
  26. import Order from '../order/order.vue'
  27. import AddressBook from '../addressBook/addressBook.vue'
  28. import WaitAllot from '../waitAllot/waitAllot.vue'
  29. import Pending from '../pending/pending.vue'
  30. import Repairs from '../repairs/repairs.vue'
  31. import MyRepairs from '../myRepairs/myRepairs.vue'
  32. import Tabbar from '../components/tabbar.vue'
  33. export default {
  34. components: {
  35. Home,
  36. Management,
  37. Order,
  38. AddressBook,
  39. WaitAllot,
  40. Pending,
  41. Repairs,
  42. MyRepairs,
  43. Tabbar
  44. },
  45. mounted() {
  46. this.list = this.workerList
  47. this.show = this.list[0].show
  48. uni.setNavigationBarTitle({
  49. title: this.list[0].text
  50. })
  51. },
  52. data() {
  53. return {
  54. list: [],
  55. show: 'home',
  56. // 用户路由
  57. userList: [
  58. {
  59. text: '报修',
  60. imgUrl: '../../static/images/repairsImg/repairs.png',
  61. imgUrlActive: '../../static/images/repairsImg/repairs-active.png',
  62. show: 'repairs'
  63. },
  64. {
  65. text: '我的报修',
  66. imgUrl: '../../static/images/repairsImg/myRepairs.png',
  67. imgUrlActive: '../../static/images/repairsImg/myRepairs-active.png',
  68. show: 'myRepairs'
  69. }
  70. ],
  71. // 师傅路由
  72. workerList: [
  73. {
  74. text: '首页',
  75. imgUrl: '../../static/images/repairsImg/home.png',
  76. imgUrlActive: '../../static/images/repairsImg/home-active.png',
  77. show: 'home'
  78. },
  79. {
  80. text: '工单管理',
  81. imgUrl: '../../static/images/repairsImg/management.png',
  82. imgUrlActive: '../../static/images/repairsImg/management-active.png',
  83. show: 'management'
  84. },
  85. {
  86. text: '待处理池',
  87. imgUrl: '../../static/images/repairsImg/myRepairs.png',
  88. imgUrlActive: '../../static/images/repairsImg/myRepairs-active.png',
  89. show: 'pending'
  90. }
  91. // {
  92. // text: '待分配单',
  93. // icon: 'clock',
  94. // show: 'waitAllot'
  95. // },
  96. // {
  97. // text: '接单池',
  98. // icon: 'order',
  99. // show: 'order'
  100. // }
  101. ],
  102. // 后勤路由
  103. logisticsList: [
  104. {
  105. text: '首页',
  106. icon: 'home',
  107. show: 'home'
  108. },
  109. {
  110. text: '工单管理',
  111. icon: 'list-dot',
  112. show: 'management'
  113. },
  114. {
  115. text: '待处理池',
  116. icon: 'warning',
  117. show: 'pending'
  118. },
  119. {
  120. text: '通讯录',
  121. icon: 'phone',
  122. show: 'addressBook'
  123. }
  124. ],
  125. // 管理者路由
  126. adminList: [
  127. {
  128. text: '首页',
  129. icon: 'home',
  130. show: 'home'
  131. },
  132. {
  133. text: '工单管理',
  134. icon: 'list-dot',
  135. show: 'management'
  136. },
  137. {
  138. text: '待处理池',
  139. icon: 'warning',
  140. show: 'pending'
  141. },
  142. {
  143. text: '通讯录',
  144. icon: 'phone',
  145. show: 'addressBook'
  146. }
  147. ]
  148. }
  149. },
  150. methods: {
  151. handleChangeRouter(show, text) {
  152. this.show = show
  153. uni.setNavigationBarTitle({
  154. title: text
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .container {
  162. width: 100vw;
  163. height: calc(100vh - 102rpx);
  164. }
  165. </style>