driver.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="selSupplier">
  3. <view class="customer-ul">
  4. <view class="customer-li" v-for="(item, index) in driver_list" :key="index" @click="changeData(item)">
  5. <view class="customer-name">{{ item.driverName }}</view>
  6. <view class="other">
  7. <view class="concat clearfix">
  8. <text class="float_left">{{ item.plateNumber }}</text>
  9. <view class="float_right">
  10. <u-icon name="phone-fill" size="26"></u-icon>
  11. <text class="phone-text">{{ item.phone }}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <u-loadmore :status="load_status" />
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. driver_list: [],
  25. page: 1,
  26. pageSize: 10,
  27. total: 0,
  28. load_status: 'nomore',
  29. };
  30. },
  31. onLoad() {
  32. this.getAllDriver()
  33. },
  34. onPullDownRefresh() {
  35. this.getAllDriver()
  36. },
  37. // 上拉加载
  38. onReachBottom() {
  39. if (this.total / this.pageSize > this.page) {
  40. this.page += 1;
  41. this.getAllDriver()
  42. }
  43. },
  44. methods: {
  45. getAllDriver() {
  46. this.$u.api.getAllDriver({
  47. page: this.page,
  48. pageSize: this.pageSize,
  49. state: 5,
  50. }).then(res => {
  51. uni.stopPullDownRefresh();
  52. if (this.page === 1) {
  53. this.driver_list = res.data;
  54. } else {
  55. this.driver_list = this.driver_list.concat(res.data);
  56. }
  57. this.total = res.pageTotal;
  58. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  59. })
  60. },
  61. changeData(item) {
  62. // 选择返回上一页
  63. this._prePage().driverData = item;
  64. uni.navigateBack();
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .search-view {
  71. position: fixed;
  72. z-index: 99;
  73. top: 0;
  74. left: 0;
  75. width: 100%;
  76. background-color: #ffffff;
  77. border-bottom: 1px solid #f5f5f5;
  78. padding: 20rpx 0;
  79. .input-view {
  80. padding: 0 24rpx;
  81. input {
  82. height: 60rpx;
  83. line-height: 60rpx;
  84. padding: 0 24rpx;
  85. display: inline-block;
  86. width: 580rpx;
  87. border: 1px solid #f5f5f5;
  88. vertical-align: middle;
  89. border-radius: 8rpx;
  90. background-color: #f7f8fa;
  91. }
  92. .add-icon {
  93. margin-left: 14rpx;
  94. display: inline-block;
  95. vertical-align: middle;
  96. }
  97. }
  98. }
  99. .bottom-view {
  100. z-index: 99;
  101. width: 100%;
  102. position: fixed;
  103. left: 0;
  104. bottom: 0;
  105. line-height: 90rpx;
  106. color: #ffffff;
  107. background-color: $uni-color-primary;
  108. text-align: center;
  109. }
  110. .customer-ul {
  111. padding-bottom: 20rpx;
  112. .customer-li {
  113. width: 702rpx;
  114. margin: 0 auto;
  115. background-color: #ffffff;
  116. border-radius: 10rpx;
  117. margin-top: 20rpx;
  118. .customer-name {
  119. padding: 0 20rpx;
  120. line-height: 80rpx;
  121. border-bottom: 1px solid #f5f5f5;
  122. }
  123. .other {
  124. font-size: 24rpx;
  125. padding: 10rpx 20rpx;
  126. line-height: 50rpx;
  127. position: relative;
  128. .check-tag {
  129. position: absolute;
  130. left: 20rpx;
  131. top: 50%;
  132. transform: translateY(-50%);
  133. font-size: 40rpx;
  134. color: #999999;
  135. .custom-icon-xuanze_xuanzhong {
  136. color: $uni-color-primary;
  137. }
  138. }
  139. .concat {
  140. .float_right {
  141. color: $uni-color-primary;
  142. .phone-text {
  143. margin-left: 10rpx;
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }
  150. </style>