indexRouter.vue 1.4 KB

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