Authored by TaoHuang

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -34,7 +34,12 @@ export default {
}
},
methods: {
...mapActions(["deleteOrder", "cancelTradeConfirmInfo", "cancelTrade"]),
...mapActions([
"deleteOrder",
"cancelTradeConfirmInfo",
"cancelTrade",
"confirmReceipt"
]),
async onAction(action) {
const { owner = ownType.SELL } = this.$route.params;
const {
... ... @@ -44,7 +49,7 @@ export default {
priceInfo = {}
} = this.order;
const { productId, storageId } = this.order.goodsInfo;
const { productId, storageId, skup } = this.order.goodsInfo;
switch (action.name) {
// 删除订单
... ... @@ -65,39 +70,55 @@ export default {
// 再次购买
case orderActionsMap.BUY_AGAIN.name:
this.$router.push({
path: `/xianyu/product/${productId}.html`
name: "ProductDetail",
params: { productId }
});
break;
// 查看详情
case orderActionsMap.SHOW_DETAIL.name:
const name =
owner === ownType.SELL ? "sellOrderDetail" : "buyOrderDetail";
this.$router.push({
path: `/xianyu/${owner}/order/detail/${orderCode}`
name,
params: { owner, orderCode }
});
break;
// 再次出售
case orderActionsMap.SOLD_AGAIN.name:
this.$router.push({
path: "/xianyu/order/sellconfirm.html",
name: "OrderSellConfirm",
query: { productId, storageId }
});
break;
// 查看物流
case orderActionsMap.SHOW_EXPRESS.name:
this.$router.push({
path: `/xianyu/${owner}/order/logistics/${orderCode}`
name: "orderLogisticsInfo",
params: { owner, orderCode }
});
break;
// 调价
// 非入住商家
case orderActionsMap.NOT_ENTRY_CHANGE_PRICE.name:
this.$router.push({
path: `/xianyu/order/priceChangeNoEntry/${orderCode}.html`
name: "PriceChangeNoEntry",
params: { orderCode }
});
break;
// 入住商家
case orderActionsMap.STORAGE_MANAGE:
case orderActionsMap.STORAGE_MANAGE.name:
this.$router.push({
name: "PriceChangeEntry",
params: { orderId: productId }
});
break;
// 我要发货
case orderActionsMap.DELIVER_GOODS.name:
this.$router.push({
path: `/xianyu/order/priceChangeEntry/${productId}.html`
name: "order.deliver",
params: { skup, code: orderCode }
});
break;
... ... @@ -150,7 +171,7 @@ export default {
desc: "保证金"
}).show();
break;
// 订单列表和订单详情字段不一致
case orderActionsMap.NOW_BUY.name:
this.$createOrderPayType({
orderCode,
... ... @@ -159,6 +180,21 @@ export default {
}).show();
break;
case orderActionsMap.CONFIRM_DELIVERY.name:
this.$createDialog({
type: "confirm",
onConfirm: async () => {
const isOk = await this.confirmReceipt({
orderCode,
owner
});
// const txt = isOk ? "收货成功" : "收货失败";
// this.$createToast({ txt, type: "txt" }).show();
}
});
break;
default:
return;
}
... ...
... ... @@ -132,6 +132,17 @@ export default function() {
return res.code === 200 ? res.data : null;
},
/**
* 确认收货
*/
async confirmReceipt(_, { orderCode }) {
const res = await this.$api.post('/api/buy/confirm/receipt', {
orderCode,
});
return res.code === 200 ? res.data : null;
},
},
getters: {},
};
... ...
... ... @@ -49,10 +49,11 @@ export const buyerOrderStatusList = [
value: 1,
text: '全部',
},
{
value: 7,
text: '求购',
},
// {
// value: 7,
// text: '求购',
// },
{
value: 2,
text: '待付款',
... ... @@ -133,4 +134,9 @@ export const orderActionsMap = {
text: '确认收货',
},
PAY_DEPOSIT: { code: 'pay_deposit', name: 'PAY_DEPOSIT', text: '支付定金' },
DELIVER_GOODS: {
code: 'deliver_goods',
name: 'DELIVER_GOODS',
text: '我要发货',
},
};
... ...