...
|
...
|
@@ -26,14 +26,18 @@ const closeReasons = () => { |
|
|
* 获取快递有关信息
|
|
|
* @private
|
|
|
*/
|
|
|
const _assignExpressInfo = (showLogistics, order, result) => {
|
|
|
if (showLogistics && order.express_company.caption && order.express_number) {
|
|
|
Object.assign(result, {
|
|
|
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.order_code}),
|
|
|
logisticsCompany: order.express_company.caption,
|
|
|
logisticsNum: order.express_number
|
|
|
});
|
|
|
const _assignExpressInfo = (showLogistics, order) => {
|
|
|
let data = {};
|
|
|
|
|
|
if (showLogistics && order.expressCompany.caption && order.expressNumber) {
|
|
|
data = {
|
|
|
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode}),
|
|
|
logisticsCompany: order.expressCompany.caption,
|
|
|
logisticsNum: order.expressNumber
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return data;
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -84,7 +88,7 @@ const _getOrderStatus = (order, showLogistics) => { |
|
|
qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`)
|
|
|
});
|
|
|
} else {
|
|
|
_assignExpressInfo(showLogistics, order, result);
|
|
|
Object.assign(result, _assignExpressInfo(showLogistics, order));
|
|
|
}
|
|
|
break;
|
|
|
case 6:
|
...
|
...
|
@@ -100,7 +104,7 @@ const _getOrderStatus = (order, showLogistics) => { |
|
|
qrcode: helpers.urlFormat(`/home/QRcode/${order.order_code}`)
|
|
|
});
|
|
|
} else {
|
|
|
_assignExpressInfo(showLogistics, order, result);
|
|
|
Object.assign(result, _assignExpressInfo(showLogistics, order));
|
|
|
}
|
|
|
break;
|
|
|
default:
|
...
|
...
|
@@ -109,7 +113,7 @@ const _getOrderStatus = (order, showLogistics) => { |
|
|
} else {
|
|
|
|
|
|
/* 订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态) */
|
|
|
switch (parseInt(order.status, 10)) {
|
|
|
switch (order.status) {
|
|
|
case 0:
|
|
|
|
|
|
/* 备货中 */
|
...
|
...
|
@@ -133,7 +137,7 @@ const _getOrderStatus = (order, showLogistics) => { |
|
|
Object.assign(result, {
|
|
|
unreceived: true
|
|
|
});
|
|
|
_assignExpressInfo(showLogistics, order, result);
|
|
|
Object.assign(result, _assignExpressInfo(showLogistics, order));
|
|
|
break;
|
|
|
case 6:
|
|
|
|
...
|
...
|
@@ -141,7 +145,7 @@ const _getOrderStatus = (order, showLogistics) => { |
|
|
Object.assign(result, {
|
|
|
completed: true
|
|
|
});
|
|
|
_assignExpressInfo(showLogistics, order, result);
|
|
|
Object.assign(result, _assignExpressInfo(showLogistics, order));
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
...
|
...
|
@@ -164,10 +168,9 @@ const orderDetailData = (uid, orderCode) => { |
|
|
let orderDetail = camelCase(result.data);
|
|
|
let goods = [];
|
|
|
|
|
|
let status = _getOrderStatus(orderDetail);
|
|
|
let status = _getOrderStatus(orderDetail, true);
|
|
|
|
|
|
orderDetail = _.assign(orderDetail, status);
|
|
|
orderDetail.useLimitCode = orderDetail.useLimitCode === 'Y';
|
|
|
|
|
|
if (orderDetail.virtualType && orderDetail.virtualType === 3) {
|
|
|
orderDetail = _.assign(orderDetail, {
|
...
|
...
|
@@ -251,13 +254,6 @@ const orderDetailData = (uid, orderCode) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 定金预售
|
|
|
if (orderDetail.attribute * 1 === 9) {
|
|
|
orderDetail = _.assign(orderDetail, {
|
|
|
isDepositAdvance: true
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 判断是否有关联订单
|
|
|
if (orderDetail.relateOrderCode === 'Y') {
|
|
|
orderDetail = _.assign(orderDetail, {
|
...
|
...
|
|