- Cataloghi: BestSeller, Novità
This commit is contained in:
@@ -85,8 +85,28 @@ body {
|
||||
font-family: 'DINPro-BoldItalic', sans-serif;
|
||||
}
|
||||
|
||||
|
||||
.book-details {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
|
||||
.book-descr-estesa {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
.book-novita {
|
||||
font-size: calc(20 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
|
||||
.book-text-up {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(20 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
.book-text-down {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { CProductCard } from '@src/components/CProductCard'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import { ICatalogo, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
|
||||
import { ICatalogo, IDimensioni, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
|
||||
|
||||
// import { VueHtmlToPaper } from 'vue-html-to-paper'
|
||||
import html2pdf from 'html2pdf.js'
|
||||
@@ -192,7 +192,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function calcArrProducts() {
|
||||
// console.log('calcArrProducts')
|
||||
console.log('calcArrProducts')
|
||||
|
||||
// eventuali titoli specifici estratti dall'array di Prodotti Selezionati
|
||||
//const searchtext = getSearchText()
|
||||
@@ -270,20 +270,12 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
// console.log('filter.value.sort', filter.value.sort)
|
||||
// sort using filter.value.sort :
|
||||
if (filter.value.sort === costanti.SORT_PUBDATE) {
|
||||
|
||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||
return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts
|
||||
})
|
||||
|
||||
} else if (filter.value.sort === costanti.SORT_ALPHA) {
|
||||
|
||||
}
|
||||
arrprod = getProductsSorted(arrprod, filter.value.sort);
|
||||
|
||||
arrProducts.value = arrprod
|
||||
|
||||
populateDataWithlinkIdTemplate()
|
||||
|
||||
generatearrProdToViewSorted()
|
||||
|
||||
loaddata()
|
||||
@@ -291,7 +283,55 @@ export default defineComponent({
|
||||
refreshpage.value = false
|
||||
}
|
||||
|
||||
function getProductsFilteredByScheda(scheda: IMyScheda) {
|
||||
|
||||
function sovrascriviSchedaFromTemplate(idTemplate: string, origScheda: ISchedaSingola) {
|
||||
if (!props.optcatalogo)
|
||||
return
|
||||
|
||||
const arrschede: ISchedaSingola[] = globalStore.getMySchede()
|
||||
const myfindscheda = arrschede.find((recscheda: ISchedaSingola) => recscheda.scheda?._id === idTemplate)
|
||||
|
||||
let mynewscheda = tools.jsonCopy(origScheda)
|
||||
|
||||
const linkIdTemplate = origScheda.scheda?.linkIdTemplate
|
||||
const precname = origScheda.scheda?.name
|
||||
|
||||
if (myfindscheda) {
|
||||
let myschedatocopy = tools.jsonCopy(myfindscheda)
|
||||
|
||||
if (myschedatocopy) {
|
||||
myschedatocopy.scheda._id = origScheda.scheda?._id
|
||||
myschedatocopy.scheda.isTemplate = false
|
||||
myschedatocopy.scheda.name = precname
|
||||
myschedatocopy.scheda.linkIdTemplate = linkIdTemplate
|
||||
|
||||
return myschedatocopy.scheda
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function populateDataWithlinkIdTemplate() {
|
||||
|
||||
if (props.optcatalogo) {
|
||||
|
||||
for (const recscheda of props.optcatalogo.arrSchede!) {
|
||||
if (recscheda.scheda?.linkIdTemplate) {
|
||||
// ricopia da Template:
|
||||
const myscheda = sovrascriviSchedaFromTemplate(recscheda.scheda?.linkIdTemplate, recscheda)
|
||||
if (myscheda) {
|
||||
recscheda.scheda = myscheda
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getProductsFilteredByScheda(scheda: IMyScheda): IProduct[] {
|
||||
|
||||
const searchtext = scheda.arrProdottiSpeciali
|
||||
|
||||
@@ -346,7 +386,7 @@ export default defineComponent({
|
||||
|
||||
if (!boolfiltroVuotoProductTypes) {
|
||||
// check if productInfo.productTypes array includes some item in scheda.ProductTypes array
|
||||
hasProductTypes = !scheda.productTypes || (scheda.productTypes && (product.productInfo.productTypes || []).some((item: any) => scheda.productTypes.includes(item)))
|
||||
hasProductTypes = !scheda.productTypes || (scheda.productTypes && (product.productInfo.productTypes || []).some((item: any) => scheda.productTypes!.includes(item)))
|
||||
}
|
||||
if (!boolfiltroVuotoEditore) {
|
||||
hasPublished = !scheda.editore || (scheda.editore && scheda.editore.includes(product.productInfo.idPublisher!))
|
||||
@@ -354,7 +394,7 @@ export default defineComponent({
|
||||
|
||||
if (!boolfiltroVuotoExcludeProductTypes) {
|
||||
// check if productInfo.productTypes array exclude some item in scheda.ProductTypes array
|
||||
hasExcludeProductTypes = !scheda.excludeproductTypes || (scheda.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => scheda.excludeproductTypes.includes(item)))
|
||||
hasExcludeProductTypes = !scheda.excludeproductTypes || (scheda.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => scheda.excludeproductTypes!.includes(item)))
|
||||
}
|
||||
|
||||
return searchMatch && hasCategoria && hasAuthor && hasProductTypes && hasPublished && !hasExcludeProductTypes;
|
||||
@@ -364,15 +404,35 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
// console.log('filter.value.sort', filter.value.sort)
|
||||
// sort using filter.value.sort :
|
||||
if (scheda.sort === costanti.SORT_PUBDATE) {
|
||||
arrprod = getProductsSorted(arrprod, scheda?.sort!);
|
||||
|
||||
return arrprod
|
||||
|
||||
}
|
||||
|
||||
function getProductsSorted(arrprod: IProduct[], sort: number) {
|
||||
console.log('getProductsSorted', sort)
|
||||
if (sort === costanti.SORT_PUBDATE) {
|
||||
|
||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||
return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts
|
||||
})
|
||||
} else if (sort === costanti.SORT_BESTSELLER) {
|
||||
|
||||
} else if (scheda.sort === costanti.SORT_ALPHA) {
|
||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||
return b.productInfo.rank1Y! - a.productInfo.rank1Y!
|
||||
})
|
||||
|
||||
arrprod = arrprod.map((product, index) => {
|
||||
return {
|
||||
...product,
|
||||
indiceRanking: index + 1
|
||||
};
|
||||
})
|
||||
|
||||
console.log('arr', arrprod)
|
||||
|
||||
} else if (sort === costanti.SORT_DEFAULT) {
|
||||
|
||||
}
|
||||
|
||||
@@ -423,20 +483,43 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function generatearrProdToViewSorted() {
|
||||
// console.log('generatearrProdToViewSorted')
|
||||
console.log('generatearrProdToViewSorted', arrProducts.value)
|
||||
|
||||
// Svuota
|
||||
arrProdToView.value = []
|
||||
|
||||
// gia filtrati
|
||||
const arrGeneraleProdotti = arrProducts.value;
|
||||
|
||||
let indprod = 0
|
||||
let indprodGenerale = 0
|
||||
|
||||
for (const recscheda of props.optcatalogo.arrSchede!) {
|
||||
if (recscheda && recscheda.scheda) {
|
||||
let schedePerRiga = recscheda.scheda.numschede_perRiga || 1
|
||||
let schedePerCol = recscheda.scheda.numschede_perCol || 1
|
||||
let schedePerPagina = schedePerRiga * schedePerCol
|
||||
|
||||
// Filtra i prodotti in base ai filtri impostati !
|
||||
const arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
|
||||
let indprod = 0
|
||||
let arrProdFiltrati: IProduct[] = []
|
||||
|
||||
if (recscheda.scheda.productTypes!.length > 0) {
|
||||
// Filtra i prodotti in base ai filtri impostati !
|
||||
arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
|
||||
indprod = 0
|
||||
} else {
|
||||
if (recscheda.scheda?.sort! > 0) {
|
||||
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort!);
|
||||
indprod = 0
|
||||
} else {
|
||||
indprod = indprodGenerale
|
||||
arrProdFiltrati = arrGeneraleProdotti
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// console.log('arrProdFiltrati indiceRanking = ', arrProdFiltrati[0].indiceRanking)
|
||||
|
||||
let indadded = 0
|
||||
recscheda.arrProdToShow = []
|
||||
|
||||
@@ -463,17 +546,27 @@ export default defineComponent({
|
||||
recscheda.arrProdToShow[pagina][riga] = [];
|
||||
}
|
||||
|
||||
console.log('RANKING: ', result.myrec.indiceRanking!)
|
||||
|
||||
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
|
||||
|
||||
indadded++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (recscheda.numPagineMax! > 0) {
|
||||
if (pagina + 1 >= recscheda.numPagineMax!)
|
||||
break; // fine pagine
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// console.log('*** arrProdToShow', recscheda.arrProdToShow)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Fine...')
|
||||
}
|
||||
|
||||
function getNextProd() {
|
||||
@@ -720,51 +813,8 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function groupedPages(recscheda: ISchedaSingola) {
|
||||
|
||||
let numschedeattuali = 0
|
||||
if (recscheda.scheda) {
|
||||
const schedePerRiga = recscheda.scheda.numschede_perRiga || 1
|
||||
const schedePerCol = recscheda.scheda.numschede_perCol || 1
|
||||
const schedePerPagina = schedePerRiga * schedePerCol
|
||||
|
||||
let indiceprodotto = 0
|
||||
|
||||
const pages = []
|
||||
|
||||
// Iterate attraverso l'array prodotti con step = schedePerPagina
|
||||
for (let pageStart = 0; pageStart < arrProducts.value.length; pageStart += schedePerPagina) {
|
||||
const page = []
|
||||
|
||||
// Crea le righe per questa pagina
|
||||
for (let rowStart = 0; rowStart < schedePerRiga; rowStart++) {
|
||||
const row = []
|
||||
|
||||
// Riempi ogni riga con il numero corretto di prodotti
|
||||
for (let col = 0; col < schedePerCol; col++) {
|
||||
const productIndex = pageStart + (rowStart * schedePerRiga) + col
|
||||
row.push(indiceprodotto)
|
||||
indiceprodotto++
|
||||
}
|
||||
|
||||
page.push(row)
|
||||
}
|
||||
|
||||
numschedeattuali++
|
||||
pages.push(page)
|
||||
|
||||
if (recscheda.numSchede! > 0) {
|
||||
if (numschedeattuali >= recscheda.numSchede!)
|
||||
return pages
|
||||
}
|
||||
}
|
||||
|
||||
return pages
|
||||
}
|
||||
|
||||
return null
|
||||
|
||||
return recscheda.arrProdToShow
|
||||
}
|
||||
|
||||
function generateStyleCatalogo(optcatalogo: ICatalogo) {
|
||||
|
||||
return {
|
||||
@@ -773,19 +823,19 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function generateStylePageScheda(optcatalogo: ICatalogo, scheda: IMyScheda) {
|
||||
const marginTop = scheda.dimensioni?.pagina?.margini?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
|
||||
const marginBottom = scheda.dimensioni?.pagina?.margini?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
|
||||
const marginLeft = scheda.dimensioni?.pagina?.margini?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
|
||||
const marginRight = scheda.dimensioni?.pagina?.margini?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.right): (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
|
||||
const marginTop = scheda.dimensioni?.pagina?.dimensioni?.margini?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
|
||||
const marginBottom = scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
|
||||
const marginLeft = scheda.dimensioni?.pagina?.dimensioni?.margini?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
|
||||
const marginRight = scheda.dimensioni?.pagina?.dimensioni?.margini?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
|
||||
|
||||
const paddingTop = scheda.dimensioni?.pagina?.padding?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
|
||||
const paddingBottom = scheda.dimensioni?.pagina?.padding?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
|
||||
const paddingLeft = scheda.dimensioni?.pagina?.padding?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
|
||||
const paddingRight = scheda.dimensioni?.pagina?.padding?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
|
||||
const paddingTop = scheda.dimensioni?.pagina?.dimensioni?.padding?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
|
||||
const paddingBottom = scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
|
||||
const paddingLeft = scheda.dimensioni?.pagina?.dimensioni?.padding?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
|
||||
const paddingRight = scheda.dimensioni?.pagina?.dimensioni?.padding?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
|
||||
|
||||
// Esiste un immagine di sfondo specifica della singola pagina ?
|
||||
let fileimg = scheda.dimensioni?.pagina?.imgsfondo?.imagefile
|
||||
let backgroundSize = scheda.dimensioni?.pagina?.imgsfondo?.fit
|
||||
let fileimg = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.imagefile
|
||||
let backgroundSize = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.fit
|
||||
if (fileimg) {
|
||||
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_SCHEDA + fileimg})` : ''
|
||||
}
|
||||
@@ -799,8 +849,56 @@ export default defineComponent({
|
||||
|
||||
let backgroundImage = fileimg ?? ''
|
||||
|
||||
let width = scheda.dimensioni?.pagina?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
|
||||
let height = scheda.dimensioni?.pagina?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
let width = scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
|
||||
let height = scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
|
||||
return {
|
||||
marginBottom,
|
||||
marginTop,
|
||||
marginLeft,
|
||||
marginRight,
|
||||
paddingBottom,
|
||||
paddingTop,
|
||||
paddingLeft,
|
||||
paddingRight,
|
||||
backgroundImage,
|
||||
backgroundSize,
|
||||
'--width': width,
|
||||
'--height': height,
|
||||
...(width ? { width: `${width} !important;` } : {}),
|
||||
...(height ? { height: `${height} !important;` } : {}) // Aggiungi l'altezza solo se è valorizzata
|
||||
};
|
||||
}
|
||||
|
||||
function generateStyleByPageDim(optcatalogo: ICatalogo, mypage: IDimensioni) {
|
||||
const marginTop = mypage!.margini?.top ? tools.adjustSize(props.optcatalogo, mypage!.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
|
||||
const marginBottom = mypage!.margini?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
|
||||
const marginLeft = mypage!.margini?.left ? tools.adjustSize(props.optcatalogo, mypage!.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
|
||||
const marginRight = mypage!.margini?.right ? tools.adjustSize(props.optcatalogo, mypage!.margini?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
|
||||
|
||||
const paddingTop = mypage!.padding?.top ? tools.adjustSize(props.optcatalogo, mypage!.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
|
||||
const paddingBottom = mypage!.padding?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
|
||||
const paddingLeft = mypage!.padding?.left ? tools.adjustSize(props.optcatalogo, mypage!.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
|
||||
const paddingRight = mypage!.padding?.right ? tools.adjustSize(props.optcatalogo, mypage!.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
|
||||
|
||||
// Esiste un immagine di sfondo specifica della singola pagina ?
|
||||
let fileimg = mypage!.imgsfondo?.imagefile
|
||||
let backgroundSize = mypage!.imgsfondo?.fit
|
||||
if (fileimg) {
|
||||
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + fileimg})` : ''
|
||||
}
|
||||
|
||||
if (!fileimg) {
|
||||
// Esiste un immagine di sfondo uguali per tutte le pagine ?
|
||||
fileimg = optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
|
||||
backgroundSize = optcatalogo.dimensioni_def?.pagina.imgsfondo?.fit
|
||||
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + fileimg})` : ''
|
||||
}
|
||||
|
||||
let backgroundImage = fileimg ?? ''
|
||||
|
||||
let width = mypage!.size?.width ? tools.adjustSize(optcatalogo, mypage!.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
|
||||
let height = mypage!.size?.height ? tools.adjustSize(optcatalogo, mypage!.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
|
||||
return {
|
||||
marginBottom,
|
||||
@@ -821,10 +919,10 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function getWidthPagina(optcatalogo: ICatalogo, scheda: IMyScheda) {
|
||||
return scheda.dimensioni?.pagina?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
|
||||
return scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
|
||||
}
|
||||
function getHeightPagina(optcatalogo: ICatalogo, scheda: IMyScheda) {
|
||||
return scheda.dimensioni?.pagina?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
return scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
}
|
||||
|
||||
function getStyleRowSeparator(recscheda: ISchedaSingola) {
|
||||
@@ -938,6 +1036,7 @@ export default defineComponent({
|
||||
getWidthPagina,
|
||||
getHeightPagina,
|
||||
getStyleRowSeparator,
|
||||
generateStyleByPageDim,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -48,9 +48,7 @@
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabvisu" animated class="">
|
||||
<q-tab-panel name="categorie">
|
||||
<div
|
||||
class="row justify-center q-mx-auto bg-blue-1"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div v-for="(reccat, index) in getCatProds()" :key="index">
|
||||
<span
|
||||
:class="{
|
||||
@@ -168,7 +166,7 @@
|
||||
<q-select
|
||||
v-model="filter.sort"
|
||||
dense
|
||||
:options="costanti.ORDINAMENTO_CATALOGHI"
|
||||
:options="shared_consts.ORDINAMENTO_CATALOGHI"
|
||||
label="Ordinamento"
|
||||
placeholder=""
|
||||
emit-value
|
||||
@@ -209,32 +207,16 @@
|
||||
<div
|
||||
v-if="
|
||||
optcatalogo.first_page &&
|
||||
optcatalogo.first_page.text_html &&
|
||||
optcatalogo.first_page.text_html.contenuto
|
||||
"
|
||||
:style="{
|
||||
backgroundImage: `url(${
|
||||
costanti.DIR_UPLOAD +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.first_page.imgsfondo.imagefile
|
||||
})`,
|
||||
backgroundSize: `${optcatalogo.first_page.imgsfondo.fit}`,
|
||||
backgroundRepeat: 'no-repeat',
|
||||
height:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
optcatalogo.first_page.size.height
|
||||
) + 'px',
|
||||
width:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
optcatalogo.first_page.size.width
|
||||
) + 'px',
|
||||
}"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.first_page)
|
||||
"
|
||||
>
|
||||
<div
|
||||
v-html="optcatalogo.first_page.text_html.contenuto"
|
||||
></div>
|
||||
\
|
||||
</div>
|
||||
<div :style="generateStyleCatalogo(optcatalogo)">
|
||||
<div class="flex-container-book">
|
||||
@@ -250,10 +232,7 @@
|
||||
class="row items-start"
|
||||
style="place-content: center"
|
||||
>
|
||||
<div
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
>
|
||||
<div v-for="(product, index) in arrLoaded" :key="index">
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
@@ -263,6 +242,7 @@
|
||||
))
|
||||
"
|
||||
:id="product._id"
|
||||
:product="product"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:optcatalogo="optcatalogo"
|
||||
@@ -278,6 +258,7 @@
|
||||
<CProductCard
|
||||
v-else-if="product.active || show_hide"
|
||||
:id="product._id"
|
||||
:product="product"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
@@ -319,6 +300,30 @@
|
||||
)
|
||||
"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.contenuto
|
||||
"
|
||||
:style="{
|
||||
'--scalecatalog':
|
||||
optcatalogo.areadistampa.scale,
|
||||
'line-height':
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.font.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
v-html="
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.contenuto
|
||||
"
|
||||
style="display: flex; flex-direction: row"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<!-- Itera sulle righe di ogni pagina -->
|
||||
<div
|
||||
v-for="(row, rowIndex) in page"
|
||||
@@ -333,34 +338,15 @@
|
||||
|
||||
<div class="row justify-center">
|
||||
<div
|
||||
v-for="(indprod, colIndex) in row"
|
||||
v-for="(prod, colIndex) in row"
|
||||
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
|
||||
class="flex-item-book"
|
||||
:style="getStyleSchedaProdotto(recscheda)"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
) &&
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
).active
|
||||
"
|
||||
:id="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
)._id
|
||||
"
|
||||
v-if="prod && prod.active"
|
||||
:id="prod._id"
|
||||
:product="prod"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:optcatalogo="optcatalogo"
|
||||
@@ -376,28 +362,9 @@
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
) &&
|
||||
(getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
).active ||
|
||||
show_hide)
|
||||
"
|
||||
:id="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
)._id
|
||||
prod && (prod.active || show_hide)
|
||||
"
|
||||
:id="prod._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
@@ -407,12 +374,17 @@
|
||||
|
||||
<!-- Separatore -->
|
||||
<div
|
||||
v-if="recscheda.scheda?.show_separatore && rowIndex !== page.length - 1"
|
||||
v-if="
|
||||
recscheda.scheda?.show_separatore &&
|
||||
rowIndex !== page.length - 1
|
||||
"
|
||||
class="text-center"
|
||||
:style="getStyleRow(recscheda)"
|
||||
>
|
||||
|
||||
<q-separator inset :size="tools.adjustSize(optcatalogo, '1px')"></q-separator>
|
||||
<q-separator
|
||||
inset
|
||||
:size="tools.adjustSize(optcatalogo, '1px')"
|
||||
></q-separator>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card Row -->
|
||||
@@ -428,27 +400,12 @@
|
||||
<div
|
||||
v-if="
|
||||
optcatalogo.last_page &&
|
||||
optcatalogo.last_page.text_html &&
|
||||
optcatalogo.last_page.text_html.contenuto
|
||||
"
|
||||
:style="{
|
||||
backgroundImage: `url(${
|
||||
costanti.DIR_UPLOAD +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.last_page.imgsfondo.imagefile
|
||||
})`,
|
||||
backgroundSize: `${optcatalogo.last_page.imgsfondo.fit}`,
|
||||
backgroundRepeat: 'no-repeat',
|
||||
height:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
optcatalogo.last_page.size.height
|
||||
) + 'px',
|
||||
width:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
optcatalogo.last_page.size.width
|
||||
) + 'px',
|
||||
}"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.last_page)
|
||||
"
|
||||
>
|
||||
<div v-html="optcatalogo.last_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user