index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="">
  3. <view @tap.stop="toDetailFn(v.id)" class="list" v-for="(v, i) in dataList" :key="i">
  4. <text class="font">{{ v.updateTime }}</text>
  5. <view class="list_content">
  6. <view class="font_style">
  7. <view class="font_style_left"> 文件标题: </view>
  8. <view class="font_style_right">
  9. {{ v.title }}
  10. </view>
  11. </view>
  12. <view class="font_style">
  13. <view class="font_style_left"> 创建时间: </view>
  14. <view class="font_style_right">
  15. {{ v.createTime }}
  16. </view>
  17. </view>
  18. <view class="font_style">
  19. <view class="font_style_left"> 备注: </view>
  20. <view class="font_style_right">
  21. {{ v.remark }}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <Loading :loadStatus="loadStatus" :dataList="dataList" />
  27. </view>
  28. </template>
  29. <script>
  30. import { mapState } from 'vuex'
  31. import { getUserInfo } from '@/common/utils/util'
  32. export default {
  33. data() {
  34. return {
  35. pageNum: 1,
  36. pageSize: 20,
  37. remark: '',
  38. status: true,
  39. title: '',
  40. dataList: [],
  41. loadStatus: 0
  42. }
  43. },
  44. async onPullDownRefresh() {
  45. this.pageNum = 1
  46. await this.getData()
  47. uni.stopPullDownRefresh()
  48. },
  49. async onReachBottom() {
  50. this.pageNum++
  51. await this.getData()
  52. },
  53. computed: {
  54. ...mapState(['userInfo', 'isLogin', 'userId'])
  55. },
  56. mounted() {
  57. this.getData()
  58. },
  59. methods: {
  60. //跳转页面
  61. toDetailFn(id) {
  62. this.$navToPage({
  63. url: `/packageMine/pages/coreLssuedFile/detail?id=${id}`
  64. })
  65. },
  66. //获取数据
  67. async getData() {
  68. this.loadStatus = 1
  69. this.$api
  70. .get('/worker/comlist/list', {
  71. pageNum: this.pageNum,
  72. pageSize: this.pageSize,
  73. remark: this.remark,
  74. status: this.status,
  75. title: this.title,
  76. workerNumber: (await getUserInfo())?.workerNumber
  77. })
  78. .then(res => {
  79. if (this.pageNum == 1) {
  80. this.dataList = res.data.records
  81. } else if (this.pageNum > 1) {
  82. this.dataList.push(...res.data.records)
  83. if (res.data.records.length == 0) {
  84. this.pageNum--
  85. }
  86. }
  87. this.loadStatus = 2
  88. return res.data.records
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .page {
  96. padding: 0 34rpx;
  97. }
  98. .list {
  99. margin: 0 32rpx;
  100. font-size: 28rpx;
  101. .list_content {
  102. background-color: #fff;
  103. padding: 20rpx;
  104. border-radius: 20rpx;
  105. }
  106. }
  107. .font_style {
  108. display: flex;
  109. color: #101010;
  110. line-height: 45rpx;
  111. .font_style_right {
  112. flex: 1;
  113. }
  114. .font_style_left {
  115. width: 145rpx;
  116. }
  117. .status {
  118. color: #00be8d;
  119. }
  120. }
  121. .font {
  122. display: block;
  123. color: #909090;
  124. padding: 20rpx 0;
  125. }
  126. </style>