From 58f53f8c52addf9607a6bb98ecf1b301d5416ebf Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Wed, 8 May 2024 16:07:42 +0200 Subject: [PATCH] - caaloghi, categorie --- _ALL_SITES/gruppomacro.app/package.json | 6 +- now.txt | 2 +- src/common/shared_vuejs.ts | 2 +- .../CCatalogoCard/CCatalogoCard.scss | 126 +++-- src/components/CCatalogoCard/CCatalogoCard.ts | 114 +++-- .../CCatalogoCard/CCatalogoCard.vue | 473 +++++++++--------- src/components/CPrice/CPrice.scss | 103 ++++ src/components/CPrice/CPrice.ts | 37 ++ src/components/CPrice/CPrice.vue | 25 + src/components/CPrice/index.ts | 1 + src/components/CProductCard/CProductCard.ts | 24 +- src/components/CProductCard/CProductCard.vue | 3 +- src/model/Products.ts | 11 +- src/statics/lang/it.js | 4 +- src/store/Modules/tools.ts | 35 +- src/store/Products.ts | 21 +- src/views/ecommerce/catalogo/catalogo.scss | 39 +- src/views/ecommerce/catalogo/catalogo.ts | 10 +- src/views/ecommerce/catalogo/catalogo.vue | 69 +-- .../ecommerce/catalogoInfo/catalogoInfo.vue | 14 +- 20 files changed, 704 insertions(+), 415 deletions(-) create mode 100755 src/components/CPrice/CPrice.scss create mode 100755 src/components/CPrice/CPrice.ts create mode 100755 src/components/CPrice/CPrice.vue create mode 100755 src/components/CPrice/index.ts diff --git a/_ALL_SITES/gruppomacro.app/package.json b/_ALL_SITES/gruppomacro.app/package.json index bcb1a608..5ad8f06e 100755 --- a/_ALL_SITES/gruppomacro.app/package.json +++ b/_ALL_SITES/gruppomacro.app/package.json @@ -1,8 +1,8 @@ { - "name": "riso", + "name": "gruppomacro", "version": "0.6.1", - "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", - "productName": "Riso", + "description": "Gruppo Macro Editori", + "productName": "Gruppo Macro", "author": "Paolo Arena", "private": true, "keywords": [], diff --git a/now.txt b/now.txt index 63f31c52..e5f5d4ff 100644 --- a/now.txt +++ b/now.txt @@ -1 +1 @@ -TERMINA DI LAVORARE SU gruppomacro.app: (Sovrascrivo !) +TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !) diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 04ed54a2..fd9f1ba0 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -2124,7 +2124,7 @@ export const shared_consts = { { label: 'Usato', value: 2, - color: 'warning', + color: 'orange-9', }, { label: 'Download', diff --git a/src/components/CCatalogoCard/CCatalogoCard.scss b/src/components/CCatalogoCard/CCatalogoCard.scss index baab8c1b..478e73df 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.scss +++ b/src/components/CCatalogoCard/CCatalogoCard.scss @@ -10,35 +10,6 @@ place-content: center; } -.prod_price { - font-size: 1.1rem; - font-style: bold; - - @media (max-width: 718px) { - font-size: 1rem; - } -} - -.prod_sale_price { - font-size: 1.10rem; - font-style: bold; - - @media (max-width: 718px) { - font-size: 1.05rem; - } -} - -.prod_off_price { - font-size: 1rem; - - @media (max-width: 718px) { - font-size: 0.85rem; - } - - color: gray; - text-decoration: line-through; - padding-left: 5px; -} .prod_disp { font-size: 1.2rem; @@ -136,18 +107,6 @@ height: 70px; } -.image-container { - width: 300px; - height: 300px; - position: relative; - overflow: hidden; - - @media (max-width: 718px) { - width: 200px; - height: 200px; - } -} - .book-image-fixed{ max-width: 300px; max-height: 600px; @@ -168,12 +127,6 @@ } .book-card { - width: 300px; - background-color: #f8f8f8; -} - -.book-card { - width: 300px; background-color: #f8f8f8; } @@ -198,19 +151,32 @@ padding: 20px; } + .book-title { margin: 8px; font-family: 'Poppins,sans-serif'; - font-size: 1.15rem; - line-height: 20px; font-weight: bold; color: #333; display: block; text-align: center; + text-shadow: 1px 1px 1px #555; +} + +.book-title[data-col=c1] { + font-size: 1.15rem; + line-height: 20px; +} + +.book-title[data-col=c2] { + font-size: 1rem; + line-height: 19px; } .book-author { - font-size: 1.1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + color: grey; /* Colore scuro per garantire una buona leggibilità */ +} + +.author{ color: darkblue; /* Colore scuro per garantire una buona leggibilità */ text-transform: capitalize; /* Capitalizzazione delle iniziali per ogni parola del nome */ background-color: #f9f9f9; /* Sfondo leggermente diverso per evidenziare il nome */ @@ -219,6 +185,30 @@ font-style: italic; /* Stile del testo in corsivo per evidenziare l'autore */ } +.author[data-col=c1]{ + font-size: 1.1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ +} +.author[data-col=c2]{ + font-size: 1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ +} + +.book-category { + font-size: 1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + color: grey; /* Colore scuro per garantire una buona leggibilità */ +} + +.category{ + font-size: 1.0em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + color: green; /* Colore scuro per garantire una buona leggibilità */ + text-transform: capitalize; /* Capitalizzazione delle iniziali per ogni parola del nome */ + background-color: #f9f9f9; /* Sfondo leggermente diverso per evidenziare il nome */ + border-radius: 2px; /* Bordi arrotondati per un aspetto più soft-edged */ + display: inline-block; /* Tratta il blocco come elementi inline-block per adattarlo al contenuto */ + font-style: italic; /* Stile del testo in corsivo per evidenziare l'autore */ + box-shadow: 0 0 5px gray; + +} + .book-description { font-size: 0.85rem; color: #777; @@ -226,12 +216,23 @@ .block-variazione { border: 1px solid gray; + margin: auto; // effetto 3d box-shadow: 0 0 5px gray; border-radius: 5px; - padding: 2px; - margin: 2px; + padding: 4px; cursor: pointer; + .q-badge { + font-size: 1rem; + padding: 4px 6px; + } +} + +.colfix_prodotti_1 { + width: 350px; +} +.colfix_prodotti_2 { + width: 175px; } .block-variazione-selected { @@ -279,4 +280,23 @@ @media (max-width: 718px) { margin-left: 5px; } -} \ No newline at end of file +} + + +.book-3d:hover img { + transform: translateZ(50px) rotateY(-20deg); /* Applica la trasformazione 3D quando si passa con il mouse sopra */ +} + +// Contenitore del libro, con effetto 3d, ed animazione 3D +.book-3d { + perspective: 1000px; + transform-style: preserve-3d; + transition: transform 0.5s ease-in-out; + transform-origin: center center; + + + img { + transform-origin: center center; + transition: transform 0.5s ease-in-out; + } +} diff --git a/src/components/CCatalogoCard/CCatalogoCard.ts b/src/components/CCatalogoCard/CCatalogoCard.ts index 820c9c83..035b27c6 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.ts +++ b/src/components/CCatalogoCard/CCatalogoCard.ts @@ -8,6 +8,7 @@ import { CTitleBanner } from '../CTitleBanner' import { CCardState } from '../CCardState' import { CCopyBtn } from '../CCopyBtn' import { CMyValueDb } from '../CMyValueDb' +import { CPrice } from '../CPrice' import { func_tools, toolsext } from '@store/Modules/toolsext' @@ -48,8 +49,13 @@ export default defineComponent({ required: false, default: false, }, + options: { + type: Object, + required: false, + default: () => { } + } }, - components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp }, + components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice }, setup(props, { emit }) { const $q = useQuasar() const { t } = useI18n() @@ -91,7 +97,7 @@ export default defineComponent({ const openlistorders = ref(false) const endload = ref(false) - const myproduct = ref({}) + const myproduct = ref({}) const isFullScreen = ref(false) const imageSrc = ref('URL_DEL_TUO_FILE_IMMAGINE') @@ -129,10 +135,12 @@ export default defineComponent({ return false } - const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add }) - updateproduct() - if (ris && ris.myord) { + if (myproduct.value) { + const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add }) + updateproduct() + if (ris && ris.myord) { + } } } @@ -148,6 +156,9 @@ export default defineComponent({ function getSingleStorehouse() { try { + if (!myproduct.value) + return '' + const mystore = myproduct.value.storehouses[0] if (mystore) return mystore.name + ' (' + mystore.city + ')' @@ -183,28 +194,30 @@ export default defineComponent({ } - function updateproduct() { + async function updateproduct() { - myproduct.value = products.getProductById(props.id) + myproduct.value = null; + myproduct.value = await products.getProductById(props.id) // products.updateQuantityAvailable(myproduct.value._id) } async function ricarica() { endload.value = false - const prod = await products.loadProductById(myproduct.value._id) - if (prod) { - myproduct.value = prod + if (myproduct.value) { + const prod = await products.loadProductById(myproduct.value._id) + if (prod) { + myproduct.value = prod + } } - load() - endload.value = true + await load() } - function updateproductmodif() { + async function updateproductmodif() { try { - myproduct.value = products.getProductById(props.id) + myproduct.value = await products.getProductById(props.id) updateLabel() } catch (e) { @@ -256,9 +269,9 @@ export default defineComponent({ return '' } - watch(() => props.id, (newval, oldval) => { + watch(() => props.id, async (newval, oldval) => { // console.log('change code') - load() + await load() }) watch(() => storeSelected.value, (newval, oldval) => { @@ -289,12 +302,8 @@ export default defineComponent({ updateTimerLabel() } - function mounted() { - load() - - if (props.complete && myproduct.value && myproduct.value.arrvariazioni) { - indvariazSel.value = 0 - } + async function mounted() { + await load() // Start the timer when the component is mounted startTimer(); @@ -306,15 +315,18 @@ export default defineComponent({ } function updateTimerLabel() { - if (myproduct.value && myproduct.value.gasordine && myproduct.value.gasordine._id && myproduct.value.gasordine.dataora_chiusura_ordini) + if (myproduct.value && (myproduct.value.gasordine && myproduct.value.gasordine._id && myproduct.value.gasordine.dataora_chiusura_ordini)) timerLabelScadenza.value = tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) else timerLabelScadenza.value = '' } function isOrdineChiuso() { - return myproduct.value.gasordine && myproduct.value.gasordine.dataora_chiusura_ordini && - tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) === '' + if (myproduct.value) { + return myproduct.value.gasordine && myproduct.value.gasordine.dataora_chiusura_ordini && + tools.getCountDown(myproduct.value.gasordine.dataora_chiusura_ordini) === '' + } else + return false } function startTimer() { @@ -322,17 +334,18 @@ export default defineComponent({ timerInterval.value = setInterval(() => updateTimerLabel(), 60000); } - function load() { + async function load() { + indvariazSel.value = -1 initproduct() - updateproduct() + await updateproduct() labelDataArrivoMerce.value = '' labelDataRitiro.value = '' // console.log('Load', myproduct.value.name) - arrordersCart.value = products.getOrdersCartInAttesaByIdProduct(myproduct.value._id) - if (!!myproduct.value) { + arrordersCart.value = products.getOrdersCartInAttesaByIdProduct(myproduct.value._id) + if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) { // Se solo 1 presente, metto fisso l'unico negozio ! myorder.idStorehouse = myproduct.value.storehouses[0]._id @@ -356,6 +369,13 @@ export default defineComponent({ updateLabel() + // console.log('myproduct', myproduct.value, 'arrvariaz', myproduct.value.arrvariazioni, 'compl', props.complete) + if (props.complete && myproduct.value && myproduct.value.arrvariazioni) { + // console.log('ENTRATO') + indvariazSel.value = 0 + } + + // console.log('°°° ENDLOAD °°°') endload.value = true } @@ -366,25 +386,35 @@ export default defineComponent({ function visuListDisponibili() { - openlistorders.value = true - sumval.value = products.getSumQtyOrderProductInOrdersCart(myproduct.value._id) + if (myproduct.value) { + openlistorders.value = true + sumval.value = products.getSumQtyOrderProductInOrdersCart(myproduct.value._id) - listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { - return accumulator + item.order.quantity - }, 0)) + listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { + return accumulator + item.order.quantity + }, 0)) + } else + return false } function visuListBookable() { - openlistorders.value = true - sumval.value = products.getSumQtyPreOrderInOrdersCart(myproduct.value._id) + if (myproduct.value) { + openlistorders.value = true + sumval.value = products.getSumQtyPreOrderInOrdersCart(myproduct.value._id) - listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { - return accumulator + item.order.quantitypreordered - }, 0)) + listord.value = arrordersCart.value.filter((orderscart: IOrderCart) => orderscart.items!.reduce((accumulator, item) => { + return accumulator + item.order.quantitypreordered + }, 0)) + } else { + return '' + } } function isOrdGas(): boolean { - return (myproduct.value && !!myproduct.value.idGasordine && myproduct.value.gasordine! && myproduct.value.gasordine.active) + if (myproduct.value) + return (myproduct.value && !!myproduct.value.idGasordine && myproduct.value.gasordine! && myproduct.value.gasordine.active) + else + return false } function getpercqtaraggiunta(): number { @@ -436,8 +466,10 @@ export default defineComponent({ function setvariazioneSelected(indvariaz: number) { if (indvariazSel.value === indvariaz) indvariazSel.value = -1 - else + else { + indvariazSel.value = -1 indvariazSel.value = indvariaz + } } onMounted(mounted) diff --git a/src/components/CCatalogoCard/CCatalogoCard.vue b/src/components/CCatalogoCard/CCatalogoCard.vue index e345cf81..c0a19aac 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.vue +++ b/src/components/CCatalogoCard/CCatalogoCard.vue @@ -1,11 +1,17 @@