...
|
...
|
@@ -26,13 +26,25 @@ const RETURNS_EMPTY = '您没有退/换货订单'; |
|
|
const REFUND_URI = '/home/returns/refundDetail';
|
|
|
const EXCHANGE_URI = '/home/returns/exchangeDetail';
|
|
|
|
|
|
|
|
|
// 处理退换货商品链接
|
|
|
const getProductUrlBySkc = (pid, gid, cnAlphabet) => {
|
|
|
cnAlphabet = cnAlphabet || 'cnalphabet';
|
|
|
|
|
|
return helpers.urlFormat(`/product/pro_${pid}_${gid}/${cnAlphabet}.html`,
|
|
|
{}, 'item');
|
|
|
};
|
|
|
|
|
|
const setDetailGoods = (list) => {
|
|
|
let resData = [];
|
|
|
|
|
|
_.forEach(list, value => {
|
|
|
resData.push({
|
|
|
name: value.product_name || '',
|
|
|
reason: value.reason_name
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return resData;
|
|
|
};
|
|
|
|
|
|
// 处理订单商品的数据
|
...
|
...
|
@@ -211,7 +223,63 @@ const getOrderRefund = (orderCode, uid) => { |
|
|
return co(process)();
|
|
|
};
|
|
|
|
|
|
const getRefundDetail = (applyId, uid) => {
|
|
|
let process = function*() {
|
|
|
let resData = {};
|
|
|
let result = yield Promise.all([
|
|
|
returnAPI.getRefundDetailAsync(applyId, uid),
|
|
|
returnAPI.getExpressCompanyAsync()
|
|
|
]);
|
|
|
|
|
|
if (result[0].data) {
|
|
|
let data = result[0].data;
|
|
|
let detail = {
|
|
|
isChange: false,
|
|
|
returnId: applyId,
|
|
|
orderNum: data.source_order_code,
|
|
|
nowStatus: data.status_name,
|
|
|
applyTime: data.create_time,
|
|
|
payMode: data.source_payment_type_desc || '',
|
|
|
backMode: data.return_amount_mode_name || '',
|
|
|
goods: setDetailGoods(data.goods_list)
|
|
|
};
|
|
|
|
|
|
if (+data.status !== 0) {
|
|
|
detail.express = {
|
|
|
id: _.get(data, 'notice.express_id', ''),
|
|
|
company: _.get(data, 'notice.express_company', ''),
|
|
|
number: _.get(data, 'notice.express_number', '')
|
|
|
};
|
|
|
}
|
|
|
|
|
|
detail.statusList = [];
|
|
|
_.forEach(data.statusList, value => {
|
|
|
detail.statusList.push({
|
|
|
name: value.name,
|
|
|
act: value.act === 'Y'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (data.canCancel === 'Y') {
|
|
|
detail.canCancelUrl = '/home/refund/cancel';
|
|
|
}
|
|
|
|
|
|
resData.detail = detail;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (result[1].data && resData.detail) {
|
|
|
_.set(resData, 'detail.expressList', _.toArray(result[1].data));
|
|
|
}
|
|
|
|
|
|
return resData;
|
|
|
};
|
|
|
|
|
|
return co(process)();
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getReturnsList,
|
|
|
getOrderRefund
|
|
|
getOrderRefund,
|
|
|
getRefundDetail
|
|
|
}; |
...
|
...
|
|