order.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="index">
  3. <view class="nav">
  4. <text class="t2" :class="{ t1: map.status == 'all' }" @tap="setMap('status', 'all')">全部</text>
  5. <text class="t2" :class="{ t1: map.status == 2 }" @tap="setMap('status', 2)">进行中</text>
  6. <text class="t2" :class="{ t1: map.status == 3 }" @tap="setMap('status', 3)">待支付</text>
  7. <text class="t2" :class="{ t1: map.status == 99 }" @tap="setMap('status', 99)">已完成</text>
  8. </view>
  9. <view class="center">
  10. <view class="orders" v-if="order.total > 0" v-for="(v, i) in order.data" :key="i" @tap="navigateTo('/pages/taxiService/taxiService?action=order&order_id=' + v.id)">
  11. <view class="top">
  12. <view class="input">
  13. <text class="icon gray">&#xe77c;</text>
  14. <text class="time">{{ v.createtime | date }}</text>
  15. </view>
  16. <text class="more icon gray">{{ v.status_text }}&#xe60f;</text>
  17. </view>
  18. <view class="left">
  19. <view class="input">
  20. <text class="icon green">&#xe608;</text>
  21. <text class="address">{{ v.start }}</text>
  22. </view>
  23. <view class="input">
  24. <text class="icon orange">&#xe608;</text>
  25. <text class="address">{{ v.end }}</text>
  26. </view>
  27. </view>
  28. <view class="right">¥{{ v.price }}元</view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import helper from '../../common/helper.js';
  35. import api from '../../common/api.js';
  36. export default {
  37. data() {
  38. return {
  39. map: {
  40. status: 'all',
  41. page: 1
  42. },
  43. order: {}
  44. };
  45. },
  46. filters: {
  47. date: value => {
  48. let date = new Date(value * 1000);
  49. let h = date.getHours();
  50. let m = date.getMinutes();
  51. return (h > 9 ? h : '0' + h) + ':' + (m > 9 ? m : '0' + m);
  52. }
  53. },
  54. onShow() {
  55. this.getList();
  56. },
  57. methods: {
  58. async getList() {
  59. let res = await api.getOrderList(this.map);
  60. this.order = res.data;
  61. uni.stopPullDownRefresh();
  62. },
  63. onPullDownRefresh() {
  64. this.map.page = 1;
  65. this.getList();
  66. },
  67. onReachBottom() {
  68. if (this.info.last_page > this.info.current_page) {
  69. this.getList();
  70. }
  71. },
  72. navigateTo(url) {
  73. uni.navigateTo({
  74. url: url
  75. });
  76. },
  77. setMap(key, value) {
  78. this.map[key] = value;
  79. this.map.page = 1;
  80. this.getList();
  81. }
  82. }
  83. };
  84. </script>
  85. <style lang="scss" scoped>
  86. page,
  87. .index {
  88. height: 100%;
  89. background-color: #fbfbfb;
  90. }
  91. .center {
  92. padding: 30upx;
  93. }
  94. .center1 {
  95. padding: 30upx;
  96. }
  97. .nav {
  98. display: flex;
  99. padding: 20upx;
  100. font-size: 28upx;
  101. background-color: #ffffff;
  102. .t1 {
  103. width: 48%;
  104. text-align: center;
  105. color: #32c45e;
  106. }
  107. .t2 {
  108. width: 48%;
  109. text-align: center;
  110. }
  111. .icon {
  112. font-size: 30upx;
  113. }
  114. }
  115. .orders {
  116. margin-bottom: 30upx;
  117. display: flex;
  118. padding: 20upx 20upx;
  119. border-radius: 10upx;
  120. box-shadow: 1px 1px 1px 1px #eaeaea;
  121. align-items: center;
  122. flex-wrap: wrap;
  123. align-items: center;
  124. justify-content: center;
  125. background-color: #ffffff;
  126. .icon {
  127. font-size: 48upx;
  128. }
  129. .top {
  130. width: 100%;
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. font-size: 24upx;
  135. .input {
  136. display: flex;
  137. align-items: center;
  138. color: #999999;
  139. }
  140. .more {
  141. font-size: 28upx;
  142. }
  143. }
  144. .left {
  145. width: 80%;
  146. .input {
  147. width: 100%;
  148. padding: 6upx 0;
  149. display: flex;
  150. align-items: center;
  151. .time {
  152. width: 70%;
  153. font-size: 25upx;
  154. color: #979797;
  155. }
  156. .address {
  157. width: 70%;
  158. font-size: 26upx;
  159. }
  160. }
  161. }
  162. .right {
  163. width: 20%;
  164. font-size: 26upx;
  165. color: #e51c23;
  166. button {
  167. width: 60%;
  168. background-color: #32c45e;
  169. margin-top: 20upx;
  170. border-radius: 50upx;
  171. padding: 0 10upx;
  172. font-size: 22upx;
  173. }
  174. }
  175. }
  176. .bottom {
  177. background-color: #ffffff;
  178. position: absolute;
  179. width: 100%;
  180. bottom: 0;
  181. height: 120upx;
  182. display: flex;
  183. align-items: center;
  184. justify-content: space-around;
  185. .item {
  186. display: flex;
  187. flex-direction: column;
  188. width: 33.33%;
  189. align-items: center;
  190. font-size: 24upx;
  191. .icon {
  192. font-size: 56upx;
  193. color: #999999;
  194. }
  195. }
  196. }
  197. .active {
  198. color: #32c45e !important;
  199. .icon {
  200. color: #32c45e !important;
  201. }
  202. }
  203. </style>