checkReport.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="box">
  3. <view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.id)">
  4. <view class="time">{{item.CreateTime}}</view>
  5. <view class="carPlate">
  6. <view class="plate">{{item.PlateNumber}}</view>
  7. <view class="mileage">{{item.currentMileage}}km</view>
  8. </view>
  9. <view class="shopName"v-if="item.carmodel">{{item.carmodel}}</view>
  10. <view class="itemContent">{{item.shopname}}</view>
  11. </view>
  12. <!-- 上拉 加载更多 -->
  13. <view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
  14. <!-- 无数据空白页 -->
  15. <nodata v-if="itemData.length==0"></nodata>
  16. </view>
  17. </template>
  18. <script>
  19. import nodata from '../../components/nodata/nodata.vue'
  20. export default {
  21. components: {
  22. nodata,
  23. },
  24. data() {
  25. return {
  26. page: 1,
  27. itemData: [1, 2, 3],
  28. noMoreShow: false,
  29. }
  30. },
  31. onLoad() {
  32. this.page = 1
  33. this.myOrderCoupon()
  34. },
  35. methods: {
  36. goDetail(id) {
  37. uni.navigateTo({
  38. url: 'reportDetail?id=' + id
  39. })
  40. },
  41. myOrderCoupon() {
  42. uni.showLoading({
  43. title: '加载中'
  44. })
  45. this.$http('opencheckSheet/getTestList', {
  46. // page: this.page,
  47. // limit: 10,
  48. }, 'GET').then(res => {
  49. uni.hideLoading();
  50. // var list = res.data.Items
  51. var list = res.data
  52. // 处理 undefined和null转为空白字符串
  53. list.forEach((item, index) => {
  54. for (const key in item) {
  55. item[key] = this.$praseStrEmpty(item[key])
  56. }
  57. })
  58. if (this.page == 1) {
  59. this.itemData = list
  60. } else {
  61. this.itemData = this.itemData.concat(list)
  62. }
  63. if (list.length < 10) {
  64. this.noMoreShow = true
  65. } else {
  66. this.noMoreShow = false
  67. }
  68. if (this.itemData.length != 0) {
  69. this.itemData.forEach((item, index) => {
  70. if (item.pickNum <= 0) {
  71. this.allHave = false
  72. }
  73. })
  74. }
  75. })
  76. },
  77. },
  78. // 下拉刷新 上拉加载更多
  79. onPullDownRefresh() {
  80. this.page = 1
  81. this.myOrderCoupon()
  82. setTimeout(function() {
  83. uni.stopPullDownRefresh();
  84. }, 1000);
  85. },
  86. onReachBottom() {
  87. // this.page++;
  88. this.myOrderCoupon()
  89. },
  90. }
  91. </script>
  92. <style>
  93. .box {
  94. min-height: 100vh;
  95. background-color: #F4F5F7;
  96. padding-top: 20rpx;
  97. }
  98. .itemHistory {
  99. margin: 0rpx 24rpx 20rpx;
  100. padding: 20rpx;
  101. background-color: #FFFFFF;
  102. border-radius: 10rpx;
  103. }
  104. .time {
  105. font-size: 24rpx;
  106. color: #999999;
  107. }
  108. .carPlate {
  109. margin: 20rpx 0rpx 15rpx;
  110. display: flex;
  111. align-items: center;
  112. justify-content: flex-start;
  113. }
  114. .plate {
  115. font-size: 30rpx;
  116. color: #3C3C3C;
  117. font-weight: bold;
  118. margin-right: 20rpx;
  119. }
  120. .mileage {
  121. font-size: 24rpx;
  122. color: #F19D01;
  123. padding: 0rpx 10rpx;
  124. border: 1rpx solid #F19D01;
  125. border-radius: 4rpx;
  126. height: 36rpx;
  127. }
  128. .shopName,
  129. .itemContent {
  130. color: #666666;
  131. font-size: 24rpx;
  132. margin: 15rpx 0rpx;
  133. /* 隐藏文字显示 ...不换行 */
  134. overflow: hidden;
  135. text-overflow: ellipsis;
  136. white-space: nowrap;
  137. }
  138. .noMore {
  139. text-align: center;
  140. line-height: 50rpx;
  141. color: #999999;
  142. font-size: 28rpx;
  143. }
  144. </style>