...
|
...
|
@@ -11,6 +11,7 @@ const camelCase = global.yoho.camelCase; |
|
|
const _ = require('lodash');
|
|
|
const mcHandler = require('./menu-crumb-handler');
|
|
|
const returnsAPI = require('./returns-api');
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
...
|
...
|
@@ -213,6 +214,32 @@ const _setRefundDetailData = (data) => { |
|
|
return resData;
|
|
|
};
|
|
|
|
|
|
const _setExchangeDetailData = (data) => {
|
|
|
let list = {};
|
|
|
|
|
|
switch (data.status) {
|
|
|
case 0:
|
|
|
list.audit = true;
|
|
|
break;
|
|
|
case 10:
|
|
|
list.through = true;
|
|
|
break;
|
|
|
case 50:
|
|
|
list.send = true;
|
|
|
list.auditSuccess = true;
|
|
|
break;
|
|
|
case 40:
|
|
|
resData.finish = true;
|
|
|
list.auditSuccess = true;
|
|
|
break;
|
|
|
default:
|
|
|
resData.audit = true;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
return list;
|
|
|
};
|
|
|
|
|
|
const getRefundGoodsData = (orderCode, uid) => {
|
|
|
return returnsAPI.getRefundGoodsAsync(orderCode, uid).then(result => {
|
|
|
let resData = {};
|
...
|
...
|
@@ -248,7 +275,7 @@ const getRefundDetailData = (applyId, uid) => { |
|
|
if (result.data) {
|
|
|
// console.log(_setRefundDetailData(result.data));
|
|
|
|
|
|
Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList));
|
|
|
Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList));//头部
|
|
|
|
|
|
Object.assign(resData.refundDetail, _setRefundDetailData(result.data));
|
|
|
}
|
...
|
...
|
@@ -319,11 +346,38 @@ const getChangeGoodsList = (orderCode, uid) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const getExchangeDetailData = (id, uid) => {
|
|
|
return returnsAPI.getExchangeDetail(id, uid).then(result => {
|
|
|
|
|
|
let exchangeData = {};
|
|
|
|
|
|
Object.assign(exchangeData, _setSideMenu('我的退/换货'));
|
|
|
exchangeData = {
|
|
|
title: '换货申请',
|
|
|
exchangeDetail: {}
|
|
|
};
|
|
|
|
|
|
if (result.data) {
|
|
|
// console.log(_setRefundDetailData(result.data));
|
|
|
|
|
|
Object.assign(exchangeData.exchangeDetail, _setReturnStatus(result.data.statusList));//头部
|
|
|
|
|
|
Object.assign(exchangeData.exchangeDetail, _setExchangeDetailData(result.data));
|
|
|
|
|
|
// Object.assign(exchangeData.exchangeDetail, camelCase(result.data));
|
|
|
}
|
|
|
|
|
|
console.log(exchangeData)
|
|
|
return {returns: exchangeData};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getUserReturn,
|
|
|
getRefundGoodsData,
|
|
|
getChangeGoodsList,
|
|
|
getProductInfo,
|
|
|
getRefundDetailData,
|
|
|
saveRefund
|
|
|
saveRefund,
|
|
|
getExchangeDetailData
|
|
|
}; |
...
|
...
|
|