index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <view class="app-wrapper" :style="{height: bodyHeight}">
  4. <dataIndex v-if="templateView == 'dataIndex'"></dataIndex>
  5. <!-- <liveIndex ref="mescrollItem1" v-show="templateView == 'liveIndex'"></liveIndex>
  6. <courseIndex ref="mescrollItem2" v-show="templateView == 'courseIndex'"></courseIndex> -->
  7. <vipIndex ref="mescrollItem3" v-show="templateView == 'vipIndex'"></vipIndex>
  8. </view>
  9. <view class="myTabBar x-f x-bc">
  10. <view class="myTabBar-item x-f y-f" @click="handleTab('dataIndex')">
  11. <image src="../../static/logo.png" mode="aspectFill"></image>
  12. <text>数据</text>
  13. </view>
  14. <view class="myTabBar-item x-f y-f" @click="handleTab('liveIndex')">
  15. <image src="../../static/logo.png" mode="aspectFill"></image>
  16. <text>直播课</text>
  17. </view>
  18. <view class="myTabBar-item x-f y-f" @click="handleTab('courseIndex')">
  19. <image src="../../static/logo.png" mode="aspectFill"></image>
  20. <text>训练营</text>
  21. </view>
  22. <view class="myTabBar-item x-f y-f" @click="handleTab('vipIndex')">
  23. <image src="../../static/logo.png" mode="aspectFill"></image>
  24. <text>会员</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import MescrollCompMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-comp.js";
  31. import dataIndex from "./dataIndex/index.vue"
  32. import liveIndex from "./live/index.vue"
  33. import courseIndex from "./course/index.vue"
  34. import vipIndex from "./vip/index.vue"
  35. export default {
  36. mixins: [MescrollCompMixin],
  37. components: {
  38. dataIndex,
  39. liveIndex,
  40. courseIndex,
  41. vipIndex
  42. },
  43. data() {
  44. return {
  45. templateView: 'vipIndex',
  46. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  47. windowHeight: uni.getSystemInfoSync().windowHeight,
  48. bodyHeight: 0,
  49. tabIndex: 0
  50. }
  51. },
  52. onLoad() {
  53. this.bodyHeight = `calc(${this.windowHeight}px - 56px)`
  54. uni.setNavigationBarTitle({
  55. title: '数据'
  56. });
  57. },
  58. methods: {
  59. handleTab(tem) {
  60. this.templateView = tem
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .app-wrapper {
  67. width: 100%;
  68. }
  69. .myTabBar {
  70. height: 56px;
  71. border-top: 1px solid #f5f5f5;
  72. box-sizing: border-box;
  73. width: 100%;
  74. background-color: #fff;
  75. position: fixed;
  76. bottom: var(--window-bottom);
  77. left: 0;
  78. font-size: 10px;
  79. image {
  80. width: 24px;
  81. height: 24px;
  82. margin-bottom: 3px;
  83. }
  84. &-item {
  85. flex: 1;
  86. }
  87. }
  88. </style>