changes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export default function useOrderInfo({ activeCartId, activeCart, activeCartItems, addresses, getAddresses }) {
|
||||
const orderInfo = ref({
|
||||
address: null,
|
||||
receiver_name: null,
|
||||
receiver_phone: null,
|
||||
deliveryMethod: null,
|
||||
paymentMethod: null,
|
||||
});
|
||||
@@ -18,10 +20,14 @@ export default function useOrderInfo({ activeCartId, activeCart, activeCartItems
|
||||
if (!oldVal || !oldVal.customer || oldVal.customer !== newVal.customer) {
|
||||
const defaultAddress = addresses.value.find((add) => add.is_default);
|
||||
orderInfo.value.address = defaultAddress;
|
||||
orderInfo.value.receiver_name = newVal.customer__fullname;
|
||||
orderInfo.value.receiver_phone = newVal.customer__phone;
|
||||
}
|
||||
} else {
|
||||
addresses.value = null;
|
||||
orderInfo.value.address = null;
|
||||
orderInfo.value.receiver_name = null;
|
||||
orderInfo.value.receiver_phone = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user