message.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="message">
  3. <view class="top custom_box" style="background: linear-gradient(180deg, rgb(254,245,246), rgb(245,245,245)); color: black;" >
  4. <!-- #ifdef MP || APP-PLUS -->
  5. <view class="sys-head">
  6. <view class="sys-bar" :style="{ height: sysHeight }"></view>
  7. <!-- #ifdef MP -->
  8. <view class="sys-title">消息</view>
  9. <!-- #endif -->
  10. </view>
  11. <!-- #endif -->
  12. </view>
  13. <view class="header-group bord" :style="{ 'margin-top': sysHeightTop}">
  14. <view class="tabs">
  15. <u-tabs class="defalt-utabs" :is-scroll="false" :list="navigationList" @change="changeNav" lineColor="#B22338" :current="tabIndex"
  16. :inactiveStyle="{ color: '#999999' }" :activeStyle="{ color: '#B22338', fontWeight: 'bold' }"
  17. keyName="title"></u-tabs>
  18. </view>
  19. </view>
  20. <view :style="{ height: height }" >
  21. <swiper :style="{ height: height }" :current="tabIndex" @change="swiperChange">
  22. <swiper-item v-for="(tab,index) in navigationList" :key="index">
  23. <view>
  24. <mescroll-item ref="MescrollItem" :i="index" :index="tabIndex" :tabs="navigationList" :height="height">
  25. </mescroll-item>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. <my-swiper :type=4 ></my-swiper>
  31. </view>
  32. </template>
  33. <script>
  34. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  35. let sysHeightTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px';
  36. import {
  37. mapGetters
  38. } from "vuex";
  39. import recommend from '@/components/recommend';
  40. import productWindow from '@/components/productWindow';
  41. import pageFooter from '@/components/pageFooter/index.vue'
  42. import colors from "@/mixins/color";
  43. import MescrollItem from "./module/mescrollUni-item.vue";
  44. export default {
  45. components: {
  46. MescrollItem,
  47. pageFooter,
  48. recommend,
  49. productWindow,
  50. },
  51. mixins: [colors],
  52. data () {
  53. return {
  54. sysHeight: sysHeight,
  55. sysHeightTop: sysHeightTop,
  56. height:'550px',
  57. tabIndex:0,
  58. navigationList: [{
  59. title: '个人消息',
  60. id: 'normal-msg'
  61. }, {
  62. title: '系统公告',
  63. id: 'sys-msg'
  64. }],
  65. };
  66. },
  67. computed: mapGetters(['isLogin']),
  68. onLoad (options) {
  69. },
  70. onShow () {
  71. let sysInfo = uni.getSystemInfoSync()
  72. this.height= sysInfo.windowHeight -(sysInfo.screenWidth/750) * (200) +'px';
  73. console.log(this.height)
  74. },
  75. created () {
  76. },
  77. methods: {
  78. swiperChange(e) {
  79. this.tabIndex = e.detail.current
  80. },
  81. changeNav (e) {
  82. this.tabIndex = e.index
  83. },
  84. },
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. .message {
  89. display: flex;
  90. flex-direction: column;
  91. }
  92. .sys-head {
  93. position: relative;
  94. width: 100%;
  95. // background: linear-gradient(90deg, $bg-star1 0%, $bg-end1 100%);
  96. .bg {
  97. position: absolute;
  98. left: 0;
  99. top: 0;
  100. width: 100%;
  101. height: 100%;
  102. background: var(--view-theme);
  103. background-size: 100% auto;
  104. background-position: left bottom;
  105. }
  106. .sys-title {
  107. font-family: STYuanti-SC-Regular, STYuanti-SC;
  108. z-index: 10;
  109. position: relative;
  110. height: 43px;
  111. text-align: left;
  112. line-height: 43px;
  113. font-size: 36rpx;
  114. color: rgba(17, 17, 17, 1);
  115. /*font-weight: bolder;*/
  116. font-weight: 400;
  117. padding-left: 36rpx;
  118. color: #333333;
  119. }
  120. }
  121. </style>