index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="messages">
  3. <u-navbar
  4. back-icon-color="#fff"
  5. :back-text="$t('common.Back')"
  6. :is-back="true"
  7. :background="{background:'#1777FE'}"
  8. :back-text-style="{color:'#fff'}"
  9. :border-bottom="true"
  10. title-color="#fff"
  11. :title="title"
  12. :custom-back="back"
  13. >
  14. </u-navbar>
  15. <view class="bg"></view>
  16. <view class="menu">
  17. <u-tabs :list="TopMenulist" :is-scroll="false" :current="current" @change="change" :bold="false" bar-width="120" bar-height="2"></u-tabs>
  18. </view>
  19. <view class="linewidth"></view>
  20. <view class="msgwrap" v-if="current==0">
  21. <msgPageo/>
  22. </view>
  23. <view class="msgwrap nomenu" v-if="current==1">
  24. <msgPagep/>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import msgPageo from './pageO.vue';
  30. import msgPagep from './pageP.vue';
  31. export default {
  32. components:{
  33. msgPageo,
  34. msgPagep
  35. },
  36. data() {
  37. return {
  38. title:'',
  39. current:0,
  40. TopMenulist:[
  41. {
  42. name:this.$t('common.SystemMessage')
  43. },
  44. {
  45. name:this.$t('common.notification')
  46. },
  47. ],
  48. Botcurrent:0,
  49. BotMenuList: [
  50. {
  51. id: "tab01",
  52. name: this.$t('common.All'),
  53. msgid: 0
  54. },
  55. {
  56. id: "tab02",
  57. // name: '活动消息',
  58. name:this.$t('common.ActiveMessage'),
  59. msgid: 23
  60. },
  61. {
  62. id: "tab03",
  63. // name: '服务消息',
  64. name:this.$t('common.ServiceMessage'),
  65. msgid: 223
  66. }, {
  67. id: "tab04",
  68. // name: '审核消息',
  69. name:this.$t('common.ReviewMessage'),
  70. msgid: 221
  71. }
  72. ],
  73. tabIndex:0,
  74. scrollInto: "",
  75. indicatorLineLeft: 0,
  76. indicatorLineWidth: 0,
  77. isTap: false
  78. }
  79. },
  80. onShow(){
  81. this.title=this.$i18n.locale == 'zh'? '消息中心': 'Message Center';
  82. },
  83. methods: {
  84. change(index) {
  85. this.current = 0;
  86. this.current = index;
  87. },
  88. changeMenu(index){
  89. this.Botcurrent=0;
  90. this.Botcurrent=index;
  91. },
  92. //后退一步
  93. back(){
  94. // #ifdef H5
  95. history.back()
  96. // #endif
  97. // #ifndef H5
  98. uni.navigateBack()
  99. // #endif
  100. },
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .messages{
  106. .bg{
  107. position:fixed;
  108. top:0;
  109. left:0;
  110. right:0;
  111. bottom:0;
  112. z-index:-1;
  113. background:#fff;
  114. }
  115. .linewidth{
  116. height:20upx;
  117. width:100%;
  118. background-color:#eee;
  119. }
  120. .menu{
  121. height:80upx;
  122. width:750upx;
  123. margin-bottom:6upx;
  124. }
  125. }
  126. .msgwrap{
  127. position:absolute;
  128. height:84%;
  129. width:100%;
  130. bottom:0;
  131. left:0;
  132. right:0;
  133. &.nomenu{
  134. height:85.6%;
  135. }
  136. }
  137. </style>