orderDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view class="box">
  3. <map id="map" :longitude="longitude" :latitude="latitude" scale="14" :markers="markers" :polyline="polyline"></map>
  4. <view class="list1">
  5. <view style="display:flex;align-items:center;">
  6. <view class="order">
  7. <text>订单总计:{{detail.pay_money}}</text>
  8. <text>调度费用:{{detail.dispatch_money}}</text>
  9. </view>
  10. <view class="order">
  11. <text>订单状态:{{detail.order_status}}</text>
  12. <text>骑行费用:{{detail.time_money}}</text>
  13. </view>
  14. </view>
  15. <view @click="" hover-stop-propagation class="user">
  16. <text style="width:270rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;">用户:{{detail.nickname}}</text>
  17. <text @click="phoneCall(detail.mobile)">{{detail.mobile}}(点击可拨打)</text>
  18. </view>
  19. </view>
  20. <view class="discounts">
  21. <view>总优惠金额:{{detail.preferential_money}}</view>
  22. <view style="margin-top:10rpx;">优惠方式:{{detail.preferential_type_name}}</view>
  23. <!-- <view>
  24. <view>骑行卡优惠:{{detail.card_preferential_money!="0.00"?detail.card_preferential_money:'无优惠'}}</view>
  25. <view style="margin-top:10rpx;">优惠券优惠:{{detail.coupon_preferential_money!="0.00"?detail.coupon_preferential_money:'无优惠'}}</view>
  26. </view> -->
  27. </view>
  28. <view class="list2">
  29. <view>车辆编码:{{detail.bike_no}}</view>
  30. </view>
  31. <view class="list2">
  32. <view>开始时间:{{detail.start_use_bike_time}}</view>
  33. </view>
  34. <view class="list2">
  35. <view>结束时间:{{detail.end_use_bike_time}}</view>
  36. </view>
  37. <view class="list2">
  38. <view>备注:{{detail.remark?detail.remark:'无'}}</view>
  39. </view>
  40. <view class="table">
  41. <view class="tr">
  42. <view class="time">时间</view>
  43. <view class="operate">操作</view>
  44. </view>
  45. <block v-for="(item,index) in detail.walletLogs" :key='index'>
  46. <view class="tr">
  47. <view class="time">{{item.created_at}}</view>
  48. <view class="operate">{{item.name}}</view>
  49. </view>
  50. </block>
  51. <view class="noOperate flexC" v-if='detail.walletLogs==0'>暂无数据</view>
  52. </view>
  53. <view class="table">
  54. <view class="tr">
  55. <view class="time">时间</view>
  56. <view class="operate">操作</view>
  57. </view>
  58. <block v-for="(item,index1) in detail.order_bike_operates" :key='index1'>
  59. <view class="tr">
  60. <view class="time">{{item.created_at}}</view>
  61. <view class="operate">{{item.name}}</view>
  62. </view>
  63. </block>
  64. <view class="noOperate flexC" v-if='detail.order_bike_operates==0'>暂无数据</view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. var app=getApp()
  70. export default{
  71. data(){
  72. return{
  73. detail: [], //订单详情
  74. polyline: [], //折线
  75. longitude: 113.3245211,
  76. latitude: 23.10229,
  77. markers: [] //标记点
  78. }
  79. },
  80. onLoad(options) {
  81. uni.showLoading({
  82. title: '加载中...',
  83. })
  84. var url = '';
  85. if(options.index==1){
  86. url = 'order/detail'
  87. }
  88. if(options.index==2){
  89. url = 'orderRent/detail'
  90. }
  91. app.request(url+'?order_id=' + options.id, '', 'GET').then(res => { //普通订单和日租订单
  92. uni.hideLoading();
  93. console.log(res, '订单详情');
  94. this.detail=res.data
  95. if (
  96. res.data.orderLocations.length == 0 &&
  97. res.data.start_location.length == 0 &&
  98. res.data.end_location.length == 0
  99. ) {
  100. uni.showToast({
  101. title: '暂无骑行轨迹~',
  102. icon: 'none'
  103. })
  104. } else {
  105. let points = res.data.wx_orderLocations;
  106. let center = parseInt(points.length / 2);
  107. let obj = {};
  108. obj.points = points;
  109. obj.width = 4;
  110. obj.color = '#d56a23';
  111. obj.borderWidth = 3;
  112. obj.borderColor = '#d56a23';
  113. this.polyline=this.polyline.concat(obj)
  114. // console.log(self.data.polyline, '折线')
  115. //添加开始结束点
  116. if (points.length > 0) {
  117. var maker = [];
  118. maker = maker.concat(points[0]);
  119. maker = maker.concat(points[points.length - 1])
  120. for (var i = 0; i < maker.length; i++) {
  121. maker[i].width = 32;
  122. maker[i].height = 32;
  123. maker[i].zIndex = 1111;
  124. }
  125. //在地图上显示两个坐标
  126. // maker[0].iconPath = 'http://resource.bike.hanyiyun.com/weapp/start1.png'
  127. // maker[1].iconPath = 'http://resource.bike.hanyiyun.com/weapp/end1.png'
  128. maker[0].iconPath = '../../static/img/start1.png'
  129. maker[1].iconPath = '../../static/img/end1.png'
  130. this.markers=maker,
  131. this.longitude=points[center].longitude,
  132. this.latitude=points[center].latitude
  133. }
  134. }
  135. })
  136. },
  137. methods:{
  138. phoneCall:function(e){
  139. console.log(e,"这是电话号码")
  140. uni.makePhoneCall({
  141. phoneNumber: e
  142. })
  143. },
  144. }
  145. }
  146. </script>
  147. <style>
  148. @import url("/static/css/base.css");
  149. .map{
  150. width: 100%;
  151. height: 490rpx;
  152. margin-bottom: 24rpx;
  153. background-color: #0EE7FE;
  154. }
  155. page {
  156. width: 100%;
  157. background: #eee;
  158. }
  159. .box {
  160. width: 100%;
  161. display: flex;
  162. flex-direction: column;
  163. align-items: center;
  164. padding-bottom: 30rpx;
  165. }
  166. .box map {
  167. width: 100%;
  168. height: 490rpx;
  169. margin-bottom: 24rpx;
  170. }
  171. .box .list1 {
  172. height: 159rpx;
  173. display: flex;
  174. flex-direction: column;
  175. justify-content: center;
  176. }
  177. .discounts {
  178. /* height: 104rpx; */
  179. margin-top: 10rpx;
  180. padding: 15rpx 0 15rpx 30rpx;
  181. /* display: flex;
  182. align-items: center; */
  183. }
  184. /* .discounts>view {
  185. margin-top: 10rpx;
  186. width: 50%;
  187. } */
  188. .user {
  189. display: flex;
  190. align-items: center;
  191. margin-top: 10rpx;
  192. }
  193. .list1 {
  194. padding: 0 0 15rpx 30rpx;
  195. }
  196. .discounts,
  197. .list1 {
  198. width: 690rpx;
  199. background: rgba(255, 255, 255, 1);
  200. box-shadow: 0px 0px 13rpx 0px rgba(216, 216, 216, 1);
  201. border-radius: 10rpx;
  202. font-size: 26rpx;
  203. color: rgba(77, 77, 77, 1);
  204. opacity: 0.8;
  205. box-sizing: border-box;
  206. }
  207. .box .list2 {
  208. width: 690rpx;
  209. height: 88rpx;
  210. background: rgba(255, 255, 255, 1);
  211. box-shadow: 0px 0px 13rpx 0px rgba(216, 216, 216, 1);
  212. border-radius: 10rpx;
  213. margin-top: 10rpx;
  214. display: flex;
  215. align-items: center;
  216. font-size: 26rpx;
  217. color: rgba(77, 77, 77, 1);
  218. }
  219. .box .list2 view {
  220. padding-left: 30rpx;
  221. }
  222. .order {
  223. display: flex;
  224. flex-direction: column;
  225. width: 50%;
  226. }
  227. .order text {
  228. margin-top: 10rpx;
  229. }
  230. .table {
  231. margin-top: 10rpx;
  232. }
  233. .tr {
  234. padding: 5rpx 0;
  235. }
  236. .tr,
  237. .noOperate {
  238. background: #fff;
  239. display: flex;
  240. width: 690rpx;
  241. align-items: center;
  242. border-bottom: 1rpx solid #EBEEF5;
  243. }
  244. .tr:first-child {
  245. border-top-left-radius: 10rpx;
  246. border-top-right-radius: 10rpx;
  247. }
  248. .tr:last-child {
  249. border-bottom-left-radius: 10rpx;
  250. border-bottom-right-radius: 10rpx;
  251. }
  252. .time {
  253. width: 42%;
  254. text-align: center;
  255. border-right: 1rpx solid #EBEEF5;
  256. height: 100%;
  257. }
  258. .operate {
  259. width: 58%;
  260. line-height: 1.5;
  261. }
  262. .time,
  263. .operate {
  264. font-size: 24rpx;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. flex-wrap: wrap;
  269. padding: 13rpx 0;
  270. }
  271. .th {
  272. width: 50%;
  273. text-align: center;
  274. font-size: 28rpx;
  275. }
  276. .noOperate {
  277. font-size: 26rpx;
  278. height: 66rpx;
  279. }
  280. </style>