...
|
...
|
@@ -341,6 +341,7 @@ const getOrders = (uid, page, limit, type, isPage)=> { |
|
|
newOrder.orderTime = moment.unix(_.get(order, 'create_time')).format('YYYY-MM-DD HH:mm:ss');
|
|
|
newOrder.time = _.get(order, 'create_time');
|
|
|
newOrder.payType = _.get(order, 'payment_type');
|
|
|
newOrder.title = _.get(order, 'order_title');
|
|
|
|
|
|
if (order.is_cancel === 'Y' || order.status === 6) {
|
|
|
newOrder.canDelete = true; // 删除订单
|
...
|
...
|
@@ -544,6 +545,32 @@ const _getNormalPro = (isCancel, status, createTime) => { |
|
|
return process;
|
|
|
};
|
|
|
|
|
|
const _getOfflineBySelf = (isCancel, status, createTime) => {
|
|
|
let process = {
|
|
|
middleStatus: [
|
|
|
{
|
|
|
name: '1. 提交订单',
|
|
|
date: moment.unix(createTime).format('YYYY.MM.DD HH:mm:ss')
|
|
|
},
|
|
|
{
|
|
|
name: '2. 交易完成'
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
|
|
|
if (isCancel === 'N') {
|
|
|
if (status === 0) {
|
|
|
process.percent = '50%';
|
|
|
process.middleStatus[0].cur = true;
|
|
|
} else if (status > 0 && status < 4) {
|
|
|
process.percent = '100%';
|
|
|
process.middleStatus[1].cur = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return process;
|
|
|
};
|
|
|
|
|
|
const _getOrderDetailOp = (orderId, payment, status,
|
|
|
isCancel, paymentStatus, paymentType,
|
|
|
orderType, attribute, refundStatus) => {
|
...
|
...
|
@@ -623,6 +650,10 @@ const _getPackageInfo = (cartInfo) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const isOfflineBySelf = (orderDetail) => {
|
|
|
return orderDetail.is_offlineshops === 'Y' && orderDetail.is_delivery_offline === 'Y';
|
|
|
};
|
|
|
|
|
|
const _getOrderDetail = co(function * (uid, orderId) {
|
|
|
let orderInfo = yield orderApi.getOrderDetail(uid, orderId);
|
|
|
let detail = {};
|
...
|
...
|
@@ -654,6 +685,10 @@ const _getOrderDetail = co(function * (uid, orderId) { |
|
|
if (orderDetail.attribute === 3) {
|
|
|
return _getVirtualPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
|
|
} else {
|
|
|
if (isOfflineBySelf(orderDetail)) {
|
|
|
return _getOfflineBySelf(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
|
|
}
|
|
|
|
|
|
return _getNormalPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
|
|
}
|
|
|
}());
|
...
|
...
|
@@ -696,6 +731,18 @@ const _getOrderDetail = co(function * (uid, orderId) { |
|
|
phone: _.fill(orderDetail.mobile.split(''), '*', 3, 4).join('') +
|
|
|
(orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
|
|
|
};
|
|
|
console.log(orderDetail);
|
|
|
if (_.get(orderDetail, 'is_offlineshops') === 'Y') {
|
|
|
if (_.get(orderDetail, 'is_delivery_offline') === 'Y') {
|
|
|
detail.orderInfo.offlineBySelf = true;
|
|
|
} else {
|
|
|
detail.orderInfo.offlineByExpress = true;
|
|
|
}
|
|
|
|
|
|
detail.offlineStore = _.get(orderDetail, 'offline_store', '');
|
|
|
} else {
|
|
|
detail.orderInfo.normal = true;
|
|
|
}
|
|
|
|
|
|
detail.editInfo = {
|
|
|
userName: orderDetail.user_name,
|
...
|
...
|
|