meCertificate.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!-- 实验室列表 -->
  2. <template>
  3. <view id="meCertificate">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="for-max-box">
  5. <img class="null-img" v-if="!dataList[0]" src="@/pages_manage/images/null-data-1.png">
  6. <view class="bottom-for-box" v-for="(item,index) in dataList" :key="index">
  7. <view class="bottom-top-box">{{item.certTitle}}</view>
  8. <view class="bottom-bottom-box">
  9. <view class="bottom-right-box">{{item.createTime}}获得</view>
  10. <view class="bottom-right-box">到期时间:{{item.expirationTime}}</view>
  11. </view>
  12. </view>
  13. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  14. </scroll-view>
  15. </view>
  16. </template>
  17. <script>
  18. import $mqtt from '@/utils/mqtt.min.js';
  19. import {
  20. config
  21. } from '@/api/request/config.js'
  22. import {
  23. examExamQueryMyCert
  24. } from '@/pages_student/api/index.js'
  25. export default {
  26. data() {
  27. return {
  28. total: 0,
  29. dataList: [],
  30. getDataType: false,
  31. // 查询参数
  32. queryParams: {
  33. page: 1,
  34. pageSize: 10,
  35. },
  36. }
  37. },
  38. onLoad() {
  39. this.getList()
  40. },
  41. onShow() {},
  42. methods: {
  43. //滚动加载事件
  44. scrollGet() {
  45. let self = this;
  46. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  47. this.$set(this, 'getDataType', true);
  48. } else {
  49. this.queryParams.page += 1;
  50. this.$nextTick(() => {
  51. this.getList();
  52. })
  53. }
  54. },
  55. //获取实验室列表
  56. async getList() {
  57. let self = this;
  58. let obj = JSON.parse(JSON.stringify(this.queryParams));
  59. const {
  60. data
  61. } = await examExamQueryMyCert(obj);
  62. if (data.code == 200) {
  63. if (self.queryParams.page == 1) {
  64. this.dataList = data.data.records;
  65. this.total = data.data.total;
  66. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  67. this.$set(this, 'getDataType', true);
  68. }
  69. } else {
  70. this.dataList = [...this.dataList, ...data.data.records]
  71. this.total = data.data.total;
  72. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  73. this.$set(this, 'getDataType', true);
  74. }
  75. }
  76. }
  77. },
  78. },
  79. }
  80. </script>
  81. <style lang="stylus" scoped>
  82. #meCertificate {
  83. height: 100%;
  84. display flex;
  85. flex-direction column;
  86. .for-max-box {
  87. flex: 1;
  88. overflow-y scroll;
  89. .null-img {
  90. display block;
  91. width: 276rpx;
  92. height: 321rpx;
  93. position absolute;
  94. top: 200rpx;
  95. left: 274rpx;
  96. }
  97. .for-box:nth-child(1) {
  98. border-top: none;
  99. }
  100. .bottom-for-box {
  101. height: 154rpx;
  102. margin: 0 20rpx;
  103. border-top: 1rpx solid #E0E0E0;
  104. overflow hidden;
  105. .bottom-top-box {
  106. font-size: 28rpx;
  107. line-height: 28rpx;
  108. color: #333;
  109. display: block;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. white-space: nowrap;
  113. margin: 36rpx 0 30rpx;
  114. }
  115. .bottom-bottom-box {
  116. display flex;
  117. view {
  118. flex: 1;
  119. line-height: 48rpx;
  120. font-size: 28rpx;
  121. color: #999999;
  122. display: block;
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. white-space: nowrap;
  126. }
  127. view:nth-child(2) {
  128. text-align right
  129. }
  130. }
  131. }
  132. .get-data-null-p {
  133. text-align: center;
  134. line-height: 40rpx;
  135. padding-bottom: 40px;
  136. color: #999;
  137. }
  138. }
  139. }
  140. </style>