indexRouter.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <!-- 底部tab导航 -->
  3. <view>
  4. <Home v-if="nowchos === 0"></Home>
  5. <Order v-else-if="nowchos === 1 && isorders == 0 && userType == 3"></Order>
  6. <Information v-else-if="nowchos === 2 && isorders == 0 && userType == 3">
  7. </Information>
  8. <Mine v-else-if="nowchos === 3 && isorders == 0 && userType == 3"></Mine>
  9. <Mine v-else-if="nowchos === 1 && userType != 3"></Mine>
  10. <view class="bottomboxs">
  11. <x-navbottom :nowchos='nowchos' @botomchos='botomchos'></x-navbottom>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import Home from './home/index.vue' // 引入首页
  17. import Order from './order/index.vue' // 引入收益首页
  18. import Information from './information/index.vue' // 记录
  19. import Mine from './mine/index.vue' // 记录
  20. export default {
  21. components: { //在这里注册相应的组件
  22. Home,
  23. Order,
  24. Information,
  25. Mine,
  26. },
  27. data() {
  28. return {
  29. nowchos: 0, //当前选择了那个底部菜单
  30. userInfo: {},
  31. isorders: 0,
  32. userType: 3,
  33. }
  34. },
  35. mounted() {
  36. var userInfo = this.$cache.getCache('userInfo')
  37. if (userInfo.provUser) {
  38. this.isorders = userInfo.provUser.isorders
  39. this.userType = userInfo.provUser.userType
  40. }
  41. this.userInfo = userInfo
  42. },
  43. methods: {
  44. // tab
  45. botomchos(e) {
  46. uni.setStorageSync('nowchos', e);
  47. this.nowchos = e
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .bottomboxs {
  54. position: relative;
  55. bottom: 0;
  56. z-index: 2023;
  57. height: 100rpx;
  58. }
  59. </style>