notice-list.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="message tn-safe-area-inset-bottom">
  3. <!-- #ifdef H5 -->
  4. <!-- 顶部自定义导航 -->
  5. <tn-nav-bar fixed :bottomShadow="false" backTitle=" ">
  6. <view class="" @click="showModal">
  7. <text class="tn-text-lg">公告</text>
  8. <text class="tn-text-xl tn-padding-left-sm tn-icon-group-circle"></text>
  9. </view>
  10. </tn-nav-bar>
  11. <!-- #endif -->
  12. <view class="">
  13. <view class="wallpaper-shadow tn-margin tn-padding" v-for="(item, index) in list" :key="index" @click="goDetail(item.id)">
  14. <view class="tn-flex tn-flex-col-top">
  15. <!-- 这个是图片形式,自己看需要去使用 -->
  16. <!-- <view class="">
  17. <view class="logo-pic">
  18. <view class="logo-image">
  19. <view class="" style="background-image:url('https://cdn.nlark.com/yuque/0/2022/png/280373/1666765211176-assets/web-upload/fafd21e9-b5e5-4243-8060-a3c3d3a570cf.png');width: 100rpx;height: 100rpx;background-size: cover;">
  20. </view>
  21. </view>
  22. </view>
  23. </view> -->
  24. <view class="tn-padding-left-sm" style="width: 100%;">
  25. <view class="tn-flex tn-flex-row-between tn-flex-col-between">
  26. <view class="justify-content-item">
  27. <text class="tn-color-wallpaper tn-text-lg tn-text-bold">{{item.name}}</text>
  28. </view>
  29. </view>
  30. <view class=" tn-padding-top-xs tn-text-ellipsis-2">
  31. <!-- <text class="tn-color-gray">副标题</text> -->
  32. </view>
  33. </view>
  34. </view>
  35. <view class="tn-flex tn-flex-row-between tn-flex-col-between tn-margin-top-sm">
  36. <view class="justify-content-item tn-color-gray tn-text-center tn-color-gray">
  37. <text class="tn-icon-time tn-padding-right-xs tn-padding-left-xs tn-text-df"></text>
  38. <text class="tn-text-sm">{{item.create_time_text}}</text>
  39. </view>
  40. <!-- <view class="justify-content-item tn-round tn-text-xs tn-bg-blue--light tn-color-blue"
  41. style="padding: 5rpx 15rpx;">
  42. <text class="tn-padding-right-xs">#</text> 官 方
  43. </view> -->
  44. </view>
  45. </view>
  46. </view>
  47. <view class="tn-tabbar-height"></view>
  48. </view>
  49. </template>
  50. <script>
  51. import noticeApi from "@/common/api/notice.js"
  52. export default {
  53. name: 'Message',
  54. data() {
  55. return {
  56. list: [],
  57. hasMore: false,
  58. currentPage: 1,
  59. loadFlag: 'loading',
  60. }
  61. },
  62. onLoad() {
  63. this.getData()
  64. },
  65. async onReachBottom() {
  66. console.log("onReachBottom")
  67. if (this.hasMore) {
  68. this.currentPage++
  69. this.getData()
  70. }
  71. },
  72. methods: {
  73. getData() {
  74. this.loadFlag = 'loading'
  75. let params = {
  76. page: this.current_page
  77. }
  78. noticeApi.getNoticeList(this, params).then(res => {
  79. if (res && res.data) {
  80. this.list = this.list.concat(res.data.list.data)
  81. this.hasMore = res.data.list.has_more
  82. this.currentPage = res.data.list.current_page
  83. this.loadFlag = 'over'
  84. }
  85. })
  86. },
  87. // 跳转详情
  88. goDetail(id) {
  89. this.utils.goto('notice-detail?id=' + id)
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. page {
  96. background-color: #fff;
  97. }
  98. .message {
  99. max-height: 100vh;
  100. }
  101. /* 自定义导航栏内容 start */
  102. .custom-nav {
  103. height: 100%;
  104. &__back {
  105. margin: auto 30rpx;
  106. font-size: 40rpx;
  107. margin-right: 10rpx;
  108. flex-basis: 5%;
  109. width: 100rpx;
  110. position: absolute;
  111. }
  112. }
  113. /* 自定义导航栏内容 end */
  114. /* 底部安全边距 start*/
  115. .tn-tabbar-height {
  116. min-height: 20rpx;
  117. height: calc(40rpx + env(safe-area-inset-bottom) / 2);
  118. height: calc(40rpx + constant(safe-area-inset-bottom));
  119. }
  120. .tn-color-wallpaper {
  121. color: #1D2541;
  122. }
  123. /* 页面阴影 start*/
  124. .wallpaper-shadow {
  125. border-radius: 15rpx;
  126. box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
  127. }
  128. /* 图标容器15 start */
  129. .icon15 {
  130. &__item {
  131. width: 30%;
  132. background-color: #FFFFFF;
  133. border-radius: 10rpx;
  134. padding: 30rpx;
  135. margin: 20rpx 10rpx;
  136. transform: scale(1);
  137. transition: transform 0.3s linear;
  138. transform-origin: center center;
  139. &--icon {
  140. width: 105rpx;
  141. height: 105rpx;
  142. font-size: 60rpx;
  143. border-radius: 50%;
  144. margin-bottom: 18rpx;
  145. position: relative;
  146. z-index: 1;
  147. &::after {
  148. content: " ";
  149. position: absolute;
  150. z-index: -1;
  151. width: 100%;
  152. height: 100%;
  153. left: 0;
  154. bottom: 0;
  155. border-radius: inherit;
  156. opacity: 1;
  157. transform: scale(1, 1);
  158. background-size: 100% 100%;
  159. }
  160. }
  161. }
  162. }
  163. /* 用户头像 start */
  164. .logo-image {
  165. width: 100rpx;
  166. height: 100rpx;
  167. position: relative;
  168. }
  169. .logo-pic {
  170. background-size: cover;
  171. background-repeat: no-repeat;
  172. // background-attachment:fixed;
  173. background-position: top;
  174. border: 1rpx solid rgba(255, 255, 255, 0.05);
  175. box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.05);
  176. border-radius: 50%;
  177. overflow: hidden;
  178. // background-color: #FFFFFF;
  179. }
  180. </style>