checkReport.vue 5.5 KB

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