message.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  5. <view class="top">
  6. <view class="icon">&#xe60d;</view>
  7. <view class="title">交易消息</view>
  8. <view class="date">2023-8-310:50</view>
  9. <view class="clear"></view>
  10. </view>
  11. <view class="content">订单20210803172489305已支付,请尽快与对方联系!</view>
  12. <view class="clear"></view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list: [],
  22. param: { pageNum: 1, pageSize: 10, orderByColumn: 'createTime', isAsc: 'desc' },
  23. loadMore: true
  24. };
  25. },
  26. onLoad(e) {
  27. this.getData();
  28. },
  29. methods: {
  30. getData() {
  31. this.http.request({
  32. url: '/level-one-server/app/TbPortNews/getPortNewsList',
  33. data: this.param,
  34. loading: 'false',
  35. success: res => {
  36. this.list.push(...res.data.data);
  37. }
  38. });
  39. },
  40. detail(item) {
  41. uni.navigateTo({
  42. url: '/pages/news/detail?id=' + item.id
  43. });
  44. },
  45. //刷新数据
  46. refresh() {
  47. this.loadMore = true;
  48. this.param.pageNum = 1;
  49. this.list = [];
  50. this.getData();
  51. }
  52. },
  53. //下拉刷新
  54. onPullDownRefresh() {
  55. setTimeout(() => {
  56. this.refresh();
  57. uni.stopPullDownRefresh();
  58. }, 1000);
  59. },
  60. //上拉加载
  61. onReachBottom() {
  62. if (this.loadMore) {
  63. this.param.pageNum++;
  64. this.getData();
  65. }
  66. }
  67. };
  68. </script>
  69. <style lang="scss">
  70. page {
  71. background-color: #f5f5f5;
  72. }
  73. .list {
  74. padding: 12px;
  75. .item {
  76. background-color: white;
  77. border-bottom: 1px solid #f0f2f7;
  78. padding: 14px;
  79. margin-bottom: 10px;
  80. border-radius: 10px;
  81. .top {
  82. color: $font-c;
  83. border-bottom: 1px solid $line;
  84. padding-bottom: 13px;
  85. .icon {
  86. float: left;
  87. width: 17px;
  88. height: 17px;
  89. border-radius: 50%;
  90. background-color: $main-color;
  91. padding: 5px;
  92. text-align: center;
  93. line-height: 19px;
  94. color: white;
  95. }
  96. .title {
  97. float: left;
  98. font-weight: bold;
  99. padding-left: 7px;
  100. color: #192B20;
  101. }
  102. .date {
  103. float: right;
  104. color: #A0A2A6;
  105. }
  106. }
  107. .content {
  108. padding-top: 15px;
  109. color: #666666;
  110. }
  111. }
  112. }
  113. </style>