江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.3 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="我的车辆"></topNavbar>
  4. <view class="pad">
  5. <view class="searcBox">
  6. <searchRow placeholder="搜索车牌号" @searchFn="searchFn"></searchRow>
  7. </view>
  8. <!-- <view class="card" style="margin-bottom: 24rpx;">
  9. <view class="add">
  10. <view class="lab">新增车辆</view>
  11. <view class="btnBg">立即新增</view>
  12. </view>
  13. </view> -->
  14. <view class="ul">
  15. <view class="card" v-for="(item,index) in list" :key="index">
  16. <view class="li" >
  17. <view class="plate">{{item.licnum}}</view>
  18. <view class="name">{{item.manufacturer}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view style="padding-bottom: 20rpx;" v-if="list.length">
  24. <u-loadmore :status="status" />
  25. </view>
  26. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  27. </view>
  28. </template>
  29. <script>
  30. import { carPage } from '@/config/api.js'
  31. export default {
  32. data() {
  33. return {
  34. list: [],
  35. params: {
  36. pageNo: 1,
  37. pageSize: 20
  38. },
  39. total: 20,
  40. status: 'loading'
  41. }
  42. },
  43. onLoad() {
  44. this.carPageFn()
  45. },
  46. onPullDownRefresh() {
  47. this.list = []
  48. this.params.pageNo = 1
  49. this.carPageFn().then(()=>{uni.stopPullDownRefresh()})
  50. },
  51. onReachBottom() {
  52. if(this.total>this.list.length) {
  53. this.carPageFn()
  54. }
  55. },
  56. methods: {
  57. async carPageFn() {
  58. const {data: res} = await carPage(this.params)
  59. this.params.pageNo ++
  60. this.list.push(...res.list)
  61. this.total = res.total
  62. if(this.list.length>=this.total) this.status = 'nomore'
  63. console.log(res)
  64. },
  65. searchFn(val) {
  66. console.log(val)
  67. this.params.licnum = val
  68. this.list = []
  69. this.params.pageNo = 1
  70. this.carPageFn()
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .searcBox {
  77. padding: 24rpx 0;
  78. }
  79. .card {
  80. margin-bottom: 20rpx;
  81. .add {
  82. display: flex;
  83. align-items: center;
  84. justify-content: space-between;
  85. height: 108rpx;
  86. padding: 0 40rpx;
  87. .lab {
  88. font-size: 32rpx;
  89. color: #333;
  90. font-weight: 500;
  91. }
  92. .btnBg {
  93. width: 192rpx;
  94. }
  95. }
  96. .li {
  97. height: 100rpx;
  98. display: flex;
  99. align-items: center;
  100. justify-content: space-between;
  101. padding: 0 24rpx;
  102. .plate {
  103. color: $themC;
  104. font-weight: 500;
  105. }
  106. .name {
  107. color: #686B73;
  108. }
  109. }
  110. }
  111. </style>