Update files.

This commit is contained in:
mustafa-rezae 2025-04-26 13:11:56 +03:30
parent 0db2ba3f38
commit 30cad3040c
4 changed files with 69 additions and 13 deletions

View File

@ -16,6 +16,9 @@ const props = defineProps({
noDataIcon: {
default: "/img/haditha/no-data.png",
},
searchTerm: {
default: "",
},
});
const router = useRouter();
const route = useRoute();
@ -23,7 +26,7 @@ const route = useRoute();
// const modal = useModal();
// const isModalOpen = ref(false);
function openModal(selectedItem) {
function goToSearchShowPage(selectedItem) {
// modal.open(SearchShow, { title: "Welcome" });
// isModalOpen.value = true;
@ -39,8 +42,7 @@ function openModal(selectedItem) {
slug: slug,
},
query: {
firstPage: 1,
page_count: props.total,
q: props.searchTerm,
},
});
}
@ -87,7 +89,7 @@ const removeFromFavorites = async (item = {}, index = 0) => {
item?._source?.meta?.hadith_masoum ??
item?._source?.meta?.hadith_sanad
}`"
@click.prevent="openModal(item)"
@click.prevent="goToSearchShowPage(item)"
class="from-person block"
>
{{
@ -106,14 +108,14 @@ const removeFromFavorites = async (item = {}, index = 0) => {
</div>
<a
@click.prevent="openModal(item)"
@click.prevent="goToSearchShowPage(item)"
class="arabic-text block"
:href="`/haditha/search/${item?._source?.id}/${item?._source?.content_ar}`"
>
{{ item?._source?.content_ar }}
</a>
<a
@click.prevent="openModal(item)"
@click.prevent="goToSearchShowPage(item)"
:href="`/haditha/search/${item?._source?.id}/${item?._source?.content}`"
class="persian-text block"
v-html="item?.highlight?.['content.fa'] ?? item?._source?.content"

View File

@ -195,7 +195,17 @@ const SearchList = defineAsyncComponent(() =>
<navigation-menu></navigation-menu>
<div class="text-logo">
<div class="search-box-container pb-0 flex justify-center">
<div
v-if="state.list?.length"
class="search-box-container pb-0 flex justify-center"
>
<div class="search-list-contianer">
<div class="total">
<span>{{ total }}</span>
نتیجه
</div>
<div ref="el" class="search-list firefox-scrollbar hadithaFavorites">
<search-list
no-data-text="هنوز چیزی ذخیره نکرده‌اید!"
no-data-icon="/img/haditha/save.png"
@ -205,6 +215,15 @@ const SearchList = defineAsyncComponent(() =>
</div>
</div>
</div>
<no-data
v-else
class="h-full w-full flex flex-col justify-center items-center"
>
<img fit="auto" quality="80" src="/img/haditha/save.png" />
<p class="no-data-text">هنوز چیزی ذخیره نکردهاید!</p>
</no-data>
</div>
</div>
</div>
</HadithaLayout>
</template>
@ -231,4 +250,35 @@ const SearchList = defineAsyncComponent(() =>
padding-bottom: 0 !important;
}
}
.search-list-contianer {
max-width: 41em; /*656px*/
width: 100%;
margin: 0 1em;
.total {
padding: 0.5em 1.8em;
font-family: IRANSansX;
font-weight: 400;
font-size: 0.68rem; /*11px*/
line-height: 1rem;
letter-spacing: 0%;
text-align: right;
color: #b4c2cf;
}
.search-list {
padding: 1em 1.3em;
height: calc(100dvh - 16em);
overflow-y: auto;
&.hadithaFavorites {
height: calc(100dvh - 8em);
}
&:not(:last-child) {
border-bottom: 0.3px solid #d9d9d9;
}
}
}
</style>

View File

@ -86,6 +86,9 @@ fetchData();
const goToTheSearch = (type: string) => {
router.push({
name: "hadithaSearch",
query: {
q: route.query.q ?? "",
},
});
};
const goToTheChatbot = () => {

View File

@ -769,6 +769,7 @@ const SearchList = defineAsyncComponent(
no-data-icon="/img/haditha/no-data.png"
:total="total"
:list="loadedItems"
:searchTerm="searchTerm"
></search-list>
</div>
</div>