indexRouter.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <!-- 底部tab导航 -->
  3. <view>
  4. <Home :dataList="dataList" :genreTitle="genreTitle" ref="home" v-if="nowchos === 0"></Home>
  5. <!-- isorders == 0 同时userType == 3 送气员 -->
  6. <Order v-else-if="nowchos === 1 && isorders == 0 && userType == 3"></Order>
  7. <Information ref="cylinder" v-else-if="steelCylinder(isorders,userType)"></Information>
  8. <Mine :token="token" :userInfo="userInfo" v-else-if="getType(isorders,userType)"></Mine>
  9. <view class="bottomboxs">
  10. <x-navbottom :nowchos='nowchos' @botomchos='botomchos'></x-navbottom>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import Home from './home/index.vue' // 引入首页
  16. import Order from './order/index.vue' // 引入收益首页
  17. import Information from './information/index.vue' // 记录
  18. import Mine from './mine/index.vue' // 记录
  19. export default {
  20. components: { //在这里注册相应的组件
  21. Home,
  22. Order,
  23. Information,
  24. Mine,
  25. },
  26. data() {
  27. return {
  28. nowchos: 0, //当前选择了那个底部菜单
  29. userInfo: {},
  30. isorders: 0,
  31. userType: 3,
  32. token: '',
  33. aspirated: [{
  34. id: '25',
  35. title: '领重瓶出库',
  36. icon: 'icon-chukudan',
  37. color: '#f4b237',
  38. }, {
  39. id: '27',
  40. title: '扫空瓶入库',
  41. icon: 'icon-fankudengji',
  42. color: '#6db1ff',
  43. }],
  44. shopList: [{
  45. id: '37',
  46. title: '重瓶出库',
  47. icon: 'icon-peizaizhuangche',
  48. color: '#f4b237',
  49. }, {
  50. id: '10',
  51. title: '空瓶出库',
  52. icon: 'icon-peizaizhuangche-xianxing',
  53. color: '#6db1ff',
  54. }, {
  55. id: '31',
  56. title: '重瓶入库',
  57. icon: 'icon-fankudengji',
  58. color: '#6db1ff',
  59. }, {
  60. id: '21',
  61. title: '回收空瓶',
  62. icon: 'icon-recycling',
  63. color: '#8ac247',
  64. }, {
  65. id: '35',
  66. // 未配送
  67. title: '重瓶返库',
  68. icon: 'icon-fankudengji',
  69. color: '#22b9f9',
  70. }, {
  71. id: '33',
  72. title: '重瓶退回',
  73. icon: 'icon-tuihuo',
  74. color: '#f3553e',
  75. }, ],
  76. driverList: [{
  77. id: '11',
  78. title: '门店空瓶装车',
  79. icon: 'icon-owNote',
  80. color: '#22b9f9',
  81. }, {
  82. id: '12',
  83. title: '空瓶到达气站',
  84. icon: 'icon-yidaoda',
  85. color: '#8ac247',
  86. }, {
  87. id: '17',
  88. title: '气站重瓶出库',
  89. icon: 'icon-chukudan',
  90. color: '#6db1ff',
  91. }, {
  92. id: '19',
  93. title: '重瓶交付门店',
  94. icon: 'icon-yunsonghejiaofu',
  95. color: '#f4b237',
  96. }],
  97. stationList: [{
  98. id: '13',
  99. title: '空瓶到达气站',
  100. icon: 'icon-daichuku',
  101. color: '#37c4f4',
  102. }, {
  103. id: '14',
  104. title: '气站充装空瓶',
  105. icon: 'icon-peizaizhuangche-xianxing',
  106. color: '#6db1ff',
  107. }, {
  108. id: '15',
  109. title: '气站重瓶出库',
  110. icon: 'icon-owNote',
  111. color: '#8ac247',
  112. }, {
  113. id: 'inspect',
  114. title: '充气前后检查',
  115. icon: 'icon-jianchaxiang',
  116. color: '#f4b237',
  117. }, ],
  118. dataList: [],
  119. genreTitle: '',
  120. }
  121. },
  122. onReachBottom() {
  123. this.$refs.cylinder.bottomingEvent()
  124. },
  125. onLoad(value) {
  126. console.log(value, 333)
  127. if (value.page) {
  128. this.nowchos = value.page
  129. }
  130. var userInfo = this.$cache.getCache('userInfo')
  131. if (userInfo.provUser) {
  132. if (userInfo.provUser.isorders == 0 && userInfo.provUser.userType == 3) {
  133. this.dataList = this.aspirated
  134. this.genreTitle = '送气员端'
  135. } else if (userInfo.provUser.userType == 3) {
  136. this.dataList = this.shopList
  137. this.genreTitle = '门店端'
  138. } else if (userInfo.provUser.userType == 4) {
  139. this.dataList = this.driverList
  140. this.genreTitle = '司机端'
  141. } else if (userInfo.provUser.userType == 5) {
  142. this.dataList = this.stationList
  143. this.genreTitle = '气站端'
  144. }
  145. } else {
  146. this.dataList = this.aspirated
  147. this.genreTitle = '送气员端'
  148. }
  149. },
  150. onShow() {
  151. var token = this.$cache.getToken()
  152. this.token = token
  153. var userInfo = this.$cache.getCache('userInfo')
  154. if (userInfo) {
  155. this.userInfo = userInfo
  156. }
  157. },
  158. mounted() {
  159. var userInfo = this.$cache.getCache('userInfo')
  160. if (userInfo.provUser) {
  161. this.isorders = userInfo.provUser.isorders
  162. this.userType = userInfo.provUser.userType
  163. }
  164. },
  165. methods: {
  166. // tab
  167. botomchos(e) {
  168. uni.setStorageSync('nowchos', e);
  169. this.nowchos = e
  170. },
  171. getType(isorders, userType) {
  172. if (isorders == 0) {
  173. if (userType == 3) {
  174. if (this.nowchos == 3) {
  175. return true
  176. }
  177. } else {
  178. if (this.nowchos == 2) {
  179. return true
  180. }
  181. }
  182. } else {
  183. if (this.nowchos == 2) {
  184. return true
  185. }
  186. }
  187. },
  188. steelCylinder(isorders, userType) {
  189. if (isorders == 0) {
  190. if (userType == 3) {
  191. if (this.nowchos == 2) {
  192. return true
  193. }
  194. } else {
  195. if (this.nowchos == 1) {
  196. return true
  197. }
  198. }
  199. } else {
  200. if (this.nowchos == 1) {
  201. return true
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </script>
  208. <style lang="scss">
  209. .bottomboxs {
  210. position: relative;
  211. bottom: 0;
  212. z-index: 2023;
  213. height: 100rpx;
  214. }
  215. </style>