checkReport.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="box">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'车检报告'" ></homenav>
  4. <view class="screenBox">
  5. <picker @change="bindPickerChange" :value="index" :range="array">
  6. <view class="screenName">{{array[index]}}</view>
  7. </picker>
  8. </view>
  9. <view class="itemHistory" v-for="(item,index) in itemData" :key="index" @click="goDetail(item.id)">
  10. <view class="time">{{item.CreateTime}}</view>
  11. <view class="carPlate">
  12. <view class="plate">{{item.PlateNumber}}</view>
  13. <view class="mileage" v-if="item.currentMileage>0">{{item.currentMileage}}km</view>
  14. </view>
  15. <view class="shopName"v-if="item.carmodel">{{item.carmodel}}</view>
  16. <view class="itemContent">{{item.shopname}}</view>
  17. </view>
  18. <!-- 上拉 加载更多 -->
  19. <view class="noMore" v-if="noMoreShow && (itemData.length!=0)">没有更多数据</view>
  20. <!-- 无数据空白页 -->
  21. <nodata v-if="itemData.length==0"></nodata>
  22. </view>
  23. </template>
  24. <script>
  25. import homenav from "../../components/homenav/nav.vue"
  26. import nodata from '../../components/nodata/nodata.vue'
  27. export default {
  28. components: {
  29. nodata,homenav
  30. },
  31. data() {
  32. return {
  33. page: 1,
  34. itemData: [],
  35. noMoreShow: false,
  36. urlStr:'',
  37. iStatusBarHeight:'',
  38. array: [],
  39. index: 0,
  40. wxOpenData: '',
  41. plateNumber:'',
  42. }
  43. },
  44. onLoad() {
  45. /* uni.navigateTo({
  46. url: 'reportUni?id=6C977C54-575E-4F67-9101-7A6D74DDD8BA'
  47. }) */
  48. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  49. this.page = 1;
  50. this.myOrderCoupon();
  51. this.getplateNumber()
  52. //this.urlStr = this.$request.webUrl+'#/carOwner/index'
  53. },
  54. methods: {
  55. bindPickerChange: function(e) {
  56. console.log('picker发送选择改变,携带值为', e.detail)
  57. this.index = e.detail.value
  58. this.plateNumber=this.array[this.index]
  59. if(this.index==0){
  60. this.plateNumber=''
  61. }
  62. this.myOrderCoupon()
  63. },
  64. getplateNumber(){
  65. console.log("444")
  66. this.wxOpenData= this.$store.state.wxOpenData;
  67. this.$http('openweiXinCardInfoController/plateNumber-by-customerId', {
  68. customerId:this.wxOpenData.loginInfo.uid
  69. }, 'GET').then(res => {
  70. this.array=res.data.split(',')
  71. this.array.unshift('全部')
  72. })
  73. },
  74. goDetail(id) {
  75. // uni.navigateTo({
  76. // url: 'reportDetail?id=' + id
  77. // })
  78. uni.navigateTo({
  79. url: 'reportUni?id=' + id
  80. })
  81. },
  82. myOrderCoupon() {
  83. uni.showLoading({
  84. title: '加载中'
  85. })
  86. this.$http('opencheckSheet/getTestList', {
  87. plateNumber:this.plateNumber
  88. // page: this.page,
  89. // limit: 10,
  90. }, 'GET').then(res => {
  91. uni.hideLoading();
  92. // var list = res.data.Items
  93. var list = res.data
  94. // 处理 undefined和null转为空白字符串
  95. // list.forEach((item, index) => {
  96. // for (const key in item) {
  97. // item[key] = this.$praseStrEmpty(item[key])
  98. // }
  99. // })
  100. if (this.page == 1) {
  101. this.itemData = list
  102. } else {
  103. this.itemData = this.itemData.concat(list)
  104. }
  105. if (list.length < 10) {
  106. this.noMoreShow = true
  107. } else {
  108. this.noMoreShow = false
  109. }
  110. })
  111. },
  112. },
  113. // 下拉刷新 上拉加载更多
  114. onPullDownRefresh() {
  115. this.page = 1
  116. this.myOrderCoupon()
  117. setTimeout(function() {
  118. uni.stopPullDownRefresh();
  119. }, 1000);
  120. },
  121. onReachBottom() {
  122. // this.page++;
  123. this.myOrderCoupon()
  124. },
  125. }
  126. </script>
  127. <style>
  128. .box {
  129. min-height: 100vh;
  130. background-color: #F4F5F7;
  131. padding-top: 20rpx;
  132. }
  133. .screenBox{
  134. background: #FFFFFF;
  135. margin-bottom: 20rpx;
  136. }
  137. .screenName{
  138. padding: 24rpx;font-size: 28rpx;
  139. }
  140. .itemHistory {
  141. margin: 0rpx 24rpx 20rpx;
  142. padding: 20rpx;
  143. background-color: #FFFFFF;
  144. border-radius: 10rpx;
  145. }
  146. .time {
  147. font-size: 24rpx;
  148. color: #999999;
  149. }
  150. .carPlate {
  151. margin: 20rpx 0rpx 15rpx;
  152. display: flex;
  153. align-items: center;
  154. justify-content: flex-start;
  155. }
  156. .plate {
  157. font-size: 30rpx;
  158. color: #3C3C3C;
  159. font-weight: bold;
  160. margin-right: 20rpx;
  161. }
  162. .mileage {
  163. font-size: 24rpx;
  164. color: #F19D01;
  165. padding: 0rpx 10rpx;
  166. border: 1rpx solid #F19D01;
  167. border-radius: 4rpx;
  168. height: 36rpx;
  169. }
  170. .shopName{
  171. color: #666666;
  172. font-size: 24rpx;
  173. margin: 16rpx 0rpx;
  174. /* 隐藏文字显示 ...不换行 */
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. }
  179. .itemContent {
  180. color: #666666;
  181. font-size: 24rpx;
  182. /* 隐藏文字显示 ...不换行 */
  183. overflow: hidden;
  184. text-overflow: ellipsis;
  185. white-space: nowrap;
  186. }
  187. .noMore {
  188. text-align: center;
  189. line-height: 50rpx;
  190. color: #999999;
  191. font-size: 28rpx;
  192. }
  193. </style>