|
@@ -341,6 +341,7 @@ const getOrders = (uid, page, limit, type, isPage)=> { |
|
@@ -341,6 +341,7 @@ const getOrders = (uid, page, limit, type, isPage)=> { |
341
|
newOrder.orderTime = moment.unix(_.get(order, 'create_time')).format('YYYY-MM-DD HH:mm:ss');
|
341
|
newOrder.orderTime = moment.unix(_.get(order, 'create_time')).format('YYYY-MM-DD HH:mm:ss');
|
342
|
newOrder.time = _.get(order, 'create_time');
|
342
|
newOrder.time = _.get(order, 'create_time');
|
343
|
newOrder.payType = _.get(order, 'payment_type');
|
343
|
newOrder.payType = _.get(order, 'payment_type');
|
|
|
344
|
+ newOrder.title = _.get(order, 'order_title');
|
344
|
|
345
|
|
345
|
if (order.is_cancel === 'Y' || order.status === 6) {
|
346
|
if (order.is_cancel === 'Y' || order.status === 6) {
|
346
|
newOrder.canDelete = true; // 删除订单
|
347
|
newOrder.canDelete = true; // 删除订单
|
|
@@ -544,6 +545,32 @@ const _getNormalPro = (isCancel, status, createTime) => { |
|
@@ -544,6 +545,32 @@ const _getNormalPro = (isCancel, status, createTime) => { |
544
|
return process;
|
545
|
return process;
|
545
|
};
|
546
|
};
|
546
|
|
547
|
|
|
|
548
|
+const _getOfflineBySelf = (isCancel, status, createTime) => {
|
|
|
549
|
+ let process = {
|
|
|
550
|
+ middleStatus: [
|
|
|
551
|
+ {
|
|
|
552
|
+ name: '1. 提交订单',
|
|
|
553
|
+ date: moment.unix(createTime).format('YYYY.MM.DD HH:mm:ss')
|
|
|
554
|
+ },
|
|
|
555
|
+ {
|
|
|
556
|
+ name: '2. 交易完成'
|
|
|
557
|
+ }
|
|
|
558
|
+ ]
|
|
|
559
|
+ };
|
|
|
560
|
+
|
|
|
561
|
+ if (isCancel === 'N') {
|
|
|
562
|
+ if (status === 0) {
|
|
|
563
|
+ process.percent = '50%';
|
|
|
564
|
+ process.middleStatus[0].cur = true;
|
|
|
565
|
+ } else if (status > 0 && status < 4) {
|
|
|
566
|
+ process.percent = '100%';
|
|
|
567
|
+ process.middleStatus[1].cur = true;
|
|
|
568
|
+ }
|
|
|
569
|
+ }
|
|
|
570
|
+
|
|
|
571
|
+ return process;
|
|
|
572
|
+};
|
|
|
573
|
+
|
547
|
const _getOrderDetailOp = (orderId, payment, status,
|
574
|
const _getOrderDetailOp = (orderId, payment, status,
|
548
|
isCancel, paymentStatus, paymentType,
|
575
|
isCancel, paymentStatus, paymentType,
|
549
|
orderType, attribute, refundStatus) => {
|
576
|
orderType, attribute, refundStatus) => {
|
|
@@ -623,6 +650,10 @@ const _getPackageInfo = (cartInfo) => { |
|
@@ -623,6 +650,10 @@ const _getPackageInfo = (cartInfo) => { |
623
|
});
|
650
|
});
|
624
|
};
|
651
|
};
|
625
|
|
652
|
|
|
|
653
|
+const isOfflineBySelf = (orderDetail) => {
|
|
|
654
|
+ return orderDetail.is_offlineshops === 'Y' && orderDetail.is_delivery_offline === 'Y';
|
|
|
655
|
+};
|
|
|
656
|
+
|
626
|
const _getOrderDetail = co(function * (uid, orderId) {
|
657
|
const _getOrderDetail = co(function * (uid, orderId) {
|
627
|
let orderInfo = yield orderApi.getOrderDetail(uid, orderId);
|
658
|
let orderInfo = yield orderApi.getOrderDetail(uid, orderId);
|
628
|
let detail = {};
|
659
|
let detail = {};
|
|
@@ -654,6 +685,10 @@ const _getOrderDetail = co(function * (uid, orderId) { |
|
@@ -654,6 +685,10 @@ const _getOrderDetail = co(function * (uid, orderId) { |
654
|
if (orderDetail.attribute === 3) {
|
685
|
if (orderDetail.attribute === 3) {
|
655
|
return _getVirtualPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
686
|
return _getVirtualPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
656
|
} else {
|
687
|
} else {
|
|
|
688
|
+ if (isOfflineBySelf(orderDetail)) {
|
|
|
689
|
+ return _getOfflineBySelf(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
|
|
690
|
+ }
|
|
|
691
|
+
|
657
|
return _getNormalPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
692
|
return _getNormalPro(orderDetail.is_cancel, +orderDetail.status, orderDetail.create_time);
|
658
|
}
|
693
|
}
|
659
|
}());
|
694
|
}());
|
|
@@ -696,6 +731,18 @@ const _getOrderDetail = co(function * (uid, orderId) { |
|
@@ -696,6 +731,18 @@ const _getOrderDetail = co(function * (uid, orderId) { |
696
|
phone: _.fill(orderDetail.mobile.split(''), '*', 3, 4).join('') +
|
731
|
phone: _.fill(orderDetail.mobile.split(''), '*', 3, 4).join('') +
|
697
|
(orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
|
732
|
(orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
|
698
|
};
|
733
|
};
|
|
|
734
|
+ console.log(orderDetail);
|
|
|
735
|
+ if (_.get(orderDetail, 'is_offlineshops') === 'Y') {
|
|
|
736
|
+ if (_.get(orderDetail, 'is_delivery_offline') === 'Y') {
|
|
|
737
|
+ detail.orderInfo.offlineBySelf = true;
|
|
|
738
|
+ } else {
|
|
|
739
|
+ detail.orderInfo.offlineByExpress = true;
|
|
|
740
|
+ }
|
|
|
741
|
+
|
|
|
742
|
+ detail.offlineStore = _.get(orderDetail, 'offline_store', '');
|
|
|
743
|
+ } else {
|
|
|
744
|
+ detail.orderInfo.normal = true;
|
|
|
745
|
+ }
|
699
|
|
746
|
|
700
|
detail.editInfo = {
|
747
|
detail.editInfo = {
|
701
|
userName: orderDetail.user_name,
|
748
|
userName: orderDetail.user_name,
|