index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view v-if="!refreshPage" class="uni-app">
  3. <view class="status-bar" />
  4. <view class="main-container">
  5. <list-tab-header
  6. v-model="navIndex"
  7. :nav-list="navList"
  8. :show-search="false" />
  9. <view class="list-view">
  10. <wk-keep-alive v-model="navIndex">
  11. <wk-keep-alive-item>
  12. <message-list />
  13. </wk-keep-alive-item>
  14. <wk-keep-alive-item>
  15. <backlog-list />
  16. </wk-keep-alive-item>
  17. </wk-keep-alive>
  18. </view>
  19. </view>
  20. <wk-tabbar v-model="footerIndex" :list="mixinFooterNav" />
  21. </view>
  22. </template>
  23. <script>
  24. import ListTabHeader from '@/components/base/list-tab-header.vue'
  25. import tabbar from '@/mixins/tabbar.js'
  26. import MessageList from './messageList.vue'
  27. import BacklogList from './backlogList.vue'
  28. export default {
  29. name: 'MessageIndex',
  30. components: {
  31. ListTabHeader,
  32. MessageList,
  33. BacklogList
  34. },
  35. mixins: [tabbar],
  36. data() {
  37. return {
  38. navIndex: 0,
  39. navList: [
  40. { label: '消息', com: 'message', action: ''},
  41. { label: '待办', com: 'backlog', action: '' }
  42. ],
  43. refreshPage: false // 刷新页面标志
  44. }
  45. },
  46. onShow() {
  47. const i = this.navIndex
  48. this.navIndex = -1
  49. this.$nextTick(() => {
  50. this.navIndex = i
  51. })
  52. // if (this.refreshPage) {
  53. // this.$nextTick(function(){
  54. // this.refreshPage = false
  55. // })
  56. // }
  57. },
  58. methods: {}
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .main-container {
  63. .list-view {
  64. flex: 1;
  65. overflow-y: hidden;
  66. .wk-keep-alive {
  67. width: 100%;
  68. height: 100%;
  69. overflow: hidden;
  70. .wk-keep-alive-item {
  71. width: 100%;
  72. height: 100%;
  73. overflow: hidden;
  74. }
  75. }
  76. }
  77. }
  78. </style>