brokerNotice.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="list-item" v-for="(item,index) in noticeList" :key="index" @click="goPage(item.id)">
  5. <view class="item-time">{{item.createtime}}</view>
  6. <view class="item-card">
  7. <view class="card-title">{{item.title}}</view>
  8. <view class="card-content">
  9. <u-parse :content="item.details"></u-parse>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. <uni-load-more :status="pstatus"></uni-load-more>
  15. </view>
  16. </template>
  17. <script>
  18. var _this;
  19. export default {
  20. data() {
  21. return {
  22. noticeList: [],
  23. pstatus: 'more',
  24. ppage: 1,
  25. psize: 20,
  26. }
  27. },
  28. onLoad() {
  29. _this = this;
  30. _this.getNotice();
  31. },
  32. onReachBottom: function() {
  33. if (_this.pstatus !== 'more') {
  34. return;
  35. }
  36. _this.getNotice();
  37. },
  38. methods: {
  39. goPage(noticeid) {
  40. uni.navigateTo({
  41. url: '/pages/broker/noticeDetails?noticeid=' + noticeid
  42. });
  43. },
  44. getNotice() {
  45. _this = this;
  46. _this.$req.ajax({
  47. path: "notice/listBrokerNotice",
  48. data: {
  49. ppage: _this.ppage,
  50. psize: _this.psize,
  51. }
  52. }).then((data) => {
  53. console.log("公告",data)
  54. _this.pstatus = data.pstatus;
  55. _this.noticeList = _this.noticeList.concat(data.plist);
  56. _this.ppage += 1;
  57. }).catch((err) => {
  58. uni.showModal({
  59. title: '信息提示',
  60. content: err,
  61. showCancel: false
  62. });
  63. });
  64. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .list {
  70. padding: 20rpx 20rpx;
  71. .list-item {
  72. margin-bottom: 30rpx;
  73. display: flex;
  74. flex-direction: column;
  75. .item-time {
  76. margin: 0 auto 20rpx;
  77. padding: 0 20rpx;
  78. height: 40rpx;
  79. line-height: 40rpx;
  80. border-radius: 20rpx;
  81. font-size: 20rpx;
  82. color: #FFFFFF;
  83. background-color: #d7d7d7;
  84. }
  85. .item-card {
  86. padding: 20rpx 20rpx;
  87. background-color: #FFFFFF;
  88. border-radius: 12rpx;
  89. // box-shadow: 0rpx 0rpx 10rpx 1rpx rgba(73, 128, 209, 0.3);
  90. box-shadow: 5rpx 5rpx 10rpx 2rpx rgba(255, 0, 0, 0.3);
  91. .card-title {
  92. font-size: 35rpx;
  93. font-weight: 600;
  94. }
  95. .card-content {
  96. margin-top: 20rpx;
  97. line-height: 40rpx;
  98. font-size: 25rpx;
  99. color: #797979;
  100. }
  101. }
  102. }
  103. }
  104. </style>