notice.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view style="background-color: rgb(242,245,252);">
  3. <view class="customer-view clearfix" v-for="(item,index) in list" :key='index'
  4. @click="goPage(`/pagesT/notice/noticeDetails?id=${item.id}`)">
  5. <view class="ico"></view>
  6. <view class="title">
  7. <!-- 支付率低至0.3%,招行支付重磅上线 -->
  8. {{item.title}}
  9. </view>
  10. <view class="foot">
  11. <!-- 2021-03-15 18:44:01 -->
  12. {{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}
  13. </view>
  14. </view>
  15. <!-- <view class="customer-view clearfix">
  16. <view class="ico"></view>
  17. <view class="title float_left">
  18. 2021年易订货春节放假安排通知
  19. </view>
  20. <view class="foot">
  21. 2021-02-09 10:53:31
  22. </view>
  23. </view> -->
  24. <u-loadmore :status="load_status" />
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. page: 1,
  32. pageSize: 10,
  33. total: 0,
  34. load_status: 'nomore',
  35. list: []
  36. };
  37. },
  38. onLoad() {
  39. this.getAllAnnouncement()
  40. },
  41. onPullDownRefresh() {
  42. this.getAllAnnouncement()
  43. },
  44. // 上拉加载
  45. onReachBottom() {
  46. if (this.total / this.pageSize > this.page) {
  47. this.page += 1;
  48. this.getAllAnnouncement()
  49. }
  50. },
  51. methods: {
  52. getAllAnnouncement() {
  53. this.$u.api.getAllAnnouncement({
  54. type: 4,
  55. page: this.page,
  56. pageSize: this.pageSize
  57. }).then(res => {
  58. uni.stopPullDownRefresh();
  59. if (this.page === 1) {
  60. this.list = res.data;
  61. } else {
  62. this.list = this.list.concat(res.data);
  63. }
  64. this.total = res.pageTotal;
  65. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .customer-view {
  73. width: 100%;
  74. padding: 30rpx;
  75. background-color: #ffffff;
  76. margin-top: 20rpx;
  77. .ico {
  78. float: left;
  79. width: 14rpx;
  80. height: 14rpx;
  81. background-color: #FA6400;
  82. border-radius: 50%;
  83. margin-top: 15rpx;
  84. margin-right: 10rpx;
  85. }
  86. .title {
  87. font-size: 32rpx;
  88. font-weight: bold;
  89. }
  90. .foot {
  91. margin-top: 10rpx;
  92. float: right;
  93. font-size: 24rpx;
  94. color: #999;
  95. }
  96. }
  97. </style>