notice.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view>
  3. <u-navbar :border-bottom="false" :is-back="true" title="通知公告"></u-navbar>
  4. <view class="wrap">
  5. <scroll-view scroll-y style="height: 100%;width: 100%;">
  6. <view class="page-box">
  7. <view v-for="(item, index) in dataList" :key="item.id" class="tabSwiper" @click="clickContent(item)">
  8. <view class="top">
  9. <view class="left">
  10. <u-icon :size="35" color="#2979ff" name="bell"></u-icon>
  11. <view class="title">{{ item.title }}</view>
  12. <u-icon :size="26" color="rgb(203,203,203)" name="arrow-right"></u-icon>
  13. </view>
  14. <view class="right">{{ item.date }}</view>
  15. </view>
  16. <view class="item">
  17. <view class="content">
  18. <view class="title u-line-2">{{ item.content }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. pageNum: 1,
  32. pageSize: 50,
  33. dataList: [],
  34. };
  35. },
  36. onLoad() {
  37. this.getNoticecList();
  38. },
  39. methods: {
  40. clickContent(item) {
  41. if (item.id) {
  42. this.$u.route('/pages/content/content', {
  43. id: item.id
  44. });
  45. }
  46. },
  47. getNoticecList() {
  48. let url = "/api/notice/findNoticeList";
  49. this.$u.get(url, {
  50. pageNum: this.pageNum,
  51. pageSize: this.pageSize,
  52. orderByColumn: 'create_time',
  53. isAsc: 'desc'
  54. }).then(obj => {
  55. let data = obj.rows
  56. data.filter(item => {
  57. this.dataList.push(
  58. {
  59. id: item.noticeId,
  60. title: item.noticeTitle,
  61. date: item.createTime,
  62. content: item.remark,
  63. }
  64. )
  65. })
  66. });
  67. }
  68. }
  69. };
  70. </script>
  71. <style lang="scss" scoped>
  72. .tabSwiper {
  73. width: 710 rpx;
  74. background-color: #ffffff;
  75. margin: 20 rpx auto;
  76. border-radius: 20 rpx;
  77. box-sizing: border-box;
  78. padding: 20 rpx;
  79. font-size: 28 rpx;
  80. .top {
  81. display: flex;
  82. justify-content: space-between;
  83. .left {
  84. display: flex;
  85. align-items: center;
  86. .title {
  87. margin: 0 10 rpx;
  88. font-size: 32 rpx;
  89. font-weight: bold;
  90. }
  91. }
  92. .right {
  93. color: $u-tips-color;
  94. }
  95. }
  96. .item {
  97. display: flex;
  98. margin: 20 rpx 0 0;
  99. .left {
  100. margin-right: 20 rpx;
  101. image {
  102. width: 200 rpx;
  103. height: 200 rpx;
  104. border-radius: 10 rpx;
  105. }
  106. }
  107. .content {
  108. .title {
  109. font-size: 28 rpx;
  110. line-height: 50 rpx;
  111. }
  112. }
  113. .right {
  114. margin-left: 10 rpx;
  115. padding-top: 20 rpx;
  116. text-align: right;
  117. }
  118. }
  119. }
  120. .wrap {
  121. display: flex;
  122. flex-direction: column;
  123. height: calc(100vh - var(--window-top));
  124. width: 100%;
  125. }
  126. .swiper-box {
  127. flex: 1;
  128. }
  129. .swiper-item {
  130. height: 100%;
  131. }
  132. </style>