ownersinfo.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" >
  12. <view class="owelist">
  13. <view class="owelist-item" v-for="(item,index) in owelist" :key="item.id">
  14. <view class="item-header u-flex u-row-between">
  15. <view class="vehicle-no">{{item.vehicleNo}}</view>
  16. <view class="space-name">{{item.spaceName}}</view>
  17. </view>
  18. <view class="road-name u-flex">
  19. <u-icon name="map-fill" color="#3397FA" size="36"></u-icon>
  20. {{item.roadName}}
  21. </view>
  22. <view class="info-item">进场时间:{{item.inTime}}</view>
  23. <view class="info-item">出场时间:{{item.outTime}}</view>
  24. <view class="info-item">停车时长:{{item.duration}}</view>
  25. <view class="info-item">欠费金额:<span class="amount">{{item.payAmount}}元</span></view>
  26. </view>
  27. </view>
  28. </mescroll-body>
  29. <u-toast ref="uToast" />
  30. </view>
  31. </template>
  32. <script>
  33. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  34. export default{
  35. mixins: [MescrollMixin], // 使用mixin
  36. data(){
  37. return{
  38. orderID:'',
  39. listEmpty:false,
  40. owelist:[],
  41. pagination:Object.assign({}, {pageNo: 1,pageSize: 10}),
  42. }
  43. },
  44. onLoad(page){
  45. this.orderID = page.orderID;
  46. console.log('this.orderID',this.orderID)
  47. },
  48. onShow(){
  49. // this.owelist = [];
  50. // this.handleEntranceOutDetail();
  51. },
  52. onReachBottom() {
  53. // this.getData();
  54. console.log('111')
  55. },
  56. methods:{
  57. customBack(){
  58. this.$u.route({
  59. // type:'switchTab',
  60. url: 'pages/index/index'
  61. });
  62. },
  63. handleEntranceOutDetail(){
  64. uni.showLoading({});
  65. this.$u.api.entranceOutDetail({spaceId:this.orderID})
  66. .then(res=>{
  67. uni.hideLoading();
  68. // this.$refs.uToast.show({
  69. // title: res.msg,
  70. // type: 'success',
  71. // });
  72. this.leaveDetail = res.data;
  73. for (let item of res.data.oweList) {
  74. this.owelist.push(item)
  75. }
  76. if(this.owelist.length<=0){this.listEmpty = true};
  77. console.log('entranceOutDetail',res)
  78. }).catch(err=>{
  79. uni.hideLoading();
  80. this.$refs.uToast.show({
  81. title: err.msg,
  82. type: 'error',
  83. });
  84. console.log('entranceOutDetail ',err)
  85. });
  86. },
  87. downCallback(){
  88. this.mescroll.resetUpScroll();
  89. },
  90. upCallback(page){
  91. console.log('upCallback ',page);
  92. let pageNum = page.num; // 页码, 默认从1开始
  93. let pageSize = page.size; // 页长, 默认每页10条
  94. this.$u.api.entranceOutDetail({spaceId:this.orderID})
  95. .then(res=>{
  96. // uni.hideLoading();
  97. // this.$refs.uToast.show({
  98. // title: res.msg,
  99. // type: 'success',
  100. // });
  101. this.leaveDetail = res.data;
  102. for (let item of res.data.oweList) {
  103. this.owelist.push(item)
  104. }
  105. if(this.owelist.length<=0){this.listEmpty = true};
  106. console.log('entranceOutDetail',res)
  107. }).catch(err=>{
  108. // uni.hideLoading();
  109. this.$refs.uToast.show({
  110. title: err.msg,
  111. type: 'error',
  112. });
  113. console.log('entranceOutDetail ',err)
  114. });
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. @import './ownersinfo.scss'
  121. </style>