...
|
...
|
@@ -82,6 +82,75 @@ const _setSideMenu = (type) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
const _calcStatusRate = (num, total) => {
|
|
|
let rate = 0;
|
|
|
|
|
|
if (total) {
|
|
|
rate = `${_.toInteger(num / total * 100)}%`;
|
|
|
}
|
|
|
|
|
|
return rate;
|
|
|
};
|
|
|
|
|
|
const _setDefaultStatus = (type) => {
|
|
|
const list = ['提交申请', '审核通过', '商品寄回', '商品入库', `${type}完成`];
|
|
|
let statusList = [];
|
|
|
let resData = {};
|
|
|
|
|
|
_.forEach(list, (value, key) => {
|
|
|
statusList.push({
|
|
|
step: _.toInteger(key) + 1,
|
|
|
name: value
|
|
|
});
|
|
|
});
|
|
|
statusList[0].act = true;
|
|
|
|
|
|
resData.returnStstus = {
|
|
|
rate: _calcStatusRate(1, statusList.length),
|
|
|
statusList: statusList
|
|
|
};
|
|
|
|
|
|
return resData;
|
|
|
}
|
|
|
|
|
|
const _setReturnStatus = (list, half) => {
|
|
|
let resData = {};
|
|
|
|
|
|
if (list && list.length) {
|
|
|
let statusList = [],
|
|
|
step = 0;
|
|
|
let rate;
|
|
|
|
|
|
// 遍历进度列表
|
|
|
_.forEach(list, (value, key) => {
|
|
|
let state = {
|
|
|
act: value.act === 'Y',
|
|
|
step: _.toInteger(key) + 1,
|
|
|
name: value.name
|
|
|
};
|
|
|
|
|
|
if (state.act) {
|
|
|
step++;
|
|
|
}
|
|
|
statusList.push(state);
|
|
|
});
|
|
|
|
|
|
// 多半格进度特殊处理
|
|
|
if (half) {
|
|
|
rate = _calcStatusRate(step * 2 + 1, statusList.length * 2);
|
|
|
} else {
|
|
|
rate = _calcStatusRate(step, statusList.length);
|
|
|
}
|
|
|
|
|
|
resData.returnStstus = {
|
|
|
rate: rate,
|
|
|
statusList: statusList
|
|
|
};
|
|
|
}
|
|
|
|
|
|
return resData;
|
|
|
};
|
|
|
|
|
|
const _setRefundGoodList = (data) => {
|
|
|
let resData = {};
|
|
|
|
...
|
...
|
@@ -149,9 +218,11 @@ const getRefundGoodsData = (orderCode, uid) => { |
|
|
let resData = {};
|
|
|
|
|
|
Object.assign(resData, _setSideMenu('我的退/换货'));
|
|
|
|
|
|
|
|
|
resData.returns = {
|
|
|
title: '退货申请',
|
|
|
refund: {}
|
|
|
refund: _setDefaultStatus('退货') || {}
|
|
|
};
|
|
|
|
|
|
if (result.data) {
|
...
|
...
|
@@ -176,6 +247,9 @@ const getRefundDetailData = (applyId, uid) => { |
|
|
|
|
|
if (result.data) {
|
|
|
// console.log(_setRefundDetailData(result.data));
|
|
|
|
|
|
Object.assign(resData.refundDetail, _setReturnStatus(result.data.statusList));
|
|
|
|
|
|
Object.assign(resData.refundDetail, _setRefundDetailData(result.data));
|
|
|
}
|
|
|
|
...
|
...
|
|