index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="message-page">
  3. <!-- 导航栏 -->
  4. <u-navbar fixed title="消息" placeholder>
  5. <view class="u-nav-slot" slot="right"></view>
  6. <view class="u-nav-slot" slot="left">
  7. <text class="cuIcon-filter"></text>
  8. </view>
  9. </u-navbar>
  10. <!-- tabs -->
  11. <scroll-view scroll-x class="bg-white nav">
  12. <view class="flex text-center">
  13. <view class="cu-item flex-sub" :class="tabIndex==index?'text-red cur':''" v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="index">
  14. {{ item.name }}
  15. </view>
  16. </view>
  17. </scroll-view>
  18. <!-- List -->
  19. <u-gap height="1"></u-gap>
  20. <!-- List -->
  21. <view class="message-content">
  22. <class-interaction-page v-show="tabIndex==0" />
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import Api from '../../api/api.js';
  28. import ClassInteractionPage from './class_interaction_page.vue'
  29. export default {
  30. components: {
  31. ClassInteractionPage
  32. },
  33. data() {
  34. return {
  35. option: {
  36. size: 10,
  37. auto: false,
  38. loadDisabled: false
  39. },
  40. list: [],
  41. tabIndex: 0
  42. };
  43. },
  44. computed: {
  45. tabs() {
  46. return [
  47. { 'index': 0, 'name': this.$i18n.t('classInteraction') },
  48. { 'index': 1, 'name': this.$i18n.t('notification') }
  49. ]
  50. }
  51. },
  52. onReady() {},
  53. mounted() {
  54. },
  55. methods: {
  56. tabSelect(e) {
  57. this.tabIndex = e.currentTarget.dataset.id
  58. }
  59. }
  60. };
  61. </script>
  62. <style lang="scss">
  63. .message-page {
  64. width: 100%;
  65. position: absolute;
  66. display: flex;
  67. flex-direction: column;
  68. height: 100%;
  69. .message-content {
  70. padding: 0px 0px 120px;
  71. }
  72. }
  73. </style>