index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="messageList_wrap">
  3. <u-navbar title="提醒消息" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
  4. <view class="message_item" v-for="item in listData" :key="item.id">
  5. <view class="message_top" :class="{ status_0 : item.status === '0' }">
  6. {{handleMessage(item)}}
  7. </view>
  8. <view class="message_bottom">
  9. <u-icon name="clock" color="#C0C0C7"></u-icon>
  10. <text class="date">{{item.receiveTime}}</text>
  11. </view>
  12. </view>
  13. <u-loadmore :status="finished ? 'nomore' : loadStatus" icon line />
  14. </view>
  15. </template>
  16. <script>
  17. import pullUpRefresh from "@/utils/pullUpRefresh";
  18. export default {
  19. mixins : [pullUpRefresh],
  20. onLoad: function(option) {
  21. this.queryParams.type = option.type;
  22. },
  23. data() {
  24. return {
  25. queryParams: {
  26. pageSize: 10,
  27. pageNum: 1,
  28. receiveUserId : this.$store.state.user.userInfo.userId,
  29. type: undefined
  30. },
  31. }
  32. },
  33. methods : {
  34. handleMessage(item){
  35. return item.sysMessageSend.content ? item.sysMessageSend.content.replace(/<\/?.+?>/g,"").replace(/ /g,"") : "";
  36. },
  37. async getList(){
  38. const { rows } = await uni.$u.api.sysMessageReceive(this.queryParams);
  39. return rows;
  40. }
  41. },
  42. mounted() {
  43. this.handleLoadData();
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .messageList_wrap {
  49. padding: 20rpx 30rpx;
  50. .message_item {
  51. background: #fff;
  52. border-radius: 12rpx;
  53. padding: 40rpx 56rpx;
  54. margin-bottom: 20rpx;
  55. .message_top {
  56. position: relative;
  57. color: #202020;
  58. font-size: 28rpx;
  59. }
  60. .status_0 {
  61. &::before {
  62. content: "";
  63. display: inline-block;
  64. width: 12rpx;
  65. height: 12rpx;
  66. background: #ff2a2a;
  67. border-radius: 50%;
  68. position: absolute;
  69. top: 12rpx;
  70. left: -20rpx;
  71. }
  72. }
  73. .message_bottom {
  74. display: flex;
  75. margin-top: 20rpx;
  76. ::v-deep .u-icon__icon {
  77. font-size: 24rpx !important;
  78. }
  79. .date {
  80. color: #c0c0c7;
  81. font-size: 24rpx;
  82. margin-left: 10rpx;
  83. }
  84. }
  85. }
  86. }
  87. </style>