|
|
@@ -14,16 +14,16 @@
|
|
|
<view class="status-desc" v-if="getStatusDesc()">{{ getStatusDesc() }}</view>
|
|
|
|
|
|
<!-- 取货/收货码 (部分平台有) -->
|
|
|
- <view class="codes-row" v-if="detail.fetch_code || detail.pickupPassword || detail.pickup_code">
|
|
|
- <view class="code-item" v-if="detail.fetch_code || detail.pickupPassword || detail.pickup_code">
|
|
|
+ <view class="codes-row" v-if="detail.fetch_code || detail.pickupPassword || detail.pickup_code || detail.pickupCode">
|
|
|
+ <view class="code-item" v-if="detail.fetch_code || detail.pickupPassword || detail.pickup_code || detail.pickupCode">
|
|
|
<text class="label">取货码</text>
|
|
|
- <text class="value">{{ detail.fetch_code || detail.pickupPassword || detail.pickup_code }}</text>
|
|
|
+ <text class="value">{{ detail.fetch_code || detail.pickupPassword || detail.pickup_code || detail.pickupCode }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="codes-row" v-if="detail.write_off_code || detail.deliveryPassword || detail.complete_code">
|
|
|
+ <view class="codes-row" v-if="detail.write_off_code || detail.deliveryPassword || detail.complete_code || detail.receiveCode">
|
|
|
<view class="code-item">
|
|
|
<text class="label">收货码</text>
|
|
|
- <text class="value">{{ detail.write_off_code || detail.deliveryPassword || detail.complete_code }}</text>
|
|
|
+ <text class="value">{{ detail.write_off_code || detail.deliveryPassword || detail.complete_code || detail.receiveCode }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -202,6 +202,13 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.detail = raw;
|
|
|
+ if (raw.platform === 'dada') {
|
|
|
+ this.platform = 'dada';
|
|
|
+ this.detail = raw.data;
|
|
|
+ } else if (raw.platform === 'didi') {
|
|
|
+ this.platform = 'didi';
|
|
|
+ this.detail = raw.data;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 特殊处理顺丰 (result)
|
|
|
@@ -231,6 +238,10 @@ export default {
|
|
|
if (data.order_display_id !== undefined || data.order_vehicle_id !== undefined) return 'huolala';
|
|
|
// 顺丰特征
|
|
|
if ((data.order_id && String(data.order_id).startsWith('JS')) || data.rider_name !== undefined || data.sf_order_id !== undefined) return 'shunfeng';
|
|
|
+ // 达达特征
|
|
|
+ if (data.platform === 'dada' || (data.transporterName !== undefined && data.deliveryFee !== undefined)) return 'dada';
|
|
|
+ // 滴滴特征
|
|
|
+ if (data.platform === 'didi' || data.didiOrderNo !== undefined) return 'didi';
|
|
|
|
|
|
return 'unknown';
|
|
|
},
|
|
|
@@ -239,7 +250,9 @@ export default {
|
|
|
'fengniao': '蜂鸟跑腿',
|
|
|
'shansong': '闪送',
|
|
|
'huolala': '货拉拉',
|
|
|
- 'shunfeng': '顺丰同城'
|
|
|
+ 'shunfeng': '顺丰同城',
|
|
|
+ 'dada': '达达快送',
|
|
|
+ 'didi': '滴滴送货'
|
|
|
};
|
|
|
return map[this.platform] || '未知平台';
|
|
|
},
|
|
|
@@ -257,6 +270,10 @@ export default {
|
|
|
case 'shunfeng':
|
|
|
// 1:创建, 2:取消, 10:接单, 12:到店, 15:配送中, 17:完成, 31:取消中
|
|
|
return this.detail.status_desc || '';
|
|
|
+ case 'dada':
|
|
|
+ return this.detail.statusMsg || '';
|
|
|
+ case 'didi':
|
|
|
+ return this.detail.status || '';
|
|
|
default:
|
|
|
return '未知';
|
|
|
}
|
|
|
@@ -266,6 +283,7 @@ export default {
|
|
|
if (this.platform === 'fengniao') return this.detail.abnormal_desc || '';
|
|
|
if (this.platform === 'shansong') return this.detail.subOrderStatusDesc || '';
|
|
|
if (this.platform === 'huolala') return this.detail.remark || ''; // 货拉拉似乎没有额外的状态描述
|
|
|
+ if (this.platform === 'dada') return this.detail.statusMsg || '';
|
|
|
return '';
|
|
|
},
|
|
|
hasDriverInfo() {
|
|
|
@@ -278,6 +296,11 @@ export default {
|
|
|
case 'shansong': return this.detail.courier ? this.detail.courier.name : '';
|
|
|
case 'huolala': return this.detail.driver_info ? this.detail.driver_info.name : '';
|
|
|
case 'shunfeng': return this.detail.rider_name;
|
|
|
+ case 'dada': return this.detail.transporterName;
|
|
|
+ case 'didi': {
|
|
|
+ const driver = Array.isArray(this.detail.driverInfo) ? this.detail.driverInfo[0] : this.detail.driverInfo;
|
|
|
+ return driver ? driver.driverName : '';
|
|
|
+ }
|
|
|
default: return '';
|
|
|
}
|
|
|
},
|
|
|
@@ -288,6 +311,11 @@ export default {
|
|
|
case 'shansong': return this.detail.courier ? this.detail.courier.mobile : '';
|
|
|
case 'huolala': return this.detail.driver_info ? (this.detail.driver_info.driver_phone_no || this.detail.driver_info.phone_no) : '';
|
|
|
case 'shunfeng': return this.detail.rider_phone;
|
|
|
+ case 'dada': return this.detail.transporterPhone;
|
|
|
+ case 'didi': {
|
|
|
+ const driver = Array.isArray(this.detail.driverInfo) ? this.detail.driverInfo[0] : this.detail.driverInfo;
|
|
|
+ return driver ? driver.driverPhone : '';
|
|
|
+ }
|
|
|
default: return '';
|
|
|
}
|
|
|
},
|
|
|
@@ -299,6 +327,10 @@ export default {
|
|
|
if (this.platform === 'fengniao' && this.detail.temperature) {
|
|
|
return this.detail.temperature;
|
|
|
}
|
|
|
+ if (this.platform === 'didi') {
|
|
|
+ const driver = Array.isArray(this.detail.driverInfo) ? this.detail.driverInfo[0] : this.detail.driverInfo;
|
|
|
+ return driver ? driver.carLicense : '';
|
|
|
+ }
|
|
|
return '';
|
|
|
},
|
|
|
getDriverLocation() {
|
|
|
@@ -306,6 +338,9 @@ export default {
|
|
|
if (this.platform === 'shansong' && this.detail.courier && this.detail.courier.estimateDeliveryTimeTip) {
|
|
|
return this.detail.courier.estimateDeliveryTimeTip;
|
|
|
}
|
|
|
+ if (this.platform === 'dada' && this.detail.transporterLng && this.detail.transporterLat) {
|
|
|
+ return '骑手位置: ' + this.detail.transporterLng + ',' + this.detail.transporterLat;
|
|
|
+ }
|
|
|
// 经纬度展示略过,直接展示文本信息
|
|
|
return '';
|
|
|
},
|
|
|
@@ -322,6 +357,8 @@ export default {
|
|
|
case 'shansong': return this.detail.orderNo || this.detail.issOrderNo;
|
|
|
case 'huolala': return this.detail.order_display_id;
|
|
|
case 'shunfeng': return this.detail.order_id;
|
|
|
+ case 'dada': return this.detail.orderId;
|
|
|
+ case 'didi': return this.detail.didiOrderNo || this.detail.outOrderNo;
|
|
|
default: return '';
|
|
|
}
|
|
|
},
|
|
|
@@ -329,6 +366,7 @@ export default {
|
|
|
if (!this.detail) return '';
|
|
|
if (this.platform === 'fengniao' && this.detail.order_distance) return (this.detail.order_distance / 1000).toFixed(2) + 'km'; // 米
|
|
|
if (this.platform === 'shunfeng' && this.detail.delivery_distance_meter) return (this.detail.delivery_distance_meter / 1000).toFixed(2) + 'km';
|
|
|
+ if (this.platform === 'dada' && this.detail.distance) return (this.detail.distance / 1000).toFixed(2) + 'km';
|
|
|
return '';
|
|
|
},
|
|
|
getWeight() {
|
|
|
@@ -340,6 +378,7 @@ export default {
|
|
|
if (!this.detail) return '';
|
|
|
if (this.platform === 'huolala' && this.detail.create_time) return this.$util.$formatDate(this.detail.create_time); // unix timestamp seconds
|
|
|
if (this.platform === 'shunfeng' && this.detail.push_time) return this.$util.$formatDate(this.detail.push_time);
|
|
|
+ if (this.platform === 'dada' && this.detail.createTime) return this.detail.createTime;
|
|
|
// 其他平台可能需要从日志中获取或未提供明确的创建时间字段
|
|
|
return '';
|
|
|
},
|
|
|
@@ -347,6 +386,7 @@ export default {
|
|
|
if (!this.detail) return '';
|
|
|
if (this.platform === 'fengniao' && this.detail.estimate_arrive_time) return this.$util.$formatDate(this.detail.estimate_arrive_time, 'YYYY-MM-DD HH:mm', true); // ms
|
|
|
if (this.platform === 'shunfeng' && this.detail.expect_time) return this.$util.$formatDate(this.detail.expect_time); // seconds
|
|
|
+ if (this.platform === 'dada' && this.detail.finishTime) return this.detail.finishTime; // 如果已送达
|
|
|
return '';
|
|
|
},
|
|
|
getActualPrice() {
|
|
|
@@ -357,6 +397,7 @@ export default {
|
|
|
case 'shansong': fen = this.detail.totalFeeAfterSave; break;
|
|
|
case 'huolala': fen = this.detail.total_price_fen; break; // 货拉拉 total_price_fen 似乎是总价,need check if unpaid_price_fen is better
|
|
|
case 'shunfeng': fen = this.detail.real_pay_money; break;
|
|
|
+ case 'dada': return this.detail.actualFee.toFixed(2);
|
|
|
}
|
|
|
return (fen / 100).toFixed(2);
|
|
|
},
|
|
|
@@ -368,6 +409,7 @@ export default {
|
|
|
case 'shansong': fen = this.detail.totalAmount; break;
|
|
|
case 'huolala': fen = this.detail.total_price_fen; break;
|
|
|
case 'shunfeng': fen = this.detail.total_pay_money; break;
|
|
|
+ case 'dada': return this.detail.deliveryFee.toFixed(2);
|
|
|
}
|
|
|
return (fen / 100).toFixed(2);
|
|
|
},
|
|
|
@@ -398,6 +440,11 @@ export default {
|
|
|
} else if (this.platform === 'shunfeng') {
|
|
|
if (this.detail.overflow_fee) list.push({ name: '爆单费', amount: (this.detail.overflow_fee/100).toFixed(2) });
|
|
|
if (this.detail.coupons_total_fee) list.push({ name: '优惠券', amount: '-' + (this.detail.coupons_total_fee/100).toFixed(2) });
|
|
|
+ } else if (this.platform === 'dada') {
|
|
|
+ if (this.detail.tips > 0) list.push({ name: '小费', amount: this.detail.tips.toFixed(2) });
|
|
|
+ if (this.detail.couponFee > 0) list.push({ name: '优惠券', amount: '-' + this.detail.couponFee.toFixed(2) });
|
|
|
+ if (this.detail.insuranceFee > 0) list.push({ name: '保价费', amount: this.detail.insuranceFee.toFixed(2) });
|
|
|
+ if (this.detail.deductFee > 0) list.push({ name: '违约金', amount: this.detail.deductFee.toFixed(2) });
|
|
|
}
|
|
|
return list;
|
|
|
},
|
|
|
@@ -405,16 +452,40 @@ export default {
|
|
|
if (!this.detail) return [];
|
|
|
let logs = [];
|
|
|
if (this.platform === 'fengniao' && this.detail.event_log_details) {
|
|
|
+ const statusMap = {
|
|
|
+ 0: '订单生成',
|
|
|
+ 1: '运单生成成功',
|
|
|
+ 20: '骑手接单',
|
|
|
+ 80: '骑手到店',
|
|
|
+ 2: '配送中',
|
|
|
+ 3: '已完成',
|
|
|
+ 4: '已取消',
|
|
|
+ 5: '配送异常'
|
|
|
+ };
|
|
|
logs = this.detail.event_log_details.map(item => ({
|
|
|
time: this.$util.$formatDate(item.occur_time, 'YYYY-MM-DD HH:mm', true),
|
|
|
- status: item.order_status, // 需转义,暂略
|
|
|
+ status: statusMap[item.order_status] || item.order_status,
|
|
|
desc: item.carrier_driver_name ? `骑手: ${item.carrier_driver_name}` : ''
|
|
|
}));
|
|
|
} else if (this.platform === 'shansong' && this.detail.statusChangeLog) {
|
|
|
+ const ssMap = {
|
|
|
+ 20: '派单中',
|
|
|
+ 30: '待取货',
|
|
|
+ 40: '闪送中',
|
|
|
+ 50: '已完成',
|
|
|
+ 60: '已取消'
|
|
|
+ };
|
|
|
logs = this.detail.statusChangeLog.map(item => ({
|
|
|
time: item.updateTime,
|
|
|
- status: item.orderStatus // 需转义
|
|
|
+ status: ssMap[item.orderStatus] || item.orderStatus
|
|
|
}));
|
|
|
+ } else if (this.platform === 'dada') {
|
|
|
+ if (this.detail.createTime) logs.push({time: this.detail.createTime, status: '已下单'});
|
|
|
+ if (this.detail.acceptTime) logs.push({time: this.detail.acceptTime, status: '已接单'});
|
|
|
+ if (this.detail.fetchTime) logs.push({time: this.detail.fetchTime, status: '已取货'});
|
|
|
+ if (this.detail.finishTime) logs.push({time: this.detail.finishTime, status: '已送达'});
|
|
|
+ if (this.detail.cancelTime) logs.push({time: this.detail.cancelTime, status: '已取消'});
|
|
|
+ logs.sort((a, b) => new Date(b.time) - new Date(a.time));
|
|
|
}
|
|
|
// 货拉拉和顺丰示例未提供详细日志列表
|
|
|
return logs;
|