route.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view class="content" :style="colorStyle">
  3. <!-- 订单列表 -->
  4. <view v-for="(item,index) in list" @click="navTo('./routeDetail?id='+item.id)">
  5. <!-- <view class="timeDay">
  6. {{items.time}}
  7. </view> -->
  8. <view class="routeItemBox">
  9. <view class="cartName acea-row row-between-wrapper">
  10. <view class="acea-row row-between-wrapper">
  11. <image class="cartImg" src="../static/cart.png" mode="scaleToFill">
  12. </image>
  13. <text class="carNameTitle">
  14. {{item.car.machine_name}}
  15. </text>
  16. </view>
  17. <view class="iconfont icon-xiangyou"></view>
  18. </view>
  19. <view class="routeItem acea-row row-between-wrapper">
  20. <!-- <view class="leftTime">
  21. <view>
  22. {{item.machine_no}}
  23. </view>
  24. </view> -->
  25. <view class="rightRoute acea-row row-between-wrapper">
  26. <view class="leftImg">
  27. <image src="../static/routeContent.png" mode="widthFix"></image>
  28. </view>
  29. <view class="rightConent">
  30. <view class="statusTitle">
  31. 起点:{{item.add_time}}
  32. </view>
  33. <view class="routeName line2">
  34. {{item.start_address}}
  35. </view>
  36. <view class="contentJg">
  37. </view>
  38. <view class="statusTitle">
  39. 终点:{{item.end_time}}
  40. </view>
  41. <view class="routeName line2 end">
  42. {{item.last_address}}
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="loadingicon acea-row row-center-wrapper font-color-white" v-if="list.length > 0">
  50. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  51. {{ loadTitle }}
  52. </view>
  53. <view v-if="list.length == 0">
  54. <emptyPage v-if="!loading" :title="$t(`暂无行程记录`)"></emptyPage>
  55. <view class="loadingicon acea-row row-center-wrapper">
  56. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {
  63. getOneinfo
  64. } from '@/api/rent.js';
  65. import colors from '@/mixins/color.js';
  66. import emptyPage from '@/components/emptyPage.vue';
  67. export default {
  68. data() {
  69. return {
  70. id: '', //保存车辆car_number
  71. loading: false, //是否加载中
  72. loadend: false, //是否加载完毕
  73. loadTitle: this.$t(`加载更多`), //提示语
  74. list: [], //订单数组
  75. page: 1,
  76. limit: 10
  77. };
  78. },
  79. components: {
  80. emptyPage
  81. },
  82. mixins: [colors],
  83. onLoad(options) {
  84. this.id = options.id || ''
  85. this.loadData();
  86. },
  87. methods: {
  88. navTo(url) {
  89. uni.navigateTo({
  90. url: url
  91. })
  92. },
  93. // 转换金额为数字
  94. // 确认收货
  95. //获取订单列表
  96. loadData() {
  97. let that = this;
  98. if (that.loadend) return;
  99. if (that.loading) return;
  100. that.loading = true;
  101. that.loadTitle = that.$t(`加载更多`);
  102. getOneinfo({
  103. type: "record",
  104. page: that.page,
  105. limit: that.limit,
  106. id: that.id
  107. })
  108. .then(res => {
  109. let list = res.data.list || [];
  110. let loadend = list.length < that.limit;
  111. that.list = that.$util.SplitArray(list, that.list);
  112. that.$set(that, 'list', that.list);
  113. that.loadend = loadend;
  114. that.loading = false;
  115. that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  116. that.page = that.page + 1;
  117. })
  118. .catch(err => {
  119. that.loading = false;
  120. that.loadTitle = that.$t(`加载更多`);
  121. });
  122. },
  123. }
  124. };
  125. </script>
  126. <style lang="scss">
  127. .content {
  128. background: var(--view-theme);
  129. height: 100vh;
  130. padding-top: 30rpx;
  131. }
  132. .list-scroll-content,
  133. .swiper-box {
  134. height: 100%;
  135. }
  136. .timeDay {
  137. font-size: 32rpx;
  138. font-weight: 400;
  139. padding: 30rpx;
  140. }
  141. .routeItemBox {
  142. background-color: #FFFFFF;
  143. border-radius: 20rpx;
  144. margin: 0 30rpx;
  145. margin-bottom: 30rpx;
  146. line-height: 1.5;
  147. .cartName {
  148. font-size: 32rpx;
  149. font-weight: 400;
  150. padding: 20rpx 30rpx;
  151. border-bottom: 1px solid $uni-border-color;
  152. .carNameTitle {
  153. padding-left: 20rpx;
  154. }
  155. .cartImg {
  156. width: 60rpx;
  157. height: 60rpx;
  158. }
  159. .iconRight {
  160. width: 26rpx;
  161. }
  162. }
  163. .detailRoute {
  164. color: var(--view-theme);
  165. font-weight: 100;
  166. margin: 0 30rpx;
  167. background-color: #F3F6F8;
  168. padding: 10rpx 30rpx;
  169. border-radius: 20rpx;
  170. image {
  171. width: 36rpx;
  172. font-size: 24rpx;
  173. }
  174. }
  175. .routeItem {
  176. align-items: flex-start;
  177. padding: 30rpx;
  178. .leftTime {
  179. width: 70rpx;
  180. margin: 50rpx;
  181. flex-shrink: 0;
  182. font-size: 24rpx;
  183. font-weight: 100;
  184. }
  185. .rightRoute {
  186. flex-grow: 1;
  187. // height: 262rpx;
  188. align-items: flex-start;
  189. .leftImg {
  190. image {
  191. width: 36rpx;
  192. }
  193. }
  194. .rightConent {
  195. padding-left: 20rpx;
  196. flex-grow: 1;
  197. .statusTitle {
  198. color: $uni-border-color;
  199. font-size: 22rpx;
  200. }
  201. .routeName {
  202. color: var(--view-theme);
  203. font-size: 28rpx;
  204. min-height: 2.5rem;
  205. margin-bottom: 15rpx;
  206. &.end {
  207. min-height: 1.5rem;
  208. margin-bottom: 0;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. </style>