Authored by biao

update for refund entry

... ... @@ -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
};
});
};
... ...
... ... @@ -607,11 +607,13 @@ const getChangeGoodsList = (orderCode, uid) => {
data.hidePrice = true;
data.orderCode = orderCode;
data.goodsList.forEach(good => {
good.showCheckbox = true;
good.hidePrice = true;
good.buyNumber = 1;
});
if (data.goodsList) {
data.goodsList.forEach(good => {
good.showCheckbox = true;
good.hidePrice = true;
good.buyNumber = 1;
});
}
}
... ...
... ... @@ -3,7 +3,14 @@
{{> order/good-info}}
{{#unless hidePrice}}
<div class="sub-column right-border bold">
<p class="{{#if @last}}last{{/if}}">¥{{goodsPrice}}</p>
<p class="{{#if @last}}last{{/if}}">
¥{{goodsPrice}}
{{#if changed}}
<a href="{{returnUrl}}">
<span class="btn white change-tag">已退换</span>
</a>
{{/if}}
</p>
</div>
<div class="sub-column right-border special-column bold">
<p class="bold">{{buyNumber}}</p>
... ...
... ... @@ -8,6 +8,9 @@
<div class="common-column special-border">
<p class="bold">¥{{amount}}</p>
<p class="subtext">{{paymentTypeStr}}</p>
{{#if isRefundOrder}}
<p class="subtext refund-tag">换货订单</p>
{{/if}}
</div>
<div class="common-column special-border status">
<p class="bold status-str">{{statusStr}}</p>
... ... @@ -29,12 +32,14 @@
{{/if}}
{{#if showEditOption}}
<p class="subtext">评价晒单</p>
{{#unless hideChange}}
<a href="{{refundUrl}}">
<p class="subtext">申请退货</p>
</a>
<a href="{{exchangeUrl}}">
<p class="subtext">申请换货</p>
</a>
{{/unless}}
<p class="subtext delete">删除订单</p>
{{/if}}
{{#if showGetBtn}}
... ...
... ... @@ -14,6 +14,25 @@
margin: $space 0;
}
.refund-tag {
width: 55%;
padding: 5px 0;
border-radius: 10px;
margin: 0 auto;
background-color: orange;
color: #fff;
}
.change-tag {
margin: 10px auto 0;
color: #1b1b1b;
&:hover {
background-color: #1b1b1b;
color: #fff;
}
}
.badge {
min-width: 16px;
line-height: 16px;
... ...