...
|
...
|
@@ -3,53 +3,34 @@ |
|
|
|
|
|
const api = global.yoho.API;
|
|
|
const _ = require('lodash');
|
|
|
const config = global.yoho.config;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
|
|
|
const orderDetail = (params) => {
|
|
|
const orderDetail = (uid, orderCode) => {
|
|
|
let finalResult = {};
|
|
|
|
|
|
return api.get('', _.assign({
|
|
|
method: 'app.SpaceOrders.detail'
|
|
|
}, params), {code: 200}).then((result) => {
|
|
|
if (result.data) {
|
|
|
Object.assign(finalResult, {
|
|
|
virtual_type: result.data.virtual_type,
|
|
|
phoneNum: result.data.mobile,
|
|
|
orderStatus: result.data.status_str,
|
|
|
orderNum: result.data.order_code,
|
|
|
orderTime: result.data.create_time,
|
|
|
isPay: result.data.payment_status === 'Y',
|
|
|
relation: result.data.relate_order_code === 'Y' ? 'true' : 'false',
|
|
|
name: result.data.user_name,
|
|
|
|
|
|
isVirtual: false,
|
|
|
mobile: '15999999999',
|
|
|
address: result.data.address,
|
|
|
logisticsUrl: '#',
|
|
|
logisticsCompany: '顺丰',
|
|
|
logisticsNum: '111111',
|
|
|
yohoCoin: result.data.yoho_give_coin,
|
|
|
|
|
|
invoice: [{
|
|
|
title: '有货',
|
|
|
contentValue: '有货',
|
|
|
pdfUrl: '#'
|
|
|
}, {
|
|
|
title: '有货',
|
|
|
contentValue: '有货',
|
|
|
pdfUrl: '#'
|
|
|
}],
|
|
|
orderBalance: [{
|
|
|
promotion: '商品总金额',
|
|
|
account: '100.00'
|
|
|
}, {
|
|
|
promotion: '运费',
|
|
|
account: '10.00'
|
|
|
}],
|
|
|
price: result.data.amount
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return finalResult;
|
|
|
return api.get('', {
|
|
|
method: 'app.SpaceOrders.detail',
|
|
|
uid: uid,
|
|
|
order_code: orderCode
|
|
|
}).then((result) => {
|
|
|
let orderDetail = camelCase(result.data);
|
|
|
console.log(result);
|
|
|
|
|
|
// if(orderDetail.virtualType && orderDetail.virtualType === 3) {
|
|
|
// orderDetail = _.assign(orderDetail, {
|
|
|
// isVirtual: true,
|
|
|
// mobile: result.data.mobile
|
|
|
// })
|
|
|
// }
|
|
|
|
|
|
// orderDetail = _.assign(orderDetail, {
|
|
|
// addressAll: orderDetail.area + orderDetail.address
|
|
|
// // createTime: date('Y-m-d H:i:s', orderDetail.createTime)
|
|
|
// })
|
|
|
|
|
|
return orderDetail;
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|