orderTrack.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <div class="order-detail">
  3. <!-- 取货中 -->
  4. <div class="picking-up">
  5. <!-- <div class="top-cancel" v-if="buttonStatus === -1 || buttonStatus === -2">
  6. <img src="../../../static/image/icon_warn.png" alt="" srcset="">
  7. {{showCancelType(trackOrder.cancelType)}}
  8. </div> -->
  9. <div class="top" v-if="
  10. (buttonStatus === 2 && riderArriveTime.riderArriveMinute) ||
  11. (buttonStatus === 3 && riderArriveTime.estimateArriveTime)
  12. ">
  13. <div class="top-l">
  14. <img src="../../../static/image/time-icon.png" class="time-icon" />
  15. <span class="top-tlt">骑手预计</span>
  16. </div>
  17. <span v-if="buttonStatus === 2" class="top-tlt-l">{{ riderArriveTime.riderArriveMinute }}分钟后到店取件</span>
  18. <span v-if="buttonStatus === 3" class="top-tlt-l">{{ riderArriveTime.estimateArriveTime }}送达</span>
  19. </div>
  20. <el-collapse v-model="activeNames">
  21. <el-collapse-item v-for="(v,i) in list" :key='i' :title="`第${list.length - i}次配送`" :name="i">
  22. <!-- 配送信息 ( 待接单无配送信息 ) -->
  23. <div class="send-info" v-if="v.deliveryName">
  24. <div class="send-tlt">配送信息</div>
  25. <div class="delivery">
  26. <img v-if="v.deliveryLogo" class="img" :src="v.deliveryLogo" alt="">
  27. <div class="con">
  28. <div class="delivery-top">
  29. <div class="left">{{v.shipperName}}</div>
  30. <div class="right">{{v.shipperPhone}}</div>
  31. </div>
  32. <div class="delivery-bot" v-if="v.customerPhone">
  33. <div class="left">{{v.deliveryName}}客服</div>
  34. <div class="right">{{ v.customerPhone }}</div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="label">
  39. <div class="label-tlt">接单时间:</div>
  40. <div class="label-right">
  41. <span>{{ shipperReceiveTime(v.itemList) }}</span>
  42. </div>
  43. </div>
  44. <div class="label">
  45. <div class="label-tlt">{{ v.deliveryName }}订单号:</div>
  46. <div class="label-right">
  47. <span>{{ v.outTradeNo }}</span>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- 发单信息 -->
  52. <div class="send-info">
  53. <div class="send-tlt">发单信息</div>
  54. <div class="label">
  55. <div class="label-tlt">支付金额:</div>
  56. <div class="label-right">
  57. <span>¥{{ v.payAmount }}</span>
  58. <!-- <div class="detail">明细</div> -->
  59. </div>
  60. </div>
  61. <div class="label">
  62. <div class="label-tlt">发单时间:</div>
  63. <div class="label-right">
  64. <span>{{ sendOrderTime(v.itemList) }}</span>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- 收件地址信息、配送进度 -->
  69. <div class="address-box">
  70. <div class="process">
  71. <el-timeline>
  72. <el-timeline-item class="p-item" v-for="(item, i) in v.itemList" :key="i" type="info" size="large" :icon="i ? 'el-icon-success' : 'el-icon-circle-check'">
  73. <div class="p-right">
  74. <div class="p-top">
  75. <span class="p-status">{{ item.orderStatus === -1 ? showCancelType(v.cancelType) : orderStatus(item.orderStatus) }}</span>
  76. <span class="p-time">{{ item.nodeTime }}</span>
  77. </div>
  78. <div class="p-bottom" v-if="item.orderStatus === 1">
  79. <span>20分钟内无骑手接单将自动取消订单</span>
  80. </div>
  81. <div class="p-bottom" v-if="item.orderStatus === 2">
  82. {{ v.deliveryName }}骑手
  83. <span class="has-driver">{{ v.shipperName }}({{
  84. v.shipperPhone
  85. }})</span>
  86. 已接单
  87. </div>
  88. <div class="p-bottom" v-if="item.orderStatus === 3 && buttonStatus === 3">
  89. <span class="send">正在派送中</span>
  90. </div>
  91. </div>
  92. </el-timeline-item>
  93. </el-timeline>
  94. </div>
  95. </div>
  96. </el-collapse-item>
  97. </el-collapse>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. export default {
  103. name: "orderTrack",
  104. props: {
  105. trackOrder: Object,
  106. buttonStatus: Number,
  107. riderArriveTime: Object,
  108. },
  109. data() {
  110. return {
  111. activeNames: 0,
  112. };
  113. },
  114. computed: {
  115. list() {
  116. return (
  117. this.trackOrder &&
  118. this.trackOrder.list &&
  119. this.$tool.deepClone(this.trackOrder.list)
  120. );
  121. },
  122. },
  123. methods: {
  124. sendOrderTime(itemList) {
  125. let data = itemList.find((v) => {
  126. return v.orderStatus === 5;
  127. });
  128. return (data && data.nodeTime) || "--";
  129. },
  130. shipperReceiveTime(itemList) {
  131. let data = itemList.find((v) => {
  132. return v.orderStatus === 2;
  133. });
  134. return (data && data.nodeTime) || "--";
  135. },
  136. showCancelType(type) {
  137. let name = "";
  138. switch (type) {
  139. case 1:
  140. name = "商家取消";
  141. break;
  142. case 2:
  143. name = "骑手取消";
  144. break;
  145. case 3:
  146. name = "系统取消";
  147. break;
  148. case 4:
  149. name = "用户取消";
  150. break;
  151. case 5:
  152. name = "平台取消";
  153. break;
  154. default:
  155. name = "已取消";
  156. break;
  157. }
  158. return name;
  159. },
  160. orderStatus(status) {
  161. let name = "";
  162. switch (status) {
  163. case -2:
  164. name = "异常单";
  165. break;
  166. case -1:
  167. name = "已取消";
  168. break;
  169. case 1:
  170. name = "发起配送";
  171. break;
  172. case 2:
  173. name = "骑手已接单";
  174. break;
  175. case 3:
  176. name = "骑手取件";
  177. break;
  178. case 4:
  179. name = "配送已完成";
  180. break;
  181. case 5:
  182. name = "支付成功";
  183. break;
  184. case 98:
  185. name = "其他平台完成";
  186. break;
  187. case 99:
  188. name = "外卖订单成功";
  189. break;
  190. case 0:
  191. name = "下单成功";
  192. break;
  193. default:
  194. name = "配送已完成";
  195. break;
  196. }
  197. return name;
  198. },
  199. },
  200. };
  201. </script>
  202. <style lang="scss" scoped>
  203. /deep/ .el-timeline {
  204. padding: 0 0 0 5px !important;
  205. }
  206. /deep/ .el-timeline-item__wrapper {
  207. width: 100%;
  208. }
  209. /deep/ .el-collapse-item__header {
  210. font-size: 14px !important;
  211. font-weight: bold !important;
  212. }
  213. .clearfix:after {
  214. content: "";
  215. font-size: 0;
  216. height: 0;
  217. display: block;
  218. clear: both;
  219. }
  220. .order-detail {
  221. width: 100%;
  222. box-sizing: border-box;
  223. padding: 16px 16px 80px;
  224. .picking-up {
  225. .top-cancel {
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. font-size: 13px;
  230. font-weight: bold;
  231. color: #fc7200;
  232. margin-bottom: 10px;
  233. img {
  234. width: 20px;
  235. height: 20px;
  236. margin-right: 5px;
  237. }
  238. }
  239. .top {
  240. display: flex;
  241. align-items: flex-start;
  242. justify-content: center;
  243. font-weight: bold;
  244. margin: 15px 0;
  245. .top-l {
  246. display: flex;
  247. align-items: center;
  248. .time-icon {
  249. width: 15px;
  250. height: 16px;
  251. }
  252. .top-tlt {
  253. flex-shrink: 0;
  254. margin: 0 6px;
  255. font-size: 14px;
  256. color: #00152a;
  257. line-height: 16px;
  258. }
  259. }
  260. .top-tlt-l {
  261. text-align: right;
  262. font-size: 14px;
  263. line-height: 16px;
  264. color: #009cff;
  265. }
  266. }
  267. .send-info {
  268. padding-bottom: 10px;
  269. margin-bottom: 20px;
  270. border-bottom: 2px dotted #f0f0f0;
  271. .send-tlt {
  272. font-size: 13px;
  273. font-weight: bold;
  274. color: #777;
  275. margin-bottom: 15px;
  276. }
  277. .delivery {
  278. display: flex;
  279. align-items: center;
  280. justify-content: space-between;
  281. margin-bottom: 10px;
  282. .img {
  283. flex-shrink: 0;
  284. width: 44px;
  285. height: 44px;
  286. background: rgba(255, 255, 255, 0.39);
  287. box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.16);
  288. border-radius: 8px;
  289. margin-right: 10px;
  290. }
  291. .con {
  292. flex: 1;
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: space-between;
  296. width: calc(100% - 54px);
  297. .delivery-top,
  298. .delivery-bot {
  299. display: flex;
  300. justify-content: space-between;
  301. align-items: center;
  302. font-size: 14px;
  303. line-height: 20px;
  304. color: #007aff;
  305. .left {
  306. max-width: 60%;
  307. overflow: hidden;
  308. white-space: nowrap;
  309. text-overflow: ellipsis;
  310. }
  311. }
  312. .delivery-bot {
  313. color: #999999;
  314. }
  315. }
  316. }
  317. .label {
  318. display: flex;
  319. justify-content: space-between;
  320. margin-bottom: 4px;
  321. .label-tlt {
  322. flex-shrink: 0;
  323. font-size: 14px;
  324. font-weight: 400;
  325. color: #999999;
  326. }
  327. .label-right {
  328. display: flex;
  329. flex-wrap: wrap;
  330. align-items: center;
  331. .detail {
  332. color: #fc7200;
  333. font-size: 14px;
  334. margin-left: 10px;
  335. cursor: pointer;
  336. }
  337. .send-logo {
  338. width: 16px;
  339. height: 16px;
  340. margin-right: 4px;
  341. }
  342. span {
  343. text-align: right;
  344. font-size: 14px;
  345. font-weight: 400;
  346. color: #333333;
  347. line-height: 20px;
  348. word-break: break-all;
  349. }
  350. }
  351. }
  352. }
  353. .address-box {
  354. padding-top: 20px;
  355. .address-info {
  356. display: flex;
  357. .address-icon {
  358. width: 21px;
  359. height: 22px;
  360. margin-right: 11px;
  361. }
  362. .address-content {
  363. word-break: break-all;
  364. font-size: 14px;
  365. font-weight: 600;
  366. color: #00152a;
  367. line-height: 20px;
  368. }
  369. }
  370. .process {
  371. .p-item {
  372. display: flex;
  373. padding-bottom: 30px;
  374. .p-left {
  375. margin-left: 6px;
  376. margin-right: 14px;
  377. .black-point {
  378. width: 9px;
  379. height: 10px;
  380. }
  381. }
  382. .p-right {
  383. flex: 1;
  384. .p-top {
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: flex-start;
  388. font-size: 14px;
  389. font-weight: 600;
  390. color: #00152a;
  391. margin-bottom: 6px;
  392. .p-status {
  393. flex-shrink: 0;
  394. line-height: 20px;
  395. }
  396. .p-time {
  397. margin-left: 10px;
  398. font-weight: normal;
  399. text-align: right;
  400. line-height: 20px;
  401. font-size: 12px;
  402. }
  403. }
  404. .p-bottom {
  405. font-size: 12px;
  406. font-weight: 400;
  407. color: #b1b1b1;
  408. .send {
  409. color: #fc7200;
  410. }
  411. .has-driver {
  412. color: #009cff;
  413. }
  414. }
  415. }
  416. }
  417. }
  418. }
  419. .button-list {
  420. padding-bottom: 15px;
  421. .btn-item {
  422. float: right;
  423. width: 74px;
  424. height: 30px;
  425. line-height: 30px;
  426. box-sizing: border-box;
  427. text-align: center;
  428. border-radius: 4px;
  429. font-size: 12px;
  430. cursor: pointer;
  431. }
  432. .add-tip {
  433. background-color: #fc7200;
  434. color: #fff;
  435. }
  436. .cancel {
  437. color: #888888;
  438. border: 1px solid #eee;
  439. }
  440. }
  441. }
  442. }
  443. </style>