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

130 lines
2.7 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 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. <unbind v-if="identity== '实操教练'">
  17. <view class="li" >
  18. <view class="plate">{{item.licnum}}</view>
  19. <view class="name">{{item.manufacturer}}</view>
  20. </view>
  21. </unbind>
  22. <view class="li" v-else>
  23. <view class="plate">{{item.licnum}}</view>
  24. <view class="name">{{item.manufacturer}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view style="padding-bottom: 20rpx;" v-if="list.length">
  30. <u-loadmore :status="status" />
  31. </view>
  32. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  33. </view>
  34. </template>
  35. <script>
  36. import { carPage } from '@/config/api.js'
  37. import unbind from './comp/unbind.vue'
  38. export default {
  39. components: {
  40. unbind
  41. },
  42. data() {
  43. return {
  44. list: [],
  45. params: {
  46. pageNo: 1,
  47. pageSize: 20
  48. },
  49. total: 20,
  50. status: 'loading'
  51. }
  52. },
  53. onLoad() {
  54. this.params.schoolId = this.vuex_schoolId
  55. if(identity== '实操教练') {
  56. this.params.coachId = this.vuex_coachId
  57. }
  58. this.carPageFn()
  59. },
  60. onPullDownRefresh() {
  61. this.list = []
  62. this.params.pageNo = 1
  63. this.carPageFn().then(()=>{uni.stopPullDownRefresh()})
  64. },
  65. onReachBottom() {
  66. if(this.total>this.list.length) {
  67. this.carPageFn()
  68. }
  69. },
  70. methods: {
  71. async carPageFn() {
  72. const {data: res} = await carPage(this.params)
  73. this.params.pageNo ++
  74. this.list.push(...res.list)
  75. this.total = res.total
  76. if(this.list.length>=this.total) this.status = 'nomore'
  77. console.log(res)
  78. },
  79. searchFn(val) {
  80. console.log(val)
  81. this.params.licnum = val
  82. this.list = []
  83. this.params.pageNo = 1
  84. this.carPageFn()
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .searcBox {
  91. padding: 24rpx 0;
  92. }
  93. .card {
  94. margin-bottom: 20rpx;
  95. overflow: hidden;
  96. height: 100rpx;
  97. .add {
  98. display: flex;
  99. align-items: center;
  100. justify-content: space-between;
  101. height: 108rpx;
  102. padding: 0 40rpx;
  103. .lab {
  104. font-size: 32rpx;
  105. color: #333;
  106. font-weight: 500;
  107. }
  108. .btnBg {
  109. width: 192rpx;
  110. }
  111. }
  112. .li {
  113. height: 100rpx;
  114. display: flex;
  115. align-items: center;
  116. justify-content: space-between;
  117. padding: 0 24rpx;
  118. .plate {
  119. color: $themC;
  120. font-weight: 500;
  121. }
  122. .name {
  123. color: #686B73;
  124. }
  125. }
  126. }
  127. </style>