historyOrder.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="out">
  3. <view class="order-bottom">
  4. <view class="order-bottom-left" @click="choose(curPage=1)" :class="curPage==1?'active':''">
  5. 普通订单
  6. </view>
  7. <view class="order-bottom-right" @click="choose(curPage=2)" :class="curPage==2?'active':''">
  8. 日租订单
  9. </view>
  10. </view>
  11. <view class="order-list" v-for="(item,index) in order" @click="detail" v-bind:data-id="item.id">
  12. <text class="order-bike-num">车辆编号:{{item.bike_no}}</text>
  13. <view class="order-user">
  14. <text class="order-user-name" style="overflow: hidden;">用户:{{item.nickname}}</text>
  15. <text class="order-user-phone">{{item.mobile}}</text>
  16. </view>
  17. <text class="order-time">时间:{{item.start_use_bike_time}}</text>
  18. <view class="user-tag1" v-if="item.orders_status=='骑行中'" style="background: linear-gradient(163deg, #68e9ce 0%, #18d5b9 100%);">
  19. {{item.orders_status}}
  20. </view>
  21. <view class="user-tag1" v-if="item.orders_status=='订单关闭'" style="background: linear-gradient(163deg, #c0c0c0 0%, #808080 100%);">
  22. {{item.orders_status}}
  23. </view>
  24. <view class="user-tag1" v-if="item.orders_status=='已完成'" style="background: linear-gradient(163deg, #41b8fd 0%, #0ee7fe 100%);">
  25. {{item.orders_status}}
  26. </view>
  27. <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%);">
  28. {{item.orders_status}}
  29. </view>
  30. <view class="user-tag1" v-if="item.orders_status=='临时停车'" style="background: linear-gradient(163deg, #9382f4 0%, #a297fb 100%);">
  31. {{item.orders_status}}
  32. </view>
  33. <view class="user-tag1" v-if="item.orders_status=='租车中'" style="background: linear-gradient(163deg, #3648f5 0%, #a297fb 100%);">
  34. {{item.orders_status}}
  35. </view>
  36. <view class="user-tag1" v-if="item.orders_status=='租车结束,待支付'" style="background: linear-gradient(163deg, #32f955 0%, #a297fb 100%);">
  37. {{item.orders_status}}
  38. </view>
  39. </view>
  40. <view class="noData noOrder" v-if="order.length == 0" >
  41. <image src="http://resource.weilaibike.com/none.png"></image>
  42. <view style="color: black;">暂无相关数据~</view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. var app = getApp()
  48. export default {
  49. data() {
  50. return {
  51. order: [],
  52. links: '',
  53. user_id: '',
  54. curPage: 1,
  55. }
  56. },
  57. onLoad(options) {
  58. this.user_id= options.id
  59. this.getList();
  60. },
  61. methods:{
  62. //获取列表
  63. getList() {
  64. uni.showLoading({
  65. title: '加载中...',
  66. })
  67. let url = "";
  68. if (this.curPage == 1) {
  69. url = 'user/order?page = 1';
  70. } else {
  71. url = 'user/orderRent?page = 1'
  72. }
  73. let data = {
  74. user_id: this.user_id
  75. }
  76. app.request(url, data, 'GET').then(res => {
  77. uni.hideLoading();
  78. if (res.statusCode == 200) {
  79. this.order= res.data.data,
  80. this.links= res.data.links.next
  81. }
  82. })
  83. },
  84. //切换日租月租订单
  85. choose:function(e){
  86. this.curPage=e
  87. this.getList()
  88. console.log(e,"这是点击日租之后")
  89. },
  90. detail:function(e){
  91. console.log(e.currentTarget.dataset.id,'跳转用骑行轨迹')
  92. uni.navigateTo({
  93. url: '/pages/manage/orderDetail?id=' + e.currentTarget.dataset.id +"&index=" + this.curPage,
  94. })
  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: 30rpx;
  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>