This commit is contained in:
marzban-dev
2025-03-22 23:43:49 +03:30
parent 852a09c298
commit 2106f3f40b
56 changed files with 198 additions and 161 deletions
@@ -109,7 +109,7 @@ watch(
(newValue) => {
if (!isEditing.value) {
addressData.value.phone =
newValue == "بله" ? account.value?.phone : "";
newValue == "بله" ? account.value!.phone : "";
}
},
{
@@ -21,18 +21,17 @@ const discountCode = ref(cart.value?.discount_code?.code || "");
const {
mutateAsync: submitDiscountCode,
isPending: submitDiscountCodeIsPending,
isPending: submitDiscountCodeIsPending
} = useSubmitDiscountCode();
const {
mutateAsync: deleteDiscountCode,
isPending: deleteDiscountCodeIsPending,
isPending: deleteDiscountCodeIsPending
} = useDeleteDiscountCode();
// computed
const nextPage: ComputedRef<{ name: string; label: string } | undefined> =
computed(() => route.meta.nextPage);
const nextPage = computed(() => route.meta.nextPage as { name: string; label: string } | undefined);
const hasSubmittedDiscountCode = computed(() => !!cart.value?.discount_code);
@@ -49,11 +48,11 @@ const handleSubmitDiscountCode = () => {
addToast({
message: "خطایی در ثبت کد تخفیف رخ داد",
options: {
status: "error",
},
status: "error"
}
});
discountCode.value = "";
},
}
}
);
};
@@ -68,11 +67,11 @@ const handleDeleteDiscountCode = () => {
addToast({
message: "خطایی در حذف کد تخفیف رخ داد",
options: {
status: "error",
},
status: "error"
}
});
discountCode.value = "";
},
}
});
};
</script>
@@ -44,7 +44,7 @@ const { data: cart, isLoading: cartIsLoading } = useGetCartOrders();
</div>
<div
v-if="cart?.items.length > 5"
v-if="cart && cart.items.length > 5"
class="h-7 flex-center col-span-full lg:hidden"
>
<button