Authored by lea guo

订单: 出售订单删除(代码优化引起重复bug)

... ... @@ -13,8 +13,13 @@ export default {
methods: {
...mapActions(['cancelTradeConfirmInfo', 'cancelTrade']),
...inSaleMapMutations(['filterInSaleOrderList']),
async onInSaleOrderAction({ action, order, isDetail = false } = {}) {
const { owner = ownType.SELL } = this.$route.params;
async onInSaleOrderAction({
action,
order,
isDetail = false, // 是否是详情
isInSale = false, // 是否是出售中
} = {}) {
const { owner = ownType.SELL, status } = this.$route.params;
const { orderCode, earnestMoney = 0 } = order;
switch (action.name) {
... ... @@ -42,7 +47,15 @@ export default {
if (isDetail) {
this.fetchOrderDetail(this.$route.params);
} else {
if (isInSale) {
this.filterInSaleOrderList(orderCode);
} else {
this.filterOrderList({
orderCode,
owner,
status,
});
}
}
}
},
... ...
... ... @@ -17,7 +17,10 @@
<order-actions
class="actions"
:order="order"
@on-action="action => onInSaleOrderAction({ action, order })"
@on-action="
action =>
onInSaleOrderAction({ action, order, isInSale: true })
"
/>
</div>
</li>
... ...