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

View File

@ -228,14 +228,10 @@ const handlePagination = (prevNextIndicator: string) => {
.getRequest(url) .getRequest(url)
.then((res) => { .then((res) => {
state.selectedItem = res.hits.hits?.[0]; state.selectedItem = res.hits.hits?.[0];
page_num.value = res.hits.hits[0]._source.address.page_num ?? 1;
}) })
.finally(() => (loading.value = false)); .finally(() => (loading.value = false));
}; };
const page_num = ref(1);
const handlePageChange = () => {
handlePagination(1, page_num.value);
};
// const localCopyTextToClipboard = (text: string) => { // const localCopyTextToClipboard = (text: string) => {
// copyTextToClipboard(text); // copyTextToClipboard(text);
// }; // };
@ -417,24 +413,24 @@ const handlePageChange = () => {
<div class="body-footer"> <div class="body-footer">
<div class="mt-5 z-2"> <div class="mt-5 z-2">
<!-- <div class="flex justify-between actions"> --> <!-- <div class="flex justify-between actions">
<!-- <UButton <UButton
disabled disabled
class="similar-btn" class="similar-btn"
icon="i-haditha-search-3" icon="i-haditha-search-3"
label="مشابه" label="مشابه"
color="neutral" color="neutral"
variant="outline" variant="outline"
/> --> @click.prevent="goToTheSearch('similar')"
<!-- @click.prevent="goToTheSearch('similar')" --> />
<!-- <UButton <UButton
class="explore-btn" class="explore-btn"
trailing-icon="i-haditha-explore" trailing-icon="i-haditha-explore"
label="کاوش" label="کاوش"
variant="solid" variant="solid"
@click.prevent="goToTheChatbot" @click.prevent="goToTheChatbot"
/> --> />
<!-- </div> --> </div> -->
<div class="flex justify-between pagination"> <div class="flex justify-between pagination">
<UButton <UButton
@click="handlePagination('-1')" @click="handlePagination('-1')"
@ -444,27 +440,6 @@ const handlePageChange = () => {
variant="soft" variant="soft"
icon="i-haditha-chevron-right" 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 <UButton
@click="handlePagination('1')" @click="handlePagination('1')"
class="next-haditha" class="next-haditha"
@ -803,15 +778,6 @@ const handlePageChange = () => {
text-align: right; text-align: right;
color: var(--ui-color-two); 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;
}
} }
} }
} }