江西小程序管理端
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.

116 lines
2.4 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 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.params.schoolId = this.vuex_schoolId
  45. this.params.coachId = this.vuex_coachId
  46. this.carPageFn()
  47. },
  48. onPullDownRefresh() {
  49. this.list = []
  50. this.params.pageNo = 1
  51. this.carPageFn().then(()=>{uni.stopPullDownRefresh()})
  52. },
  53. onReachBottom() {
  54. if(this.total>this.list.length) {
  55. this.carPageFn()
  56. }
  57. },
  58. methods: {
  59. async carPageFn() {
  60. const {data: res} = await carPage(this.params)
  61. this.params.pageNo ++
  62. this.list.push(...res.list)
  63. this.total = res.total
  64. if(this.list.length>=this.total) this.status = 'nomore'
  65. console.log(res)
  66. },
  67. searchFn(val) {
  68. console.log(val)
  69. this.params.licnum = val
  70. this.list = []
  71. this.params.pageNo = 1
  72. this.carPageFn()
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .searcBox {
  79. padding: 24rpx 0;
  80. }
  81. .card {
  82. margin-bottom: 20rpx;
  83. .add {
  84. display: flex;
  85. align-items: center;
  86. justify-content: space-between;
  87. height: 108rpx;
  88. padding: 0 40rpx;
  89. .lab {
  90. font-size: 32rpx;
  91. color: #333;
  92. font-weight: 500;
  93. }
  94. .btnBg {
  95. width: 192rpx;
  96. }
  97. }
  98. .li {
  99. height: 100rpx;
  100. display: flex;
  101. align-items: center;
  102. justify-content: space-between;
  103. padding: 0 24rpx;
  104. .plate {
  105. color: $themC;
  106. font-weight: 500;
  107. }
  108. .name {
  109. color: #686B73;
  110. }
  111. }
  112. }
  113. </style>