recentOrder.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <!-- <text>这是最近订单</text> -->
  3. <view class="out">
  4. <view class="order-bottom">
  5. <view class="order-bottom-left" @click="choose(curPage=1)" :class="curPage==1?'active':''">
  6. 普通订单
  7. </view>
  8. <view class="order-bottom-right" @click="choose(curPage=2)" :class="curPage==2?'active':''">
  9. 日租订单
  10. </view>
  11. </view>
  12. <view class="order-list" v-for="(item,index) in order" @click="skipDetail" v-bind:data-index="index">
  13. <text class="order-bike-num">车辆编号:{{item.bike_no}}</text>
  14. <view class="order-user">
  15. <text class="order-user-name" style="overflow: hidden;">用户:{{item.nickname}}</text>
  16. <text class="order-user-phone">{{item.mobile}}</text>
  17. </view>
  18. <text class="order-time">时间:{{item.start_use_bike_time}}——{{item.end_use_bike_time}}</text>
  19. <view class="user-tag1" v-if="item.orders_status=='骑行中'" style="background: linear-gradient(163deg, #68e9ce 0%, #18d5b9 100%);">
  20. {{item.orders_status}}
  21. </view>
  22. <view class="user-tag1" v-if="item.orders_status=='订单关闭'" style="background: linear-gradient(163deg, #c0c0c0 0%, #808080 100%);">
  23. {{item.orders_status}}
  24. </view>
  25. <view class="user-tag1" v-if="item.orders_status=='已完成'" style="background: linear-gradient(163deg, #41b8fd 0%, #0ee7fe 100%);">
  26. {{item.orders_status}}
  27. </view>
  28. <view class="user-tag1" v-if="item.orders_status=='待支付'" style="background: linear-gradient(163deg,rgba(255, 139, 102, 1) 0%,rgba(254, 87, 34, 1) 100%);">
  29. {{item.orders_status}}
  30. </view>
  31. <view class="user-tag1" v-if="item.orders_status=='临时停车'" style="background: linear-gradient(163deg, #9382f4 0%, #a297fb 100%);">
  32. {{item.orders_status}}
  33. </view>
  34. <view class="user-tag1" v-if="item.orders_status=='租车中'" style="background: linear-gradient(163deg, #3648f5 0%, #a297fb 100%);">
  35. {{item.orders_status}}
  36. </view>
  37. <view class="user-tag1" v-if="item.orders_status=='租车结束,待支付'" style="background: linear-gradient(163deg, #32f955 0%, #a297fb 100%);">
  38. {{item.orders_status}}
  39. </view>
  40. </view>
  41. <view class="noData noOrder" v-if="order.length == 0" >
  42. <image src="http://resource.weilaibike.com/none.png"></image>
  43. <view style="color: black;">暂无相关数据~</view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. var app= getApp()
  49. export default{
  50. data(){
  51. return{
  52. order: [],
  53. links: null,
  54. id: '',
  55. curPage: 1,
  56. }
  57. },
  58. onLoad(options) {
  59. this.id=options.id
  60. this.getList()
  61. },
  62. methods:{
  63. getList() {
  64. uni.showLoading({
  65. title: '加载中...',
  66. })
  67. let url = '';
  68. if (this.curPage == 1) {
  69. url = 'bike/latelyOrders?page = 1';
  70. } else {
  71. url = 'bike/latelyOrderRent?page = 1'
  72. }
  73. let data = {
  74. bike_id: this.id
  75. }
  76. app.request(url, data, 'POST').then(res => {
  77. uni.hideLoading();
  78. if (res.statusCode == 200) {
  79. console.log(res);
  80. this.order=res.data.data,
  81. this.links=res.data.links.next
  82. }
  83. })
  84. },
  85. skipDetail:function(e){
  86. console.log(e,'这是订单详情')
  87. let index = e.currentTarget.dataset.index
  88. uni.navigateTo({
  89. url: '/pages/manage/orderDetail?id=' + this.order[index].id + '&index=' + this.curPage, //普通订单和日租订单
  90. })
  91. },
  92. choose:function(e){
  93. this.curPage=e
  94. this.getList()
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. @import url("/static/css/base.css");
  101. .order-bottom {
  102. width: 80%;
  103. height: 55rpx;
  104. line-height: 55rpx;
  105. margin: 0 auto;
  106. text-align: center;
  107. border: solid 1px #64efda;
  108. display: flex;
  109. border-radius: 15rpx;
  110. margin-top: 30rpx;
  111. }
  112. .order-user {
  113. display: flex;
  114. }
  115. .out{
  116. padding: 30rpx 30rpx;
  117. }
  118. .order-user-name,
  119. .order-user-phone {
  120. display: block;
  121. flex: 1;
  122. height: 60rpx;
  123. line-height: 60rpx;
  124. }
  125. .order-bottom-left,
  126. .order-bottom-right {
  127. flex: 1;
  128. color: #fff;
  129. background-color: #FFFFFF;
  130. height: 55rpx;
  131. width: 228rpx;
  132. color: #64efda;
  133. font-size: 28rpx;
  134. }
  135. .order-bottom-left {
  136. border-top-left-radius: 13rpx;
  137. border-bottom-left-radius: 13rpx;
  138. border-right: solid 1px #64efda;
  139. }
  140. .order-bottom-right {
  141. border-top-right-radius: 13rpx;
  142. border-bottom-right-radius: 13rpx;
  143. }
  144. .order-list {
  145. position: relative;
  146. clear: none;
  147. padding: 19rpx 40rpx;
  148. height: 159rpx;
  149. line-height: 50rpx;
  150. color: rgba(77, 77, 77, 1);
  151. margin-top: 27rpx;
  152. background: rgba(255, 255, 255, 1);
  153. font-size: 24rpx;
  154. box-shadow: 0px 0px 50px 0px rgba(216, 216, 216, 1);
  155. border-radius: 10px;
  156. }
  157. .user-balance {
  158. float: right;
  159. margin-right: 135rpx;
  160. }
  161. .user-tag,
  162. .user-tag1,
  163. .user-tag2,
  164. .user-tag3 {
  165. position: absolute;
  166. top: 0;
  167. right: 0;
  168. width: 158rpx;
  169. height: 42rpx;
  170. line-height: 42rpx;
  171. text-align: center;
  172. border-radius: 0px 10px 0px 20px;
  173. font-size: 24rpx;
  174. font-family: PingFang SC;
  175. font-weight: 400;
  176. color: rgba(255, 255, 255, 1);
  177. }
  178. .active {
  179. background-color: #64efda;
  180. color: #FFFFFF;
  181. }
  182. .user-tag1 {
  183. background-color: rgba(254, 87, 34, 1);
  184. /* box-shadow: 0px 0px 6px 0px rgba(254, 94, 44, 1); */
  185. }
  186. .user-tag2 {
  187. background-color: rgba(137, 40, 247, 1);
  188. box-shadow: 0px 0px 6px 0px rgba(137, 40, 247, 1);
  189. }
  190. .user-tag3 {
  191. background-color: rgba(100, 234, 224, 1);
  192. box-shadow: 0px 0px 6px 0px rgba(100, 234, 224, 1);
  193. }
  194. </style>