checkReport.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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" v-if="item.currentMileage>0">{{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. })
  69. },
  70. },
  71. // 下拉刷新 上拉加载更多
  72. onPullDownRefresh() {
  73. this.page = 1
  74. this.myOrderCoupon()
  75. setTimeout(function() {
  76. uni.stopPullDownRefresh();
  77. }, 1000);
  78. },
  79. onReachBottom() {
  80. // this.page++;
  81. this.myOrderCoupon()
  82. },
  83. }
  84. </script>
  85. <style>
  86. .box {
  87. min-height: 100vh;
  88. background-color: #F4F5F7;
  89. padding-top: 20rpx;
  90. }
  91. .itemHistory {
  92. margin: 0rpx 24rpx 20rpx;
  93. padding: 20rpx;
  94. background-color: #FFFFFF;
  95. border-radius: 10rpx;
  96. }
  97. .time {
  98. font-size: 24rpx;
  99. color: #999999;
  100. }
  101. .carPlate {
  102. margin: 20rpx 0rpx 15rpx;
  103. display: flex;
  104. align-items: center;
  105. justify-content: flex-start;
  106. }
  107. .plate {
  108. font-size: 30rpx;
  109. color: #3C3C3C;
  110. font-weight: bold;
  111. margin-right: 20rpx;
  112. }
  113. .mileage {
  114. font-size: 24rpx;
  115. color: #F19D01;
  116. padding: 0rpx 10rpx;
  117. border: 1rpx solid #F19D01;
  118. border-radius: 4rpx;
  119. height: 36rpx;
  120. }
  121. .shopName{
  122. color: #666666;
  123. font-size: 24rpx;
  124. margin: 16rpx 0rpx;
  125. /* 隐藏文字显示 ...不换行 */
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. white-space: nowrap;
  129. }
  130. .itemContent {
  131. color: #666666;
  132. font-size: 24rpx;
  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>