Authored by htoooth

fix

@@ -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,
@@ -97,9 +97,25 @@ @@ -97,9 +97,25 @@
97 订单信息 97 订单信息
98 </p> 98 </p>
99 <div class="content"> 99 <div class="content">
100 - <p>收货人:{{receiver}}</p>  
101 - <p>收货地址:{{address}}</p>  
102 - <p>联系电话:{{phone}}</p> 100 +
  101 + {{#if orderInfo.normal}}
  102 + <p>收货人:{{receiver}}</p>
  103 + <p>收货地址:{{address}}</p>
  104 + <p>联系电话:{{phone}}</p>
  105 + {{/if}}
  106 +
  107 + {{#if orderInof.offlineByExpress}}
  108 + <p>收货人:{{receiver}}</p>
  109 + <p>收货地址:{{address}}</p>
  110 + <p>联系电话:{{phone}}</p>
  111 + <p>下单门店:{{offlineStore}}</p>
  112 +
  113 + {{/if}}
  114 +
  115 + {{#if orderInof.offlineBySelf}}
  116 + <p>下单门店:{{offlineStore}}</p>
  117 + <p>配送方式:门店取货</p>
  118 + {{/if}}
103 </div> 119 </div>
104 </div> 120 </div>
105 {{/ orderInfo}} 121 {{/ orderInfo}}
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 {{# orders.list}} 16 {{# orders.list}}
17 <div class="order" data-id="{{orderNum}}" data-time="{{time}}" data-paytype="{{payType}}"> 17 <div class="order" data-id="{{orderNum}}" data-time="{{time}}" data-paytype="{{payType}}">
18 <p class="order-title"> 18 <p class="order-title">
19 - 订单编号:{{orderNum}} 19 + {{title}}
20 <span class="order-time">下单时间:{{orderTime}}</span> 20 <span class="order-time">下单时间:{{orderTime}}</span>
21 {{#if canDelete}} 21 {{#if canDelete}}
22 <a class="right order-delete" href="javascript:;">删除订单</a> 22 <a class="right order-delete" href="javascript:;">删除订单</a>