...
|
...
|
@@ -220,6 +220,7 @@ const _getUserOrder = (uid, type, page) => { |
|
|
let total = false;
|
|
|
let curPage = 1;
|
|
|
|
|
|
|
|
|
if (result && result.data) {
|
|
|
orderList = camelCase(result.data.order_list);
|
|
|
total = result.data.total;
|
...
|
...
|
@@ -229,13 +230,30 @@ const _getUserOrder = (uid, type, page) => { |
|
|
orderList.forEach(item => {
|
|
|
const ot = parseInt(item.orderType, 10);
|
|
|
const st = parseInt(item.status, 10);
|
|
|
let hasRefund = false;
|
|
|
let canRefund = false;
|
|
|
|
|
|
|
|
|
item.orderGoods.forEach(good => {
|
|
|
let cnAlphabet = good.cnAlphabet ? good.cnAlphabet : '';
|
|
|
|
|
|
good.goodUrl = helpers.urlFormat(`/product/pro_${good.productId}_${good.goodsId}/${cnAlphabet}.html`);
|
|
|
|
|
|
// 判断该订单是否有换货商品
|
|
|
if (good.refundNum) {
|
|
|
hasRefund = true;
|
|
|
good.changed = true;
|
|
|
good.returnUrl = helpers.urlFormat('/me/return');
|
|
|
|
|
|
// 判断该订单是否可以退换货
|
|
|
} else if (good.buyNumber !== good.refund) {
|
|
|
canRefund = true;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
item.showRefund = hasRefund;
|
|
|
item.hideChange = !canRefund;
|
|
|
|
|
|
// 转换订单创建时间
|
|
|
item.createTime = _convertUnixTime(item.createTime);
|
|
|
|
...
|
...
|
@@ -258,6 +276,7 @@ const _getUserOrder = (uid, type, page) => { |
|
|
// 在线支付和货到付款有按钮的差异
|
|
|
item.isOnlinePaid = parseInt(item.paymentType, 10) === 1;
|
|
|
|
|
|
item.isRefundOrder = ot === 7;
|
|
|
|
|
|
if (item.isCancel === 'Y') {
|
|
|
item.showBuyBtn = true;
|
...
|
...
|
@@ -275,9 +294,9 @@ const _getUserOrder = (uid, type, page) => { |
|
|
});
|
|
|
|
|
|
return {
|
|
|
orderList: orderList,
|
|
|
total: total,
|
|
|
curPage: curPage
|
|
|
orderList,
|
|
|
total,
|
|
|
curPage
|
|
|
};
|
|
|
});
|
|
|
};
|
...
|
...
|
|