From 358ced7603f7996a7821fd04004721c49687fbe7 Mon Sep 17 00:00:00 2001 From: mustafa-rezae Date: Sat, 12 Apr 2025 14:42:52 +0330 Subject: [PATCH] Work on library show page. --- apis/hadithaApi.js | 3 +- components/haditha/AutoComplation.vue | 15 - components/haditha/CardList.vue | 74 +++-- components/haditha/login/EnterMobile.vue | 27 +- components/haditha/login/EnterVerifyCode.vue | 2 - pages/haditha/favorites/index.vue | 6 +- pages/haditha/library/[id]/[slug]/index.vue | 306 ++++++++++++++++--- pages/haditha/library/index.vue | 2 +- pages/haditha/public-pages/index.vue | 1 - pages/haditha/search/[id]/[slug]/index.vue | 13 +- pages/haditha/search/index.vue | 2 - 11 files changed, 336 insertions(+), 115 deletions(-) diff --git a/apis/hadithaApi.js b/apis/hadithaApi.js index b935e4f..9866e85 100644 --- a/apis/hadithaApi.js +++ b/apis/hadithaApi.js @@ -17,10 +17,11 @@ export default { setCategories: "favorite/tags/@data_type/set", getCounts: "favorite/tags/@data_type/counts", - getList: "favorite/list/@data_type/@offset/@limit/@filter", + getList: "favorite/list/@data_type/@offset/@limit", }, library: { list: "monir/book/volume/@field_collapsed/@offset/@limit/@q", show: "@appname/book/page/@page_start/@page_end/@vol_id", + prevNextHadith: "monir/nextpage/@index_key/@vol_id/@page_num/@step", }, }; diff --git a/components/haditha/AutoComplation.vue b/components/haditha/AutoComplation.vue index 048285c..fb8cea3 100644 --- a/components/haditha/AutoComplation.vue +++ b/components/haditha/AutoComplation.vue @@ -82,7 +82,6 @@ const state = reactive({ value: "normal", class: "", onSelect(e: Event) { - console.info(e); search_type.value = "normal"; state.type.label = e.explicitOriginalTarget?.innerText; sendQuery(); @@ -98,7 +97,6 @@ const state = reactive({ onSelect(e: Event) { search_type.value = "arabic"; state.type.label = e.explicitOriginalTarget?.innerText; - console.info(e); state.type.items[0].class = "active"; sendQuery(); @@ -112,7 +110,6 @@ const state = reactive({ onSelect(e: Event) { search_type.value = "translations"; state.type.label = e.explicitOriginalTarget?.innerText; - console.info(e); state.type.items[0].class = "active"; sendQuery(); @@ -127,8 +124,6 @@ const state = reactive({ search_type.value = "descriptions"; state.type.label = e.explicitOriginalTarget?.innerText; state.type.items[0].class = "active"; - console.info(e); - sendQuery(); }, }, @@ -155,7 +150,6 @@ const state = reactive({ // watch( // () => route, // (newRoute, oldRoute) => { -// console.info(newRoute.query); // if (newRoute.query) searchTerm.value = newRoute.query.q; // }, // { immediate: true } @@ -282,15 +276,12 @@ const onClearSynonymClear = () => { async function openSynonymPopup(type: string) { search_type.value = type; - console.info("openSynonymPopup"); getSynonyms().then(() => { isSynonymPopupOpen.value = true; }); } const onTypeSelectChanged = (value: string) => { - console.info(value); - if (value == "translations") typeModelValueFa.value = "ترجمه"; else if (value == "arabic") typeModelValueFa.value = "عربی"; else if (value == "descriptions") typeModelValueFa.value = "شروح"; @@ -332,11 +323,7 @@ const prepareSynonym = () => { const enabledSwitches = state.synonym.items.filter((i) => i.enable); const res = {}; - console.info(enabledSwitches); - enabledSwitches.forEach((item) => { - console.info(item); - if (item.subTitles.length) res[item.title] = item.subTitles .filter((i) => i.active) @@ -344,8 +331,6 @@ const prepareSynonym = () => { .join(","); }); - console.info(res); - return { synonym: res, }; diff --git a/components/haditha/CardList.vue b/components/haditha/CardList.vue index 03821d8..b63e54c 100644 --- a/components/haditha/CardList.vue +++ b/components/haditha/CardList.vue @@ -12,6 +12,21 @@ const props = defineProps({ default: "/img/haditha/no-data.png", }, }); + +const router = useRouter(); + +const goToLibraryShow = (item) => { + router.push({ + name: "hadithaLibraryShow", + params: { + id: item?._source?.id, + slug: item?._source?.title, + }, + query: { + firstPage: item._source.page_first, + }, + }); +};