changes
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
<script setup>
|
||||
import CartItem from "~/components/pos/CartItem.vue";
|
||||
import useActiveCart from "~/components/pos/composables/useActiveCart";
|
||||
import useOrderInfo from "~/components/pos/composables/useOrderInfo";
|
||||
import usePlaceOrder from "~/components/pos/composables/usePlaceOrder";
|
||||
|
||||
const id = "confirmOrderModal";
|
||||
const emit = defineEmits(["close"]);
|
||||
const { activeCart, activeCartItems, invalidCartItems, orderInfo, fullAddress, getCarts, subtotal, total } =
|
||||
inject("pos");
|
||||
|
||||
const posStore = usePosStore();
|
||||
const { orderInfo, invalidCartItems } = storeToRefs(posStore);
|
||||
const { activeCart, activeCartItems, subtotal } = useActiveCart();
|
||||
const { fullAddress, total } = useOrderInfo();
|
||||
const { isPending, showVietQRModal, placeOrder, testReturnPage } = usePlaceOrder({
|
||||
activeCart,
|
||||
activeCartItems,
|
||||
invalidCartItems,
|
||||
orderInfo,
|
||||
fullAddress,
|
||||
subtotal,
|
||||
total,
|
||||
getCarts,
|
||||
onSuccess: () => emit("close"),
|
||||
});
|
||||
</script>
|
||||
@@ -144,6 +139,7 @@ const { isPending, showVietQRModal, placeOrder, testReturnPage } = usePlaceOrder
|
||||
<button
|
||||
@click="placeOrder"
|
||||
:class="['button is-success', isPending && 'is-loading']"
|
||||
:disabled="invalidCartItems.length > 0 || activeCartItems.length === 0"
|
||||
>
|
||||
Đặt hàng
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user