information.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!-- 消息 -->
  2. <template>
  3. <view id="information">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="for-info-box" v-for="(item,index) in dataList" :key="index" @click="goInfoPage(item)">
  6. <img src="@/images/basicsModules/icon_xx_tz.png">
  7. <view class="right-box">
  8. <view class="top-box">
  9. <view>{{item.userName}}</view>
  10. <view>{{item.deptName}}</view>
  11. <view>{{item.sendTime}}</view>
  12. </view>
  13. <view class="bottom">{{item.title}}</view>
  14. </view>
  15. </view>
  16. <view class="get-null-box" v-if="!dataList[0]">暂无更多数据</view>
  17. </scroll-view>
  18. <tab-bar ref='infoAll'></tab-bar>
  19. </view>
  20. </template>
  21. <script>
  22. import {systemNoticeGetNoticeList } from '@/api/basicsModules/index.js'
  23. import { tabBar } from '@/components/tabBar.vue'
  24. export default {
  25. components: {
  26. tabBar
  27. },
  28. data() {
  29. return {
  30. queryParams: {
  31. page: 1,
  32. pageSize: 20,
  33. },
  34. total:0,
  35. dataList:[],
  36. }
  37. },
  38. onLoad() {
  39. },
  40. onShow(){
  41. },
  42. mounted() {
  43. this.getList();
  44. },
  45. methods: {
  46. //滚动事件
  47. scrollGet(){
  48. let self=this;
  49. if(self.total/self.queryParams.pageSize<=self.queryParams.page){
  50. console.log('没有更多数据!')
  51. }else{
  52. setTimeout(function(){
  53. self.queryParams.page += 1;
  54. self.getList();
  55. },1000)
  56. }
  57. },
  58. //获取列表数据
  59. async getList(){
  60. let self = this;
  61. const {data} = await systemNoticeGetNoticeList(this.queryParams);
  62. if(data.code==200){
  63. this.dataList=[...this.dataList,...data.data.records]
  64. this.total=data.data.total;
  65. }
  66. },
  67. formatDate(date) {
  68. let newDate = new Date(date);
  69. let YY = newDate.getFullYear() + '-';
  70. let MM = (newDate.getMonth() + 1 < 10 ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1) + '-';
  71. let DD = (newDate.getDate() < 10 ? '0' + (newDate.getDate()) : newDate.getDate());
  72. return YY + MM + DD;
  73. },
  74. }
  75. }
  76. </script>
  77. <style lang="stylus" scoped>
  78. #information{
  79. height:100%;
  80. display flex
  81. background #fff
  82. .info-max-box{
  83. flex:1;
  84. overflow: scroll
  85. padding-bottom:100rpx;
  86. background #fff
  87. margin:0 20rpx;
  88. .for-info-box:nth-child(1){
  89. border:none;
  90. }
  91. .for-info-box{
  92. height:150rpx;
  93. border-top:1rpx solid #F5F5F5;
  94. display flex
  95. img{
  96. border-radius:50%;
  97. margin:25rpx 28rpx 25rpx 20rpx;
  98. width:100rpx;
  99. height:100rpx;
  100. }
  101. .right-box{
  102. flex:1;
  103. .top-box{
  104. display flex
  105. line-height:67rpx;
  106. margin-top:7rpx;
  107. view:nth-child(1){
  108. font-size:30rpx;
  109. color:#333333;
  110. margin-right:28rpx;
  111. }
  112. view:nth-child(2){
  113. font-size:24rpx;
  114. color:#CCCCCC;
  115. flex:1;
  116. white-space:nowrap;
  117. overflow:hidden;
  118. text-overflow:ellipsis;
  119. }
  120. view:nth-child(3){
  121. font-size:20rpx;
  122. color:#CCCCCC;
  123. text-align right;
  124. }
  125. }
  126. .bottom{
  127. width:530rpx;
  128. line-height:62rpx;
  129. font-size:25rpx;
  130. color: #666666;
  131. display block
  132. overflow:hidden;
  133. text-overflow:ellipsis;
  134. white-space:nowrap;
  135. }
  136. }
  137. }
  138. .get-null-box{
  139. height:100rpx;
  140. line-height:100rpx;
  141. color:#999;
  142. text-align center
  143. }
  144. }
  145. }
  146. </style>