Authored by htoooth

fix

... ... @@ -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 === 6) {
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);
}
}());
... ... @@ -697,6 +732,19 @@ const _getOrderDetail = co(function * (uid, orderId) {
(orderDetail.phone ? ',' + _.fill(orderDetail.phone.split(''), '*', 3, 5).join('') : '')
};
if (_.get(orderDetail, 'is_offlineshops') === 'Y') {
if (_.get(orderDetail, 'is_delivery_offline') === 'Y') {
detail.orderInfo.offlineBySelf = true;
detail.offlineBySelf = true;
} else {
detail.orderInfo.offlineByExpress = true;
}
detail.offlineStore = _.get(orderDetail, 'offline_store', '');
} else {
detail.orderInfo.normal = true;
}
detail.editInfo = {
userName: orderDetail.user_name,
address: orderDetail.address,
... ...
... ... @@ -6,7 +6,7 @@
<div class="me-main">
<div class="order-detail block" data-id="{{orderNum}}">
<h2 class="title"></h2>
<div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}}">
<div class="detail-info{{#if virtualGoods}} virtual-detail{{/if}} {{#if offlineBySelf}}offline-self{{/if}}">
<div class="status">
<p>
订单编号:
... ... @@ -97,9 +97,24 @@
订单信息
</p>
<div class="content">
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
{{#if normal}}
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
{{/if}}
{{#if offlineByExpress}}
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
<p>下单门店:{{offlineStore}}</p>
{{/if}}
{{#if offlineBySelf}}
<p>下单门店:{{offlineStore}}</p>
<p>配送方式:门店取货</p>
{{/if}}
</div>
</div>
{{/ orderInfo}}
... ...
... ... @@ -16,7 +16,7 @@
{{# orders.list}}
<div class="order" data-id="{{orderNum}}" data-time="{{time}}" data-paytype="{{payType}}">
<p class="order-title">
订单编号:{{orderNum}}
{{title}}
<span class="order-time">下单时间:{{orderTime}}</span>
{{#if canDelete}}
<a class="right order-delete" href="javascript:;">删除订单</a>
... ...
... ... @@ -142,8 +142,23 @@
}
}
.offline-self {
.pg-1 {
left: 515px;
}
.outter-progress {
background: resolve(home/offline-by-self-progress.png) no-repeat 0 0;
}
.inner-progress {
background: resolve(home/offline-by-self-progress.png) no-repeat 0 -12px;
}
}
.outter-progress {
width: 552px;
width: 554px;
height: 12px;
background: resolve(home/order-progress.png) no-repeat 0 0;
}
... ...