cancel order

This commit is contained in:
Edward Yang 2022-08-25 16:38:03 +08:00
parent bb640e53de
commit 739aceb8bd
1 changed files with 8 additions and 1 deletions

View File

@ -17,7 +17,7 @@
<div>
@if ($order->status == 'unpaid')
<a href="{{ shop_route('orders.pay', $order->number) }}" class="btn btn-primary btn-sm nowrap">{{ __('shop/account.order.order_info.to_pay') }}</a>
<a href="{{ shop_route('orders.cancel', $order->number) }}" class="btn btn-primary btn-sm nowrap">{{ __('shop/account.order.order_info.cancel') }}</a>
<button class="btn btn-primary btn-sm cancel-order" type="button">{{ __('shop/account.order.order_info.cancel') }}</button>
@endif
@if ($order->status == 'shipped')
<button class="btn btn-primary btn-sm shipped-ed" type="button">{{ __('shop/account.order.order_info.confirm_receipt') }}</button>
@ -146,5 +146,12 @@
window.location.reload()
})
});
$('.cancel-order').click(function(event) {
$http.post('orders/{{ $order->number }}/cancel').then((res) => {
layer.msg(res.message)
window.location.reload()
})
});
</script>
@endpush