Index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">车辆消杀</text>
  6. </view>
  7. <view class="add" @click="addFn">+添加</view>
  8. </view>
  9. <view>
  10. <uni-list>
  11. <uni-list-item v-for="(item,index) in list" :title="item.carNo"
  12. :note="item.adminConfirmInput==1?'已确认':'未确认'" :rightText="item.createTime" clickable @click="toDetail(item)"/>
  13. </uni-list>
  14. </view>
  15. <noData v-if="list.length==0"></noData>
  16. <u-loadmore style="margin: 30rpx;" :status="status" />
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. status: 'loadmore',
  24. list: [],
  25. p: {
  26. pageNo: 1,
  27. pageSize: 10,
  28. dataCount: 0,
  29. adminConfirmInput: -1,
  30. }
  31. }
  32. },
  33. onLoad() {
  34. this.getCarDisinFect();
  35. },
  36. methods: {
  37. toDetail(data){
  38. this.$common.to('/pages/onely-disinfect/disinfect-Index?json='+JSON.stringify(data))
  39. },
  40. addFn() {
  41. this.$common.to('/pages/onely-disinfect/disinfect-Index')
  42. },
  43. getCarDisinFect() {
  44. this.$api.getCarDisinFect(this.p).then(resp => {
  45. this.list = resp.data;
  46. this.p.dataCount=resp.dataCount;
  47. this.p.pageNo=resp.pageNo;
  48. this.p.pageSize=resp.pageSize
  49. })
  50. }
  51. },
  52. //上拉加载更多,分页模拟数据
  53. onReachBottom() {
  54. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  55. this.status = 'loading';
  56. this.p.pageSize += 5;
  57. this.getCarDisinFect();
  58. } else {
  59. this.status = 'nomore';
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. page {
  66. background-color: #fff;
  67. }
  68. .add {
  69. position: absolute;
  70. right: 40rpx;
  71. top: -60rpx;
  72. z-index: 999;
  73. border: 1rpx solid #359aff;
  74. border-radius: 8rpx;
  75. color: #c8e4ff;
  76. padding: 10rpx 20rpx;
  77. font-size: 28rpx;
  78. }
  79. @import '@/common/common.scss'
  80. </style>