Update search show page

This commit is contained in:
mustafa-rezae 2025-04-16 19:28:58 +03:30
parent 05d548399b
commit 26f19fb9fc
2 changed files with 18 additions and 50 deletions

View File

@ -1,6 +1,14 @@
<script setup lang="ts">
import { useAuthStore } from "@stores/authStore";
// {
// label: "چت بات",
// icon: "i-haditha-chat-bot",
// to: "/haditha/chat-bot",
// slot: "chat-bot",
// class: "flex flex-col lg:flex-row justify-center items-center",
// },
const items = ref([
{
label: "حانه",
@ -16,13 +24,7 @@ const items = ref([
slot: "search",
class: "flex flex-col lg:flex-row justify-center items-center",
},
{
label: "چت بات",
icon: "i-haditha-chat-bot",
to: "/haditha/chat-bot",
slot: "chat-bot",
class: "flex flex-col lg:flex-row justify-center items-center",
},
{
label: "کتابخانه",
icon: "i-haditha-library",
@ -161,7 +163,7 @@ onMounted(() => {
<template>
<div class="fixed bottom-2 lg:bottom-auto lg:top-2 right-0 left-0">
<UContainer class="flex my-navbar mx-3 lg:mx-auto">
<UContainer class="flex my-navbar mx-3 lg:mx-auto">
<!-- :disableHoverTrigge="isMobile" -->
<UNavigationMenu
:key="rerenderNavigation"

View File

@ -228,14 +228,10 @@ const handlePagination = (prevNextIndicator: string) => {
.getRequest(url)
.then((res) => {
state.selectedItem = res.hits.hits?.[0];
page_num.value = res.hits.hits[0]._source.address.page_num ?? 1;
})
.finally(() => (loading.value = false));
};
const page_num = ref(1);
const handlePageChange = () => {
handlePagination(1, page_num.value);
};
// const localCopyTextToClipboard = (text: string) => {
// copyTextToClipboard(text);
// };
@ -417,24 +413,24 @@ const handlePageChange = () => {
<div class="body-footer">
<div class="mt-5 z-2">
<!-- <div class="flex justify-between actions"> -->
<!-- <UButton
<!-- <div class="flex justify-between actions">
<UButton
disabled
class="similar-btn"
icon="i-haditha-search-3"
label="مشابه"
color="neutral"
variant="outline"
/> -->
<!-- @click.prevent="goToTheSearch('similar')" -->
<!-- <UButton
@click.prevent="goToTheSearch('similar')"
/>
<UButton
class="explore-btn"
trailing-icon="i-haditha-explore"
label="کاوش"
variant="solid"
@click.prevent="goToTheChatbot"
/> -->
<!-- </div> -->
/>
</div> -->
<div class="flex justify-between pagination">
<UButton
@click="handlePagination('-1')"
@ -444,27 +440,6 @@ const handlePageChange = () => {
variant="soft"
icon="i-haditha-chevron-right"
/>
<div class="flex items-center">
<span class="total-pages">{{ route.query.page_count }}</span>
<span class="mx-2">/</span>
<UInput
:disabled="loading"
color="neutral"
variant="outline"
v-model="page_num"
@change="handlePageChange"
:ui="{
root: 'root ',
base: 'base page-number-input',
leading: 'leading',
leadingIcon: 'leadingIcon',
leadingAvatar: 'leadingAvatar',
leadingAvatarSize: 'leadingAvatarSize',
trailing: 'trailing',
trailingIcon: 'trailingIcon',
}"
/>
</div>
<UButton
@click="handlePagination('1')"
class="next-haditha"
@ -803,15 +778,6 @@ const handlePageChange = () => {
text-align: right;
color: var(--ui-color-two);
}
.total-pages {
font-family: IRANSansX;
font-weight: 400;
font-size: 12px;
line-height: 100%;
letter-spacing: 0%;
text-align: right;
color: #8a92a8;
}
}
}
}