平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

177 lines
3.6 KiB

  1. <template>
  2. <view style="height: 100%;">
  3. <u-empty marginTop="100rpx" :show="list.length == 0&&status == 'nomore'" mode="list" text="暂无数据"></u-empty>
  4. <u-list @scrolltolower="scrolltolower" style="height: calc(100% - 29rpx);padding-top:29rpx">
  5. <u-list-item v-for="(item, index) in list" :key="index">
  6. <view class="whiteCard">
  7. <view class="row1">
  8. 摄像头:{{item.cameraNames}}
  9. </view>
  10. <view class="row2">
  11. 查询时间:{{item.queryTime}}
  12. </view>
  13. <view class="row3">
  14. <view class="">
  15. <text>开始时间:</text>{{item.startTime}}
  16. </view>
  17. <view class="">
  18. <text>结束时间:</text>{{item.endTime}}
  19. </view>
  20. <view class="type">
  21. <text>分片类型:<text style="color: #333;">{{item.split ? "小时" : "天"}}</text></text>
  22. <view class="peopleNum">
  23. <image src="@/static/image/peopleNum.png" mode="aspectFill"></image>
  24. <text>总人数:{{item.total}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="bottom">
  29. <view class="btn" @click="NAV_TO('./detail',item)">
  30. <image src="@/static/image/see.png" mode="aspectFill"></image>
  31. <text>分片详情</text>
  32. </view>
  33. </view>
  34. </view>
  35. </u-list-item>
  36. <u-loadmore :status="status" />
  37. </u-list>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. page
  43. } from '@/api/work/passengerFlow.js'
  44. export default {
  45. data() {
  46. return {
  47. list: [],
  48. isLoading: false,
  49. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  50. page: {
  51. pageNum: 1,
  52. pageSize: 10,
  53. },
  54. }
  55. },
  56. methods: {
  57. scrolltolower() {
  58. this.loadmore()
  59. },
  60. loadmore() {
  61. if (this.status != 'loadmore') return
  62. this.status = 'loading'
  63. page({
  64. ...this.page,
  65. }).then(res => {
  66. if(res.code != 200)return
  67. this.list = this.list.concat(res.data.list)
  68. // 获取到的总条数>=接口总条数
  69. if (this.list.length >= res.data.total) {
  70. this.status = 'nomore'
  71. } else {
  72. this.status = 'loadmore'
  73. }
  74. })
  75. },
  76. refresh() {
  77. this.status = 'loadmore'
  78. this.list = []
  79. this.page.page = 1
  80. this.loadmore()
  81. },
  82. pullDownRefresh() {
  83. this.refresh()
  84. }
  85. },
  86. onLoad() {
  87. this.loadmore()
  88. },
  89. onPullDownRefresh(){
  90. uni.stopPullDownRefresh()
  91. this.refresh()
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .addBtn{
  97. width: 140rpx;
  98. height: 140rpx;
  99. position: fixed;
  100. right: 15rpx;
  101. bottom: 160rpx;
  102. }
  103. .whiteCard {
  104. background-color: #fff;
  105. border-radius: 18rpx;
  106. margin: 14rpx 28rpx;
  107. padding: 30rpx;
  108. padding-bottom: 24rpx;
  109. color: #333333;
  110. .row1 {
  111. font-size: 32rpx;
  112. font-weight: 700;
  113. }
  114. .row2 {
  115. font-size: 26rpx;
  116. margin-top: 14rpx;
  117. }
  118. .row3{
  119. background-color: #F2F8FF;
  120. border-radius: 16rpx;
  121. font-size: 26rpx;
  122. padding: 18rpx 24rpx;
  123. line-height: 48rpx;
  124. margin-top: 18rpx;
  125. text{
  126. color: #777777;
  127. }
  128. .type{
  129. display: flex;
  130. justify-content: space-between;
  131. .peopleNum {
  132. uni-image {
  133. width: 34rpx;
  134. height: 34rpx;
  135. position: relative;
  136. top: 8rpx;
  137. margin-right: 10rpx;
  138. }
  139. uni-text {
  140. color: #2388FF;
  141. }
  142. }
  143. }
  144. }
  145. .bottom {
  146. display: flex;
  147. border-top: 1rpx solid rgba(0, 0, 0, 0.1);
  148. margin-top: 24rpx;
  149. padding-top: 24rpx;
  150. position: relative;
  151. .btn {
  152. width: 100%;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. uni-image {
  157. width: 34rpx;
  158. height: 34rpx;
  159. margin-right: 6rpx;
  160. }
  161. uni-text {
  162. font-size: 28rpx;
  163. }
  164. }
  165. }
  166. }
  167. </style>