Authored by Aiden Xu

分期订单

... ... @@ -334,13 +334,35 @@ const orderDetail = (req, res, next) => {
page: 'installment.order-detail',
title: '分期详情',
order: (()=> {
let refundStatusCount = 0, completeStatusCount = 0, listCount = 0;
if (result && result.data && result.data.orderGoods) {
result.data.orderGoods = [
result.data.orderGoods[0]
];
}
return result.data;
if (result && result.data && result.data.packageList) {
listCount = result.data.packageList.length;
result.data.packageList.forEach((item)=> {
if (item.status === 2) {
completeStatusCount++;
} else if (item.status === 4 || item.status === 5) {
refundStatusCount++;
}
});
}
return Object.assign({
status: (()=> {
if (refundStatusCount === listCount) {
return 5;
} else if (completeStatusCount === listCount) {
return 2;
}
})()
}, result.data);
})(),
navBtn: false,
currAmtCount: 0,
... ... @@ -369,7 +391,7 @@ const orderDetail = (req, res, next) => {
return options.inverse(this);
},
isRepaymentAllCompleted: function(status, options) {
if (status === 2) { // 已结清/已取消
if (status === 2) { // 已结清
return options.fn(this);
}
return options.inverse(this);
... ...