This commit is contained in:
Mamalizz
2025-01-19 19:21:47 +03:30
26 changed files with 1657 additions and 89 deletions
+13 -7
View File
@@ -19,24 +19,24 @@ const { logout } = useAuth();
const nav_links = ref<NavLink[]>([
{
title: "فروشگاه",
path: "#",
path: "#"
},
{
title: "دسته بندی ها",
path: "#",
path: "#"
},
{
title: "جستجو",
path: "#",
path: "#"
},
{
title: "ارتباط با ما",
path: "#",
path: "#"
},
{
title: "امکانات",
path: "#",
},
path: "#"
}
]);
</script>
@@ -53,7 +53,13 @@ const nav_links = ref<NavLink[]>([
<button @click="() => logout(true)">خروج از وبسایت</button>
</div>
<div v-else class="text-black">KIR</div>
<button
@click="navigateTo('/signin')"
class="cursor-pointer"
v-else
>
وارد شوید
</button>
<nav
class="flex-center gap-[2.5rem] w-8/12 typo-label-sm text-slate-500"
@@ -2,7 +2,8 @@
// import
import type { ToastOptions } from "~/composables/useToast";
import type { ToastOptions } from "~/composables/global/useToast";
import { useToast } from "~/composables/global/useToast";
// type
+1
View File
@@ -61,6 +61,7 @@ const onSwiper = (swiper: SwiperClass) => {
:key="slide.id"
>
<CategoryCard
:id="slide.id"
category="یک دسته بندی تست"
picture="/img/product-1.jpg"
:count="20"
@@ -7,6 +7,7 @@ import ChatInput from "~/components/product/ChatBox/ChatInput.vue";
import { useIsMutating } from "@tanstack/vue-query";
import { MUTATION_KEYS } from "~/constants";
import CloseButton from "~/components/product/ChatBox/CloseButton.vue";
import { useAuth } from "~/composables/api/auth/useAuth";
// provide-inject
@@ -14,6 +15,8 @@ const { isOpen } = inject("isOpen") as any;
// state
const { isLoggedIn } = useAuth();
const route = useRoute();
const id = route.params.id as string | number;
@@ -126,55 +129,62 @@ whenever(
>
<CloseButton :disabled="!!isCreateMessagePending" />
<Transition name="zoom" mode="out-in">
<div
v-if="!isChatPending"
class="p-4.5 h-full flex flex-col justify-between gap-4"
>
<template v-if="isLoggedIn">
<Transition name="zoom" mode="out-in">
<div
:style="{
v-if="!isChatPending"
class="p-4.5 h-full flex flex-col justify-between gap-4"
>
<div
:style="{
maskImage:
'linear-gradient(to top, transparent, black 5%, black, black)',
}"
class="hide-scrollbar flex flex-col py-7 gap-6 h-full overflow-y-auto"
ref="chatContainerEl"
>
<div
v-if="hasMoreChat"
class="py-2 flex items-center justify-center"
class="hide-scrollbar flex flex-col py-7 gap-6 h-full overflow-y-auto"
ref="chatContainerEl"
>
<Icon name="svg-spinners:3-dots-fade" size="24" />
<div
v-if="hasMoreChat"
class="py-2 flex items-center justify-center"
>
<Icon name="svg-spinners:3-dots-fade" size="24" />
</div>
<ChatMessage
v-for="(message, index) in chatMessages"
:key="message.id"
:id="message.id"
:reverse="message.sender === 'ai'"
:content="message.content"
:isLast="chatMessages?.length === index + 1"
@textUpdate="scrollToBottom"
/>
<ChatMessage
v-if="!!isCreateMessagePending"
:id="Date.now() + 1"
reverse
content=""
isLast
@textUpdate="scrollToBottom"
:loadingContent="!!isCreateMessagePending"
/>
</div>
<ChatMessage
v-for="(message, index) in chatMessages"
:key="message.id"
:id="message.id"
:reverse="message.sender === 'ai'"
:content="message.content"
:isLast="chatMessages?.length === index + 1"
@textUpdate="scrollToBottom"
/>
<ChatMessage
v-if="!!isCreateMessagePending"
:id="Date.now() + 1"
reverse
content=""
isLast
@textUpdate="scrollToBottom"
:loadingContent="!!isCreateMessagePending"
/>
<ChatInput />
</div>
<ChatInput />
</div>
<div
v-else
class="w-full h-full flex items-center justify-center absolute inset-0"
>
<AiLoading />
</div>
</Transition>
<div
v-else
class="w-full h-full flex items-center justify-center absolute inset-0"
>
<AiLoading />
</div>
</Transition>
</template>
<div class="text-black p-4.5 size-full flex justify-center items-center" v-else>
Please sign in first
</div>
</div>
</Transition>
</template>