myOrderList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <view class="myOrder_itemView" v-for="(item,index) in orderList" @tap="goDetail(item)">
  4. <view class="flex justify-between align-center">
  5. <view class="item_title">正在寻找乘客</view>
  6. <view style="color: #346EF6;font-weight: bold;">进行中</view>
  7. </view>
  8. <view class="flex align-center" style="margin: 30rpx 0rpx 4rpx;">
  9. <image src="/static/upload/times.png" style="width: 28rpx;height: 28rpx;"></image>
  10. <view style="margin-left: 16rpx;" class="add_name">{{item.startTime}}</view>
  11. </view>
  12. <view class="flex align-center add_name" style="margin: 20rpx 6rpx 4rpx;">
  13. <view class="green"></view>{{item.shipCity}} {{item.shipAddress}}
  14. </view>
  15. <image src="/static/upload/up.png" class="order_up"></image>
  16. <view class="flex align-center add_name" style="margin-left: 6rpx;">
  17. <view class="orgin"></view>{{item.deliveryCity}} {{item.deliveryAddress}}
  18. </view>
  19. </view>
  20. <empty v-if="orderList.length == 0"></empty>
  21. </view>
  22. </template>
  23. <script>
  24. import empty from '@/components/empty'
  25. export default {
  26. components: {
  27. empty
  28. },
  29. data() {
  30. return {
  31. page: 1,
  32. limit: 10,
  33. orderList: [],
  34. indentNumber: ''
  35. }
  36. },
  37. onLoad(d) {
  38. if (d.indentNumber) {
  39. this.indentNumber = d.indentNumber;
  40. uni.setNavigationBarTitle({
  41. title: '选择行程'
  42. })
  43. }
  44. },
  45. onShow() {
  46. this.page = 1;
  47. this.getMyOrderList();
  48. },
  49. methods: {
  50. goDetail(item) {
  51. if (this.indentNumber != '') {
  52. uni.navigateTo({
  53. url: '/pages/index/orderDet?indentNumber=' + this.indentNumber + '&driverRouteId=' + item
  54. .driverRouteId
  55. })
  56. } else {
  57. uni.navigateTo({
  58. url: '/my/order/myOrderDetail?driverRouteId=' + item.driverRouteId
  59. });
  60. }
  61. },
  62. getMyOrderList() {
  63. this.$queue.showLoading('加载中...')
  64. this.$Request.getT('/app/driverRoute/selectDriverRouteListByUserId?page=' + this.page + '&limit=' + this
  65. .limit).then(res => {
  66. if (res.code == 0 && res.data) {
  67. if (this.page == 1) {
  68. this.orderList = res.data.records
  69. } else {
  70. this.orderList = [...this.orderList, ...res.data.records]
  71. }
  72. uni.hideLoading();
  73. uni.stopPullDownRefresh();
  74. }
  75. });
  76. },
  77. },
  78. // 上拉加载
  79. onReachBottom: function() {
  80. this.page = this.page + 1;
  81. this.getMyOrderList();
  82. },
  83. onPullDownRefresh: function() {
  84. this.page = 1;
  85. this.getMyOrderList();
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. page {
  91. background: #F5F5F5;
  92. }
  93. .myOrder_itemView {
  94. width: 686rpx;
  95. // height: 549rpx;
  96. background: #FFFFFF;
  97. border-radius: 32rpx;
  98. margin: 0 auto;
  99. margin-top: 20rpx;
  100. padding: 40rpx;
  101. }
  102. .item_title {
  103. font-family: Source Han Sans CN;
  104. font-weight: 600;
  105. font-size: 32rpx;
  106. color: #242424;
  107. }
  108. .order_up {
  109. width: 6rpx;
  110. height: 24rpx;
  111. margin-left: 12rpx;
  112. }
  113. .green {
  114. width: 16rpx;
  115. height: 16rpx;
  116. background: #1FC657;
  117. border-radius: 50%;
  118. margin-right: 20rpx;
  119. }
  120. .orgin {
  121. width: 16rpx;
  122. height: 16rpx;
  123. background: #FBAC04;
  124. border-radius: 50%;
  125. margin-right: 20rpx;
  126. }
  127. </style>