sysnotice.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <uni-menubar title="系统通知" />
  4. <view class="page-container">
  5. <block v-for="item in list" :index="item.id">
  6. <view class="card">
  7. <tm-avatar custom-class="card-img" :src="item.avatar">
  8. <template v-slot:dot>
  9. <tm-badges v-if="item.is_read != 1" label="1" dot></tm-badges>
  10. </template>
  11. </tm-avatar>
  12. <view class="card-main">
  13. <view class="card-main-top">
  14. <view class="card-main-title">系统消息</view>
  15. <view class="card-main-date">{{item.create_time}}</view>
  16. </view>
  17. <view class="card-main-message">{{item.content}}</view>
  18. <view class="card-tags"></view>
  19. </view>
  20. </view>
  21. </block>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. list: [],
  30. param: {
  31. page: 1,
  32. }
  33. };
  34. },
  35. onLoad() {
  36. this.$tm.request.get('user/sysnotice', this.param).then(res => {
  37. this.list = res.data.list
  38. })
  39. },
  40. onReachBottom() {
  41. this.param.page++
  42. this.$tm.request.get('user/sysnotice', this.param).then(res => {
  43. this.list = this.list.concat(res.data.list)
  44. })
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .page-container {
  50. display: flex;
  51. flex-direction: column;
  52. padding: 30rpx 40rpx;
  53. }
  54. .card {
  55. display: flex;
  56. flex-direction: row;
  57. align-items: flex-start;
  58. width: 100%;
  59. margin-bottom: 10px;
  60. }
  61. .card-img {
  62. border-radius: 100%;
  63. background: #fff;
  64. margin-right: 40rpx;
  65. }
  66. .card-main {
  67. flex: 1;
  68. padding: 0 30rpx;
  69. background: #fff;
  70. display: flex;
  71. flex-direction: column;
  72. border-radius: 7px;
  73. line-height: 28rpx;
  74. position: relative;
  75. }
  76. .card-main-top {
  77. display: flex;
  78. flex-direction: row;
  79. align-items: center;
  80. padding: 20rpx 0;
  81. border-bottom: 1px solid #eee;
  82. justify-content: space-between;
  83. }
  84. .card-main-title {
  85. font-size: 28rpx;
  86. }
  87. .card-main-date {
  88. font-size: 24rpx;
  89. color: #585858;
  90. }
  91. .card-main-message {
  92. font-size: 26rpx;
  93. color: #585858;
  94. padding: 20rpx 0;
  95. line-height: 40rpx;
  96. }
  97. .card-tags {
  98. position: absolute;
  99. border: 5px solid transparent;
  100. border-right-color: #fff;
  101. left: -20rpx;
  102. top: 40rpx;
  103. }
  104. </style>