indexRouter.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <!-- 底部tab导航 -->
  3. <view>
  4. <Home v-if="nowchos === 0"></Home>
  5. <Order v-else-if="nowchos === 1"></Order>
  6. <Mine ref="mine" v-else-if="nowchos === 2"></Mine>
  7. <!-- <Information v-else-if="nowchos === 2"></Information>
  8. <Mine ref="mine" v-else-if="nowchos === 3"></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. }
  33. },
  34. onShow() {
  35. if (this.nowchos == 3) {
  36. this.$nextTick(() => {
  37. this.$refs.mine.refreshTokenil()
  38. })
  39. }
  40. },
  41. mounted() {
  42. var userInfo = this.$cache.getCache('userInfo')
  43. if (userInfo.provUser) {
  44. this.isorders = userInfo.provUser.isorders
  45. this.userType = userInfo.provUser.userType
  46. }
  47. this.userInfo = userInfo
  48. },
  49. methods: {
  50. // tab
  51. botomchos(e) {
  52. uni.setStorageSync('nowchos', e);
  53. this.nowchos = e
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .bottomboxs {
  60. position: relative;
  61. bottom: 0;
  62. z-index: 2023;
  63. height: 100rpx;
  64. }
  65. </style>