myOrderList.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 v-if="globalImages" :src="globalImages + 'imgs/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 v-if="globalImages" :src="globalImages + 'imgs/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 { waitForGlobalImages } from '@/utils/globalImageLoader'
  25. import empty from '@/components/empty'
  26. export default {
  27. components: {
  28. empty
  29. },
  30. data() {
  31. return {
  32. page: 1,
  33. limit: 10,
  34. orderList: [],
  35. indentNumber: '',
  36. globalImages: '',
  37. }
  38. },
  39. onLoad(d) {
  40. waitForGlobalImages().then((path) => {
  41. console.log('✅ 全局图片路径:', path)
  42. this.globalImages = path
  43. })
  44. if (d.indentNumber) {
  45. this.indentNumber = d.indentNumber;
  46. uni.setNavigationBarTitle({
  47. title: '选择行程'
  48. })
  49. }
  50. },
  51. onShow() {
  52. this.page = 1;
  53. this.getMyOrderList();
  54. },
  55. methods: {
  56. goDetail(item) {
  57. if (this.indentNumber != '') {
  58. uni.navigateTo({
  59. url: '/pages/index/orderDet?indentNumber=' + this.indentNumber + '&driverRouteId=' + item
  60. .driverRouteId
  61. })
  62. } else {
  63. uni.navigateTo({
  64. url: '/my/order/myOrderDetail?driverRouteId=' + item.driverRouteId
  65. });
  66. }
  67. },
  68. getMyOrderList() {
  69. this.$queue.showLoading('加载中...')
  70. this.$Request.getT('/app/driverRoute/selectDriverRouteListByUserId?page=' + this.page + '&limit=' + this
  71. .limit).then(res => {
  72. if (res.code == 0 && res.data) {
  73. if (this.page == 1) {
  74. this.orderList = res.data.records
  75. } else {
  76. this.orderList = [...this.orderList, ...res.data.records]
  77. }
  78. uni.hideLoading();
  79. uni.stopPullDownRefresh();
  80. }
  81. });
  82. },
  83. },
  84. // 上拉加载
  85. onReachBottom: function() {
  86. this.page = this.page + 1;
  87. this.getMyOrderList();
  88. },
  89. onPullDownRefresh: function() {
  90. this.page = 1;
  91. this.getMyOrderList();
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background: #F5F5F5;
  98. }
  99. .myOrder_itemView {
  100. width: 686rpx;
  101. // height: 549rpx;
  102. background: #FFFFFF;
  103. border-radius: 32rpx;
  104. margin: 0 auto;
  105. margin-top: 20rpx;
  106. padding: 40rpx;
  107. }
  108. .item_title {
  109. font-family: Source Han Sans CN;
  110. font-weight: 600;
  111. font-size: 32rpx;
  112. color: #242424;
  113. }
  114. .order_up {
  115. width: 6rpx;
  116. height: 24rpx;
  117. margin-left: 12rpx;
  118. }
  119. .green {
  120. width: 16rpx;
  121. height: 16rpx;
  122. background: #1FC657;
  123. border-radius: 50%;
  124. margin-right: 20rpx;
  125. }
  126. .orgin {
  127. width: 16rpx;
  128. height: 16rpx;
  129. background: #FBAC04;
  130. border-radius: 50%;
  131. margin-right: 20rpx;
  132. }
  133. </style>