orderTrack.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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.list
  118. );
  119. },
  120. },
  121. methods: {
  122. sendOrderTime(itemList) {
  123. let data = itemList.find((v) => {
  124. return v.orderStatus === 5;
  125. });
  126. return (data && data.nodeTime) || "--";
  127. },
  128. shipperReceiveTime(itemList) {
  129. let data = itemList.find((v) => {
  130. return v.orderStatus === 2;
  131. });
  132. return (data && data.nodeTime) || "--";
  133. },
  134. showCancelType(type) {
  135. let name = "";
  136. switch (type) {
  137. case 1:
  138. name = "商家取消";
  139. break;
  140. case 2:
  141. name = "骑手取消";
  142. break;
  143. case 3:
  144. name = "系统取消";
  145. break;
  146. case 4:
  147. name = "用户取消";
  148. break;
  149. case 5:
  150. name = "平台取消";
  151. break;
  152. default:
  153. name = "已取消";
  154. break;
  155. }
  156. return name;
  157. },
  158. orderStatus(status) {
  159. let name = "";
  160. switch (status) {
  161. case -2:
  162. name = "异常单";
  163. break;
  164. case -1:
  165. name = "已取消";
  166. break;
  167. case 1:
  168. name = "发起配送";
  169. break;
  170. case 2:
  171. name = "骑手已接单";
  172. break;
  173. case 3:
  174. name = "骑手取件";
  175. break;
  176. case 4:
  177. name = "配送已完成";
  178. break;
  179. case 5:
  180. name = "支付成功";
  181. break;
  182. case 98:
  183. name = "其他平台完成";
  184. break;
  185. case 99:
  186. name = "外卖订单成功";
  187. break;
  188. case 0:
  189. name = "下单成功";
  190. break;
  191. default:
  192. name = "配送已完成";
  193. break;
  194. }
  195. return name;
  196. },
  197. },
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. /deep/ .el-timeline {
  202. padding: 0 0 0 5px !important;
  203. }
  204. /deep/ .el-timeline-item__wrapper {
  205. width: 100%;
  206. }
  207. /deep/ .el-collapse-item__header {
  208. font-size: 14px !important;
  209. font-weight: bold !important;
  210. }
  211. .clearfix:after {
  212. content: "";
  213. font-size: 0;
  214. height: 0;
  215. display: block;
  216. clear: both;
  217. }
  218. .order-detail {
  219. width: 100%;
  220. box-sizing: border-box;
  221. padding: 16px 16px 80px;
  222. .picking-up {
  223. .top-cancel {
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. font-size: 13px;
  228. font-weight: bold;
  229. color: #fc7200;
  230. margin-bottom: 10px;
  231. img {
  232. width: 20px;
  233. height: 20px;
  234. margin-right: 5px;
  235. }
  236. }
  237. .top {
  238. display: flex;
  239. align-items: flex-start;
  240. justify-content: center;
  241. font-weight: bold;
  242. margin: 15px 0;
  243. .top-l {
  244. display: flex;
  245. align-items: center;
  246. .time-icon {
  247. width: 15px;
  248. height: 16px;
  249. }
  250. .top-tlt {
  251. flex-shrink: 0;
  252. margin: 0 6px;
  253. font-size: 14px;
  254. color: #00152a;
  255. line-height: 16px;
  256. }
  257. }
  258. .top-tlt-l {
  259. text-align: right;
  260. font-size: 14px;
  261. line-height: 16px;
  262. color: #009cff;
  263. }
  264. }
  265. .send-info {
  266. padding-bottom: 10px;
  267. margin-bottom: 20px;
  268. border-bottom: 2px dotted #f0f0f0;
  269. .send-tlt {
  270. font-size: 13px;
  271. font-weight: bold;
  272. color: #777;
  273. margin-bottom: 15px;
  274. }
  275. .delivery {
  276. display: flex;
  277. align-items: center;
  278. justify-content: space-between;
  279. margin-bottom: 10px;
  280. .img {
  281. flex-shrink: 0;
  282. width: 44px;
  283. height: 44px;
  284. background: rgba(255, 255, 255, 0.39);
  285. box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.16);
  286. border-radius: 8px;
  287. margin-right: 10px;
  288. }
  289. .con {
  290. flex: 1;
  291. display: flex;
  292. flex-direction: column;
  293. justify-content: space-between;
  294. width: calc(100% - 54px);
  295. .delivery-top,
  296. .delivery-bot {
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. font-size: 14px;
  301. line-height: 20px;
  302. color: #007aff;
  303. .left {
  304. max-width: 60%;
  305. overflow: hidden;
  306. white-space: nowrap;
  307. text-overflow: ellipsis;
  308. }
  309. }
  310. .delivery-bot {
  311. color: #999999;
  312. }
  313. }
  314. }
  315. .label {
  316. display: flex;
  317. justify-content: space-between;
  318. margin-bottom: 4px;
  319. .label-tlt {
  320. flex-shrink: 0;
  321. font-size: 14px;
  322. font-weight: 400;
  323. color: #999999;
  324. }
  325. .label-right {
  326. display: flex;
  327. flex-wrap: wrap;
  328. align-items: center;
  329. .detail {
  330. color: #fc7200;
  331. font-size: 14px;
  332. margin-left: 10px;
  333. cursor: pointer;
  334. }
  335. .send-logo {
  336. width: 16px;
  337. height: 16px;
  338. margin-right: 4px;
  339. }
  340. span {
  341. text-align: right;
  342. font-size: 14px;
  343. font-weight: 400;
  344. color: #333333;
  345. line-height: 20px;
  346. word-break: break-all;
  347. }
  348. }
  349. }
  350. }
  351. .address-box {
  352. padding-top: 20px;
  353. .address-info {
  354. display: flex;
  355. .address-icon {
  356. width: 21px;
  357. height: 22px;
  358. margin-right: 11px;
  359. }
  360. .address-content {
  361. word-break: break-all;
  362. font-size: 14px;
  363. font-weight: 600;
  364. color: #00152a;
  365. line-height: 20px;
  366. }
  367. }
  368. .process {
  369. .p-item {
  370. display: flex;
  371. padding-bottom: 30px;
  372. .p-left {
  373. margin-left: 6px;
  374. margin-right: 14px;
  375. .black-point {
  376. width: 9px;
  377. height: 10px;
  378. }
  379. }
  380. .p-right {
  381. flex: 1;
  382. .p-top {
  383. display: flex;
  384. justify-content: space-between;
  385. align-items: flex-start;
  386. font-size: 14px;
  387. font-weight: 600;
  388. color: #00152a;
  389. margin-bottom: 6px;
  390. .p-status {
  391. flex-shrink: 0;
  392. line-height: 20px;
  393. }
  394. .p-time {
  395. margin-left: 10px;
  396. font-weight: normal;
  397. text-align: right;
  398. line-height: 20px;
  399. font-size: 12px;
  400. }
  401. }
  402. .p-bottom {
  403. font-size: 12px;
  404. font-weight: 400;
  405. color: #b1b1b1;
  406. .send {
  407. color: #fc7200;
  408. }
  409. .has-driver {
  410. color: #009cff;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. .button-list {
  418. padding-bottom: 15px;
  419. .btn-item {
  420. float: right;
  421. width: 74px;
  422. height: 30px;
  423. line-height: 30px;
  424. box-sizing: border-box;
  425. text-align: center;
  426. border-radius: 4px;
  427. font-size: 12px;
  428. cursor: pointer;
  429. }
  430. .add-tip {
  431. background-color: #fc7200;
  432. color: #fff;
  433. }
  434. .cancel {
  435. color: #888888;
  436. border: 1px solid #eee;
  437. }
  438. }
  439. }
  440. }
  441. </style>