Commit ec5d674e by 宋毅

tj

parent d9b9ebc3
...@@ -245,25 +245,35 @@ class OrderInfoService extends ServiceBase { ...@@ -245,25 +245,35 @@ class OrderInfoService extends ServiceBase {
if (!item) { if (!item) {
return system.getResult(null, "order data is empty!"); return system.getResult(null, "order data is empty!");
} }
var updateDeliveryInfo = []; var updateDeliveryInfo = {
orderDeliveryStatus: actionBody.orderDeliveryStatus,
orderDeliveryStatusName: actionBody.orderDeliveryStatusName,
updated: actionBody.updated,
flowList: []
};
var deliveryInfo = await this.getOrderDeliveryInfo(pobj); var deliveryInfo = await this.getOrderDeliveryInfo(pobj);
var addi = 0; var addi = 0;
if (deliveryInfo.status == 0 && deliveryInfo.data && deliveryInfo.data.length > 0) { if (deliveryInfo.status == 0 && deliveryInfo.data && deliveryInfo.data.length > 0) {
updateDeliveryInfo = deliveryInfo.data; updateDeliveryInfo = deliveryInfo.data;
} else { } else {
updateDeliveryInfo.push({ updateDeliveryInfo = {
orderDeliveryStatus: "已下单",
orderDeliveryStatusName: "已下单",
updated: item.created_at,
flowList: [{
orderDeliveryStatus: "已下单", orderDeliveryStatus: "已下单",
orderDeliveryStatusName: "已下单", orderDeliveryStatusName: "已下单",
updated: item.created_at updated: item.created_at
}); }]
};
addi = 1; addi = 1;
} }
var dataIndex = updateDeliveryInfo.findIndex(f => f.orderDeliveryStatus == actionBody.orderDeliveryStatus); var dataIndex = updateDeliveryInfo.flowList.findIndex(f => f.orderDeliveryStatus == actionBody.orderDeliveryStatus);
if (dataIndex > -1) { if (dataIndex > -1) {
updateDeliveryInfo[dataIndex].orderDeliveryStatusName = actionBody.orderDeliveryStatusName; updateDeliveryInfo.flowList[dataIndex].orderDeliveryStatusName = actionBody.orderDeliveryStatusName;
updateDeliveryInfo[dataIndex].updated = actionBody.updated; updateDeliveryInfo.flowList[dataIndex].updated = actionBody.updated;
} else { } else {
updateDeliveryInfo.push({ updateDeliveryInfo.flowList.push({
orderDeliveryStatus: actionBody.orderDeliveryStatus, orderDeliveryStatus: actionBody.orderDeliveryStatus,
orderDeliveryStatusName: actionBody.orderDeliveryStatusName, orderDeliveryStatusName: actionBody.orderDeliveryStatusName,
updated: actionBody.updated updated: actionBody.updated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment