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 === 6) {
  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 }());
@@ -697,6 +732,19 @@ const _getOrderDetail = co(function * (uid, orderId) { @@ -697,6 +732,19 @@ const _getOrderDetail = co(function * (uid, orderId) {
697 (orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '') 732 (orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
698 }; 733 };
699 734
  735 + if (_.get(orderDetail, 'is_offlineshops') === 'Y') {
  736 + if (_.get(orderDetail, 'is_delivery_offline') === 'Y') {
  737 + detail.orderInfo.offlineBySelf = true;
  738 + detail.offlineBySelf = true;
  739 + } else {
  740 + detail.orderInfo.offlineByExpress = true;
  741 + }
  742 +
  743 + detail.offlineStore = _.get(orderDetail, 'offline_store', '');
  744 + } else {
  745 + detail.orderInfo.normal = true;
  746 + }
  747 +
700 detail.editInfo = { 748 detail.editInfo = {
701 userName: orderDetail.user_name, 749 userName: orderDetail.user_name,
702 address: orderDetail.address, 750 address: orderDetail.address,
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <div class="me-main"> 6 <div class="me-main">
7 <div class="order-detail block" data-id="{{orderNum}}"> 7 <div class="order-detail block" data-id="{{orderNum}}">
8 <h2 class="title"></h2> 8 <h2 class="title"></h2>
9 - <div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}}"> 9 + <div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}} {{#if offlineBySelf}}offline-self{{/if}}">
10 <div class="status"> 10 <div class="status">
11 <p> 11 <p>
12 订单编号: 12 订单编号:
@@ -97,9 +97,24 @@ @@ -97,9 +97,24 @@
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 + {{#if normal}}
  101 + <p>收货人:{{receiver}}</p>
  102 + <p>收货地址:{{address}}</p>
  103 + <p>联系电话:{{phone}}</p>
  104 + {{/if}}
  105 +
  106 + {{#if offlineByExpress}}
  107 + <p>收货人:{{receiver}}</p>
  108 + <p>收货地址:{{address}}</p>
  109 + <p>联系电话:{{phone}}</p>
  110 + <p>下单门店:{{offlineStore}}</p>
  111 +
  112 + {{/if}}
  113 +
  114 + {{#if offlineBySelf}}
  115 + <p>下单门店:{{offlineStore}}</p>
  116 + <p>配送方式:门店取货</p>
  117 + {{/if}}
103 </div> 118 </div>
104 </div> 119 </div>
105 {{/ orderInfo}} 120 {{/ 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>
@@ -142,8 +142,23 @@ @@ -142,8 +142,23 @@
142 } 142 }
143 } 143 }
144 144
  145 + .offline-self {
  146 + .pg-1 {
  147 + left: 515px;
  148 + }
  149 +
  150 + .outter-progress {
  151 + background: resolve(home/offline-by-self-progress.png) no-repeat 0 0;
  152 + }
  153 +
  154 + .inner-progress {
  155 + background: resolve(home/offline-by-self-progress.png) no-repeat 0 -12px;
  156 + }
  157 + }
  158 +
  159 +
145 .outter-progress { 160 .outter-progress {
146 - width: 552px; 161 + width: 554px;
147 height: 12px; 162 height: 12px;
148 background: resolve(home/order-progress.png) no-repeat 0 0; 163 background: resolve(home/order-progress.png) no-repeat 0 0;
149 } 164 }