123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- <template>
- <div class="order-detail">
- <!-- 取货中 -->
- <div class="picking-up">
- <!-- <div class="top-cancel" v-if="buttonStatus === -1 || buttonStatus === -2">
- <img src="../../../static/image/icon_warn.png" alt="" srcset="">
- {{showCancelType(trackOrder.cancelType)}}
- </div> -->
- <div class="top" v-if="
- (buttonStatus === 2 && riderArriveTime.riderArriveMinute) ||
- (buttonStatus === 3 && riderArriveTime.estimateArriveTime)
- ">
- <div class="top-l">
- <img src="../../../static/image/time-icon.png" class="time-icon" />
- <span class="top-tlt">骑手预计</span>
- </div>
- <span v-if="buttonStatus === 2" class="top-tlt-l">{{ riderArriveTime.riderArriveMinute }}分钟后到店取件</span>
- <span v-if="buttonStatus === 3" class="top-tlt-l">{{ riderArriveTime.estimateArriveTime }}送达</span>
- </div>
- <el-collapse v-model="activeNames">
- <el-collapse-item v-for="(v,i) in list" :key='i' :title="`第${list.length - i}次配送`" :name="i">
- <!-- 配送信息 ( 待接单无配送信息 ) -->
- <div class="send-info" v-if="v.deliveryName">
- <div class="send-tlt">配送信息</div>
- <div class="delivery">
- <img v-if="v.deliveryLogo" class="img" :src="v.deliveryLogo" alt="">
- <div class="con">
- <div class="delivery-top">
- <div class="left">{{v.shipperName}}</div>
- <div class="right">{{v.shipperPhone}}</div>
- </div>
- <div class="delivery-bot" v-if="v.customerPhone">
- <div class="left">{{v.deliveryName}}客服</div>
- <div class="right">{{ v.customerPhone }}</div>
- </div>
- </div>
- </div>
- <div class="label">
- <div class="label-tlt">接单时间:</div>
- <div class="label-right">
- <span>{{ shipperReceiveTime(v.itemList) }}</span>
- </div>
- </div>
- <div class="label">
- <div class="label-tlt">{{ v.deliveryName }}订单号:</div>
- <div class="label-right">
- <span>{{ v.outTradeNo }}</span>
- </div>
- </div>
- </div>
- <!-- 发单信息 -->
- <div class="send-info">
- <div class="send-tlt">发单信息</div>
- <div class="label">
- <div class="label-tlt">支付金额:</div>
- <div class="label-right">
- <span>¥{{ v.payAmount }}</span>
- <!-- <div class="detail">明细</div> -->
- </div>
- </div>
- <div class="label">
- <div class="label-tlt">发单时间:</div>
- <div class="label-right">
- <span>{{ sendOrderTime(v.itemList) }}</span>
- </div>
- </div>
- </div>
- <!-- 收件地址信息、配送进度 -->
- <div class="address-box">
- <div class="process">
- <el-timeline>
- <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'">
- <div class="p-right">
- <div class="p-top">
- <span class="p-status">{{ item.orderStatus === -1 ? showCancelType(v.cancelType) : orderStatus(item.orderStatus) }}</span>
- <span class="p-time">{{ item.nodeTime }}</span>
- </div>
- <div class="p-bottom" v-if="item.orderStatus === 1">
- <span>20分钟内无骑手接单将自动取消订单</span>
- </div>
- <div class="p-bottom" v-if="item.orderStatus === 2">
- {{ v.deliveryName }}骑手
- <span class="has-driver">{{ v.shipperName }}({{
- v.shipperPhone
- }})</span>
- 已接单
- </div>
- <div class="p-bottom" v-if="item.orderStatus === 3 && buttonStatus === 3">
- <span class="send">正在派送中</span>
- </div>
- </div>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- </el-collapse-item>
- </el-collapse>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "orderTrack",
- props: {
- trackOrder: Object,
- buttonStatus: Number,
- riderArriveTime: Object,
- },
- data() {
- return {
- activeNames: 0,
- };
- },
- computed: {
- list() {
- return (
- this.trackOrder.list
- );
- },
- },
- methods: {
- sendOrderTime(itemList) {
- let data = itemList.find((v) => {
- return v.orderStatus === 5;
- });
- return (data && data.nodeTime) || "--";
- },
- shipperReceiveTime(itemList) {
- let data = itemList.find((v) => {
- return v.orderStatus === 2;
- });
- return (data && data.nodeTime) || "--";
- },
- showCancelType(type) {
- let name = "";
- switch (type) {
- case 1:
- name = "商家取消";
- break;
- case 2:
- name = "骑手取消";
- break;
- case 3:
- name = "系统取消";
- break;
- case 4:
- name = "用户取消";
- break;
- case 5:
- name = "平台取消";
- break;
- default:
- name = "已取消";
- break;
- }
- return name;
- },
- orderStatus(status) {
- let name = "";
- switch (status) {
- case -2:
- name = "异常单";
- break;
- case -1:
- name = "已取消";
- break;
- case 1:
- name = "发起配送";
- break;
- case 2:
- name = "骑手已接单";
- break;
- case 3:
- name = "骑手取件";
- break;
- case 4:
- name = "配送已完成";
- break;
- case 5:
- name = "支付成功";
- break;
- case 98:
- name = "其他平台完成";
- break;
- case 99:
- name = "外卖订单成功";
- break;
- case 0:
- name = "下单成功";
- break;
- default:
- name = "配送已完成";
- break;
- }
- return name;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- /deep/ .el-timeline {
- padding: 0 0 0 5px !important;
- }
- /deep/ .el-timeline-item__wrapper {
- width: 100%;
- }
- /deep/ .el-collapse-item__header {
- font-size: 14px !important;
- font-weight: bold !important;
- }
- .clearfix:after {
- content: "";
- font-size: 0;
- height: 0;
- display: block;
- clear: both;
- }
- .order-detail {
- width: 100%;
- box-sizing: border-box;
- padding: 16px 16px 80px;
- .picking-up {
- .top-cancel {
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 13px;
- font-weight: bold;
- color: #fc7200;
- margin-bottom: 10px;
- img {
- width: 20px;
- height: 20px;
- margin-right: 5px;
- }
- }
- .top {
- display: flex;
- align-items: flex-start;
- justify-content: center;
- font-weight: bold;
- margin: 15px 0;
- .top-l {
- display: flex;
- align-items: center;
- .time-icon {
- width: 15px;
- height: 16px;
- }
- .top-tlt {
- flex-shrink: 0;
- margin: 0 6px;
- font-size: 14px;
- color: #00152a;
- line-height: 16px;
- }
- }
- .top-tlt-l {
- text-align: right;
- font-size: 14px;
- line-height: 16px;
- color: #009cff;
- }
- }
- .send-info {
- padding-bottom: 10px;
- margin-bottom: 20px;
- border-bottom: 2px dotted #f0f0f0;
- .send-tlt {
- font-size: 13px;
- font-weight: bold;
- color: #777;
- margin-bottom: 15px;
- }
- .delivery {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10px;
- .img {
- flex-shrink: 0;
- width: 44px;
- height: 44px;
- background: rgba(255, 255, 255, 0.39);
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.16);
- border-radius: 8px;
- margin-right: 10px;
- }
- .con {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- width: calc(100% - 54px);
- .delivery-top,
- .delivery-bot {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 14px;
- line-height: 20px;
- color: #007aff;
- .left {
- max-width: 60%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .delivery-bot {
- color: #999999;
- }
- }
- }
- .label {
- display: flex;
- justify-content: space-between;
- margin-bottom: 4px;
- .label-tlt {
- flex-shrink: 0;
- font-size: 14px;
- font-weight: 400;
- color: #999999;
- }
- .label-right {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- .detail {
- color: #fc7200;
- font-size: 14px;
- margin-left: 10px;
- cursor: pointer;
- }
- .send-logo {
- width: 16px;
- height: 16px;
- margin-right: 4px;
- }
- span {
- text-align: right;
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- word-break: break-all;
- }
- }
- }
- }
- .address-box {
- padding-top: 20px;
- .address-info {
- display: flex;
- .address-icon {
- width: 21px;
- height: 22px;
- margin-right: 11px;
- }
- .address-content {
- word-break: break-all;
- font-size: 14px;
- font-weight: 600;
- color: #00152a;
- line-height: 20px;
- }
- }
- .process {
- .p-item {
- display: flex;
- padding-bottom: 30px;
- .p-left {
- margin-left: 6px;
- margin-right: 14px;
- .black-point {
- width: 9px;
- height: 10px;
- }
- }
- .p-right {
- flex: 1;
- .p-top {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- font-size: 14px;
- font-weight: 600;
- color: #00152a;
- margin-bottom: 6px;
- .p-status {
- flex-shrink: 0;
- line-height: 20px;
- }
- .p-time {
- margin-left: 10px;
- font-weight: normal;
- text-align: right;
- line-height: 20px;
- font-size: 12px;
- }
- }
- .p-bottom {
- font-size: 12px;
- font-weight: 400;
- color: #b1b1b1;
- .send {
- color: #fc7200;
- }
- .has-driver {
- color: #009cff;
- }
- }
- }
- }
- }
- }
- .button-list {
- padding-bottom: 15px;
- .btn-item {
- float: right;
- width: 74px;
- height: 30px;
- line-height: 30px;
- box-sizing: border-box;
- text-align: center;
- border-radius: 4px;
- font-size: 12px;
- cursor: pointer;
- }
- .add-tip {
- background-color: #fc7200;
- color: #fff;
- }
- .cancel {
- color: #888888;
- border: 1px solid #eee;
- }
- }
- }
- }
- </style>
|