diff --git a/definitions/cms/page.type.ts b/definitions/cms/page.type.ts
index 80c545c..49a1d9c 100644
--- a/definitions/cms/page.type.ts
+++ b/definitions/cms/page.type.ts
@@ -146,6 +146,7 @@ export const pageSectionTempaltes = {
],
[enumPageSectionKey.ARTICLE]: [
{ title: "Phân vùng bài viết cơ bản", value: enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DEFAULT'] },
+ { title: "Thẻ bài viết chi tiết", value: enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DETAIL'] },
],
[enumPageSectionKey.SECTION]: [
{ title: "Phân vùng Hoa hậu", value: enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES'] },
@@ -158,6 +159,7 @@ export const pageSectionLayouts = {
{ title: "Trái 1 Cột, giữa 2 Cột, phải 3 Cột", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_ONE_TWO_THREE'] },
{ title: "2 Cột, bên trái rộng", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_LEFT_TWO'] },
{ title: "6 Cột, phải 5 cột", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_ONE_FIVE'] },
+ { title: "5 Cột, phải 4 cột", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_ONE_FOUR'] },
{ title: "2 Cột, bên phải rộng", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_RIGHT_TWO'] },
{ title: "3 Cột", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_THREE'] },
{ title: "4 Cột", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]['VERTICAL_FOUR'] },
@@ -178,6 +180,10 @@ export const pageSectionLayouts = {
[`${enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES']}`]: [
{ title: "Cơ bản", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES']}`]['DEFAULT'] },
],
+
+ [`${enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DETAIL']}`]: [
+ { title: "Cơ bản", value: enumPageSectionLayouts[`${enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DETAIL']}`]['DEFAULT'] },
+ ],
};
/* COMPONENT SETTINGS */
@@ -238,6 +244,9 @@ export const pageComponentLayouts = {
{ title: "Chi tiết bài Podcast", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_PODCAST'] },
{ title: "Chi tiết bài Video", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_VIDEO'] },
{ title: "Chi tiết bài Image", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_IMAGE'] },
+ { title: "Chi tiết bài eMagazine", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_EMAGAZINE'] },
+ { title: "Chi tiết bài Inforgraphic", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_INFOGRAPHIC'] },
+ { title: "Controls", value: enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.ARTICLE]['ARTICLE_DETAIL']]['DETAIL_CONTROL'] },
],
/* NAVIGATION */
[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]: [
diff --git a/definitions/enum/page.enum.ts b/definitions/enum/page.enum.ts
index 634b7a4..604d1c8 100644
--- a/definitions/enum/page.enum.ts
+++ b/definitions/enum/page.enum.ts
@@ -221,6 +221,7 @@ export const enumPageSectionTemplate = {
},
[enumPageSectionKey.ARTICLE]: {
'DEFAULT': "TYPE:Default",
+ 'DETAIL': 'TYPE:Detail'
},
[enumPageSectionKey.SECTION]: {
'DEFAULT': "TYPE:Default",
@@ -229,9 +230,11 @@ export const enumPageSectionTemplate = {
};
export const enumPageSectionLayouts = {
+ /* None */
[`${enumPageSectionTemplate[enumPageSectionKey.NONE]['NONE']}`]: {
'VERTICAL_TWO': 'LAYOUT:vertical-TYPE:Default-MAX:2',
'VERTICAL_ONE_TWO_THREE': 'LAYOUT:vertical-TYPE:Left:1;CENTER:2;RIGHT:3',
+ 'VERTICAL_ONE_FOUR': 'LAYOUT:vertical-TYPE:Left:1;RIGHT:4-Max:2',
'VERTICAL_ONE_FIVE': 'LAYOUT:vertical-TYPE:Left:1;RIGHT:5',
'VERTICAL_LEFT_TWO': 'LAYOUT:vertical-TYPE:LEFT-MAX:2',
'VERTICAL_RIGHT_TWO': 'LAYOUT:vertical-TYPE:RIGHT-MAX:2',
@@ -251,8 +254,15 @@ export const enumPageSectionLayouts = {
'HORIZONTAL_NINE': 'LAYOUT:horizontal-TYPE:Default-MAX:9',
'HORIZONTAL_TEN': 'LAYOUT:horizontal-TYPE:Default-MAX:10',
},
+
+ /* Section */
[`${enumPageSectionTemplate[enumPageSectionKey.SECTION]['MISSES']}`]: {
'DEFAULT': 'LAYOUT:Default-TYPE:Default-MAX:1',
+ },
+
+ /* Article */
+ [`${enumPageSectionTemplate[enumPageSectionKey.ARTICLE]['DETAIL']}`]: {
+ 'DEFAULT': 'LAYOUT:Default-TYPE:Default-MAX:2',
}
};
@@ -319,6 +329,9 @@ export const enumPageComponentLayouts = {
'DETAIL_PODCAST': "TYPE:Detail_Podcast",
'DETAIL_VIDEO': "TYPE:Detail_Video",
'DETAIL_IMAGE': "TYPE:Detail_Image",
+ 'DETAIL_EMAGAZINE': "TYPE:Detail_Emagazine",
+ 'DETAIL_INFOGRAPHIC': "TYPE:Detail_Infographic",
+ 'DETAIL_CONTROL': "TYPE:Control"
},
/* NAVIGATION */
[`${enumPageComponentTemplate[enumPageComponentKey.NAVIGATION]['TOP']}`]: {
diff --git a/pages/bai-viet/[slug].vue b/pages/bai-viet/[slug].vue
index dbf9e9f..fe2ec40 100644
--- a/pages/bai-viet/[slug].vue
+++ b/pages/bai-viet/[slug].vue
@@ -19,34 +19,34 @@ import { useDynamicPageStore } from '~/stores/dynamic-page';
import { useArticleStore } from '~/stores/articles';
const loadPage = async () => {
- const article = await store.article.getArticleBySlug(route.params.slug);
- let isContentType = '';
- switch (article.value?.contentType) {
- case 1:
- isContentType = 'trang-chi-tiet-bai-viet-general';
- break;
- case 2:
- isContentType = 'trang-chi-tiet-bai-viet-image';
- break;
- case 3:
- isContentType = 'trang-chi-tiet-podcast';
- break;
- case 4:
- isContentType = 'trang-chi-tiet-bai-viet-video';
- break;
- case 5:
- if (article.value?.layoutType === 4) {
- isContentType = 'trang-chi-tiet-bai-viet-emagazine';
- break;
- }
- if (article.value?.layoutType === 3) {
- isContentType = 'trang-chi-tiet-bai-viet-infographics';
- break;
- }
- default:
- isContentType = 'trang-chi-tiet-bai-viet-general';
- break;
- }
+const article = await store.article.getArticleBySlug(route.params.slug);
+ let isContentType = 'trang-chi-tiet';
+ // switch (article.value?.contentType) {
+ // case 1:
+ // isContentType = 'trang-chi-tiet-bai-viet-general';
+ // break;
+ // case 2:
+ // isContentType = 'trang-chi-tiet-bai-viet-image';
+ // break;
+ // case 3:
+ // isContentType = 'trang-chi-tiet-podcast';
+ // break;
+ // case 4:
+ // isContentType = 'trang-chi-tiet-bai-viet-video';
+ // break;
+ // case 5:
+ // if (article.value?.layoutType === 4) {
+ // isContentType = 'trang-chi-tiet-bai-viet-emagazine';
+ // break;
+ // }
+ // if (article.value?.layoutType === 3) {
+ // isContentType = 'trang-chi-tiet-bai-viet-infographics';
+ // break;
+ // }
+ // default:
+ // isContentType = 'trang-chi-tiet-bai-viet-general';
+ // break;
+ // }
const dynamicPage = await store.dynamicPage.fetchPageByCode(isContentType);
return {
@@ -59,16 +59,16 @@ const { data } = await useAsyncData('detail-article', () => loadPage());
const article = data.value?.article;
const dynamicPage = data.value?.dynamicPage;
-const asycnCurrentPage = dynamicPage.currentPage;
-const asycnSectionPublished = dynamicPage.sectionPublished;
-const asycnComponentPublished = dynamicPage.componentPublished;
+const asycnCurrentPage = dynamicPage?.currentPage;
+const asycnSectionPublished = dynamicPage?.sectionPublished;
+const asycnComponentPublished = dynamicPage?.componentPublished;
useSeoMeta({
- title: () => article.title.replace(/<[^>]+>/g, ''),
- description: () => article.intro.replace(/<[^>]+>/g, ''),
- ogTitle: () => article.title.replace(/<[^>]+>/g, ''),
- ogImage: () => article.thumbnail,
- ogDescription: () => article.intro.replace(/<[^>]+>/g, ''),
+ title: () => article?.title.replace(/<[^>]+>/g, ''),
+ description: () => article?.intro.replace(/<[^>]+>/g, ''),
+ ogTitle: () => article?.title.replace(/<[^>]+>/g, ''),
+ ogImage: () => article?.thumbnail,
+ ogDescription: () => article?.intro.replace(/<[^>]+>/g, ''),
twitterCard: () => 'summary_large_image',
})
diff --git a/pages/index.vue b/pages/index.vue
index 5ab611b..e6a7581 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -7,7 +7,10 @@ import { useDynamicPageStore } from '~/stores/dynamic-page';
const route = useRoute();
const store = reactive({
dynamicPage: useDynamicPageStore(),
+ category: useCategoryStore()
});
+//lấy danh sách categoryTree
+await store.category.fetchBySiteId()
const { data } = await useAsyncData('index', () => store.dynamicPage.fetchPageByCode(route.path === '/' ? 'trang-chu' : route.path.replace('/', '')))
const asycnCurrentPage = data.value.currentPage;
@@ -28,6 +31,7 @@ useHead({
{
- const result = {
- videoHightlight: null,
- imageHightlight: null,
- resources: [],
- };
- const $ = cherrio.load(`${data}
`)
- const html : any = $('.get-resource').html();
- html.find('video, figure img, img').each((index : any, element: any) => {
- // if (index === 0) result.videoHightlight =
- });
+ // const result = {
+ // videoHightlight: null,
+ // imageHightlight: null,
+ // resources: [],
+ // };
+ // const $ = cherrio.load(`${data}
`)
+ // const html : any = $('.get-resource').html();
+ // html.find('video, figure img, img').each((index : any, element: any) => {
+ // // if (index === 0) result.videoHightlight =
+ // });
- console.log(html)
+ // console.log(html)
//
//