vehice.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view>
  3. <view class="search">
  4. <u-search placeholder="输入车辆名称" v-model="param.vehiclePlate" bgColor="white" @search="getByVehiclePlate()"
  5. @custom="getByVehiclePlate()" :showAction="true" @clear="refresh()"></u-search>
  6. <view class="clear"></view>
  7. </view>
  8. <view class="goodsList">
  9. <view class="item" v-for="(item, index) in vehiceList" :key="index">
  10. <view class="con">
  11. <view class="productName omit">{{ item.vehiclePlate }}</view>
  12. <view class="desc omit">{{item.vehicleModel}}</view>
  13. </view>
  14. <view>
  15. <button class="btn" @click="vehicleClick(item)">选择地址</button>
  16. </view>
  17. <view class="clear"></view>
  18. </view>
  19. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  20. <u-empty v-if="!loadMore && vehiceList.length == 0"></u-empty>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. param: {
  29. pageNo: 1,
  30. pageSize: 10
  31. },
  32. vehiceList: [],
  33. loadMore: true,
  34. vehice: {},
  35. address: {},
  36. }
  37. },
  38. onLoad(e) {
  39. this.getByVehiclePlate()
  40. console.log(e)
  41. if(e){
  42. this.vehice.tradeAreaId = item.tradeAreaId
  43. this.vehice.tradeAreaName = item.tradeAreaName
  44. this.vehice.enterpriseId = item.enterpriseId
  45. this.vehice.orderId = item.id
  46. }
  47. uni.$on('one-address', function(res) {
  48. this.address = res
  49. })
  50. this.informDriver()
  51. },
  52. methods: {
  53. // 车牌查询
  54. getByVehiclePlate() {
  55. // this.vehiceList = []
  56. this.param.vehiclePlate = ''
  57. this.http.request({
  58. url: '/transport-server/app/TbVehicle/getByVehiclePlate',
  59. loading: 'false',
  60. data: this.param,
  61. success: res => {
  62. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  63. if (res.data.data) {
  64. // this.vehiceList.push(...r);
  65. this.vehiceList = res.data.data
  66. }
  67. }
  68. });
  69. },
  70. // 车辆绑定
  71. vehicleClick(item) {
  72. this.vehice.driverId = item.driverId
  73. this.vehice.vehicleId = item.id
  74. uni.navigateTo({
  75. url: '/pages/market/one/merchant/address/address'
  76. })
  77. },
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. page {
  83. background-color: $pg;
  84. }
  85. .btn {
  86. height: 30px;
  87. margin: 8px 0px;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. }
  92. </style>