owelist.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <u-navbar
  4. title="历史欠费"
  5. title-color="#fff"
  6. :custom-back="customBack"
  7. :border-bottom="false"
  8. back-icon-color="#CCE8FF"
  9. :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
  10. <u-empty class="u-m-t-50" text="很棒!没有欠费订单!" mode="list" v-if="listEmpty"></u-empty>
  11. <view class="owelist">
  12. <view class="owelist-item" v-for="(item,index) in owelist" :key="item.id">
  13. <view class="item-header u-flex u-row-between">
  14. <view class="vehicle-no">{{item.vehicleNo}}</view>
  15. <view class="space-name">{{item.spaceName}}</view>
  16. </view>
  17. <view class="road-name u-flex">
  18. <u-icon name="map-fill" color="#3397FA" size="36"></u-icon>
  19. {{item.roadName}}
  20. </view>
  21. <view class="info-item">进场时间:{{item.inTime}}</view>
  22. <view class="info-item">出场时间:{{item.outTime}}</view>
  23. <view class="info-item">停车时长:{{item.duration}}</view>
  24. <view class="info-item">欠费金额:<span class="amount">{{item.payAmount}}元</span></view>
  25. </view>
  26. </view>
  27. <u-toast ref="uToast" />
  28. </view>
  29. </template>
  30. <script>
  31. export default{
  32. data(){
  33. return{
  34. orderID:'',
  35. listEmpty:false,
  36. owelist:[],
  37. }
  38. },
  39. onLoad(page){
  40. this.orderID = page.orderID;
  41. console.log('this.orderID',this.orderID)
  42. },
  43. onShow(){
  44. this.handleEntranceOutDetail();
  45. },
  46. methods:{
  47. customBack(){
  48. this.$u.route({
  49. // type:'switchTab',
  50. url: 'pages/index/index'
  51. });
  52. },
  53. handleEntranceOutDetail(){
  54. uni.showLoading({});
  55. this.$u.api.entranceOutDetail({spaceId:this.orderID})
  56. .then(res=>{
  57. uni.hideLoading();
  58. // this.$refs.uToast.show({
  59. // title: res.msg,
  60. // type: 'success',
  61. // });
  62. this.leaveDetail = res.data;
  63. this.owelist = res.data.oweList;
  64. if(this.owelist?.length<=0||!this.owelist){this.listEmpty = true};
  65. console.log('entranceOutDetail',res)
  66. }).catch(err=>{
  67. uni.hideLoading();
  68. this.$refs.uToast.show({
  69. title: err.msg,
  70. type: 'error',
  71. });
  72. console.log('entranceOutDetail ',err)
  73. });
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. @import './owelist.scss'
  80. </style>