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 > 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,
... ...
... ... @@ -97,9 +97,25 @@
订单信息
</p>
<div class="content">
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
{{#if orderInfo.normal}}
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
{{/if}}
{{#if orderInof.offlineByExpress}}
<p>收货人:{{receiver}}</p>
<p>收货地址:{{address}}</p>
<p>联系电话:{{phone}}</p>
<p>下单门店:{{offlineStore}}</p>
{{/if}}
{{#if orderInof.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>
... ...