Authored by 郝肖肖

修复_assignExpressInfo 方法引用问题

... ... @@ -80,14 +80,18 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
* 获取快递有关信息
* @private
*/
const _assignExpressInfo = (showLogistics, order, result) => {
if (showLogistics && order.express_company.caption && order.express_number) {
Object.assign(result, {
const _assignExpressInfo = (showLogistics, order) => {
let data = {};
if (showLogistics && order.express_company && order.express_company.caption) {
data = {
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.order_code}),
logisticsCompany: order.express_company.caption,
logisticsNum: order.express_number
});
logisticsNum: order.express_number || ''
};
}
return data;
};
/**
... ... @@ -164,7 +168,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:
... ... @@ -180,7 +184,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:
... ... @@ -213,7 +217,7 @@ const _getOrderStatus = (order, showLogistics) => {
Object.assign(result, {
unreceived: true
});
_assignExpressInfo(showLogistics, order, result);
Object.assign(result, _assignExpressInfo(showLogistics, order));
break;
case 6:
... ... @@ -221,7 +225,7 @@ const _getOrderStatus = (order, showLogistics) => {
Object.assign(result, {
completed: true
});
_assignExpressInfo(showLogistics, order, result);
Object.assign(result, _assignExpressInfo(showLogistics, order));
break;
default:
break;
... ...
... ... @@ -29,7 +29,7 @@ const closeReasons = () => {
const _assignExpressInfo = (showLogistics, order) => {
let data = {};
if (showLogistics && order.expressCompany.caption) {
if (showLogistics && order.expressCompany && order.expressCompany.caption) {
data = {
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode}),
logisticsCompany: order.expressCompany.caption,
... ...