Catalogo, versione di libro/ebook, ecc... quantità

This commit is contained in:
Surya Paolo
2024-05-05 13:55:49 +02:00
parent 399599d450
commit 17deeb7028
7 changed files with 200 additions and 95 deletions

View File

@@ -11,18 +11,18 @@
}
.prod_price {
font-size: 1.25rem;
font-size: 1.1rem;
@media (max-width: 718px) {
font-size: 1.15rem;
font-size: 1rem;
}
}
.prod_sale_price {
font-size: 1.25rem;
font-size: 1.10rem;
@media (max-width: 718px) {
font-size: 1.15rem;
font-size: 1.05rem;
}
}
@@ -161,7 +161,7 @@
}
.book-card {
max-width: 300px;
width: 300px;
background-color: #f8f8f8;
}
@@ -173,6 +173,10 @@
flex: 1;
}
.book-block {
display: flex;
}
.book-image q-img {
max-width: 100%;
}
@@ -183,26 +187,40 @@
}
.book-title {
margin: 8px;
font-family: 'Poppins,sans-serif';
font-size: 1rem;
font-size: 1.15rem;
line-height: 20px;
font-weight: 400;
font-weight: bold;
color: #333;
display: block;
display: flex;
text-align: center;
}
.book-author {
color: #263238;
display: block;
display: flex;
font-family: Poppins, sans-serif;
font-size: 0.85em;
font-size: 1em;
font-weight: 400;
line-height: 18px;
text-align: center;
font-style: italic;
}
.book-description {
font-size: 0.85rem;
color: #777;
}
.block-variazione{
border: 1px solid gray;
border-radius: 5px;
padding: 2px;
margin: 2px;
cursor: pointer;
}
.block-variazione-selected{
border: 1px solid red !important;
}

View File

@@ -11,7 +11,7 @@ import { CMyValueDb } from '../CMyValueDb'
import { func_tools, toolsext } from '@store/Modules/toolsext'
import { IBaseOrder, IGasordine, IOrder, IOrderCart, IProduct } from '@src/model'
import { IBaseOrder, IGasordine, IOrder, IOrderCart, IProduct, IVariazione } from '@src/model'
import { tools } from '@store/Modules/tools'
import { useProducts } from '@store/Products'
@@ -61,6 +61,8 @@ export default defineComponent({
const sumval = ref(0)
const editOn = ref(false)
const indvariazSel = ref(-1)
const site = ref(globalStore.site)
const $router = useRouter()
@@ -423,6 +425,10 @@ export default defineComponent({
$router.push(path)
}
function setvariazioneSelected(indvariaz: number) {
indvariazSel.value = indvariaz
}
onMounted(mounted)
onBeforeUnmount(beforeDestroy)
@@ -473,6 +479,8 @@ export default defineComponent({
isOrdineChiuso,
ricarica,
apriSchedaPDF,
setvariazioneSelected,
indvariazSel,
}
}
})

View File

@@ -25,25 +25,123 @@
<q-card-title class="book-title"
>{{ myproduct.productInfo.name }}
</q-card-title>
<q-card-subtitle v-if="myproduct.productInfo.authors" class="book-author">
<span v-for="author in myproduct.productInfo.authors" :key="author._id">
{{ author.name }} {{ author.surname }}
</span>
</q-card-subtitle>
<q-card-main class="book-description">{{
tools.firstchars(myproduct.productInfo.description, 300)
}}</q-card-main>
<div class="flex justify-between items-center">
<q-badge
v-if="myproduct.versione > 0"
:color="
shared_consts.VERSIONI_PRODOTTO[myproduct.versione].color
"
>{{
shared_consts.VERSIONI_PRODOTTO[myproduct.versione].label
}}</q-badge
<q-card-subtitle
v-if="myproduct.productInfo.authors"
class="book-author"
>
<span
v-for="author in myproduct.productInfo.authors"
:key="author._id"
>
<div class="text-weight-bold">{{ myproduct.price }} </div>
{{ author.name }} {{ author.surname }}
</span>
</q-card-subtitle>
<q-card-main class="book-description">{{
myproduct.productInfo.short_descr
}}</q-card-main>
<div
:class="
`row items-center q-mt-sm q-pa-nome block-variazione ` +
(indvariazSel == index ? 'block-variazione-selected' : '')
"
v-for="(variazione, index) of myproduct.arrvariazioni"
:key="index"
@click="setvariazioneSelected(index)"
>
<div class="flex justify-between items-center q-mx-sm">
<q-badge
v-if="variazione.versione > 0"
:color="
shared_consts.VERSIONI_PRODOTTO[variazione.versione].color
"
>{{
shared_consts.VERSIONI_PRODOTTO[variazione.versione].label
}}</q-badge
>
<div v-if="variazione.formato && false">
formato: {{ variazione.formato }}
</div>
<div v-if="variazione.tipologia && false">
tipologia: {{ variazione.tipologia }}
</div>
<div v-if="variazione.edizione && false">
edizione: {{ variazione.edizione }}
</div>
<div v-if="variazione.status && false">
status: {{ variazione.status }}
</div>
<div v-if="variazione.preOrderDate">
preOrderDate: {{ variazione.preOrderDate }}
</div>
</div>
<q-item-section>
<q-item-label>
<span class="prod_sale_price" v-if="!!variazione.sale_price"
>{{
variazione.sale_price
? variazione.sale_price.toFixed(2)
: 0
}}
</span
>
<span
:class="
variazione.sale_price ? 'prod_off_price' : 'prod_price'
"
v-if="!!variazione.price"
>{{ variazione.price ? variazione.price.toFixed(2) : 0 }}
</span>
<span v-if="!!myproduct.after_price">{{
myproduct.after_price
}}</span>
</q-item-label>
<q-item-label
v-if="
myproduct.scontisticas && myproduct.scontisticas.length > 0
"
>
<div
class="prod_sconti"
v-for="(sconti, index) of myproduct.scontisticas"
:key="index"
>
{{ sconti.description }}
</div>
</q-item-label>
</q-item-section>
<q-item-section side v-if="!!variazione.quantita">
<q-icon v-if="variazione.quantita > 10" color="green" name="fas fa-check" />
<q-icon v-else-if="variazione.quantita > 1 && variazione.quantita <= 10" color="orange" name="fas fa-check" />
<q-icon v-else-if="variazione.quantita > 0 && variazione.quantita <= 2" color="red" name="fas fa-check" />
<q-icon v-else-if="variazione.quantita === 0" color="gray" name="fas fa-times" />
</q-item-section>
</div>
<div v-if="indvariazSel >= 0"
class="row justify-center q-mt-sm">
<q-btn
v-if="
myproduct.arrvariazioni[indvariazSel].addtocart_link && true
"
:href="myproduct.arrvariazioni[indvariazSel].addtocart_link"
target="_blank"
color="primary"
icon="fas fa-cart-plus"
no-caps
:label="$t('products.addtocart_ext')"
></q-btn>
<q-btn
v-if="myproduct.productInfo.checkout_link && true"
:href="myproduct.productInfo.checkout_link"
target="_blank"
color="white"
icon="fas fa-shopping-cart"
outline
text-color="black"
no-caps
:label="$t('ecomm.carrello')"
></q-btn>
</div>
</div>
</div>
@@ -79,7 +177,7 @@
myproduct.productInfo.author
}}</q-card-subtitle>
<q-card-main class="book-description">
<p>{{ myproduct.productInfo.description }}</p>
<p>{{ myproduct.productInfo.short_descr }}</p>
<p>ISBN: {{ myproduct.productInfo.code }}</p>
<p>Pages: {{ myproduct.productInfo.numpages }}</p>
<p>Published Date: {{ myproduct.productInfo.date_publishing }}</p>
@@ -149,37 +247,6 @@
class="icone_prod"
/>
</q-item-section>
<q-item-section>
<q-item-label>
<span class="prod_sale_price" v-if="!!myproduct.sale_price">{{
myproduct.sale_price ? myproduct.sale_price.toFixed(2) : 0
}}</span>
<span
:class="
myproduct.sale_price ? 'prod_off_price' : 'prod_price'
"
v-if="!!myproduct.price"
>{{ myproduct.price ? myproduct.price.toFixed(2) : 0 }}</span
>
<span v-if="!!myproduct.after_price">{{
myproduct.after_price
}}</span>
</q-item-label>
<q-item-label
v-if="
myproduct.scontisticas && myproduct.scontisticas.length > 0
"
>
<div
class="prod_sconti"
v-for="(sconti, index) of myproduct.scontisticas"
:key="index"
>
{{ sconti.description }}
</div>
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section avatar v-if="myproduct.productInfo.weight">

View File

@@ -28,8 +28,9 @@ export interface IProductInfo {
img4?: string
image_link?: string
ingredienti?: string
link?: string
link_scheda?: string
valori_nutrizionali?: string
checkout_link?: string
authors?: string[]
collezione?: string
publisher?: string
@@ -38,6 +39,23 @@ export interface IProductInfo {
productType?: number
}
export interface IVariazione {
active?: boolean
versione?: number
status?: string,
price?: number
sale_price?: number
quantita?: number
availability?: number
numpages?: number
formato?: string
tipologia?: string
edizione?: string
preOrderDate?: Date
addtocart_link?: string
eta?: string
}
export interface IProduct {
_id?: any
active?: boolean
@@ -55,17 +73,15 @@ export interface IProduct {
gasordine: IGasordine | null,
provider?: IProvider,
price: number,
sale_price?: number,
after_price?: string,
quantityAvailable?: number,
bookableAvailableQty?: number,
QuantitaOrdinateInAttesa?: number,
QuantitaPrenotateInAttesa?: number,
note?: string
versione?: number
arrvariazioni?: IVariazione[]
stockQty: number, // UPDATING
status?: string,
stockBloccatiQty: number, // UPDATING
bookedQtyOrdered: number // UPDATING
bookedQtyConfirmed: number // UPDATING
@@ -127,14 +143,15 @@ export interface IProductsState {
export interface IProducer {
_id?: any
idapp?: string
name?: string,
description?: string,
referent?: string,
username?: string,
region?: string,
city?: string,
img?: string,
website?: string,
name?: string
description?: string
short_descr?: string
referent?: string
username?: string
region?: string
city?: string
img?: string
website?: string
}
export interface IDepartment {

View File

@@ -94,6 +94,7 @@ const msg_it = {
select_gasordine: 'Scegli l\'Ordine del GAS',
productInfo: 'Info Prodotto',
link_scheda: 'Link Scheda',
addtocart_ext: 'Aggiungi',
},
storehouses: {
name: 'Magazzino',

View File

@@ -2135,7 +2135,19 @@ export const colTableProducts = [
jointable: 'scontisticas',
}),
AddCol({ name: 'price', label_trans: 'products.price', fieldtype: costanti.FieldType.number, required: true }),
AddCol({ name: 'sale_price', label_trans: 'products.sale_price', fieldtype: costanti.FieldType.number, required: false }),
// arrvariazioni
/* AddCol({ name: 'sale_price', label_trans: 'products.sale_price', fieldtype: costanti.FieldType.number, required: false }),
AddCol({
name: 'versione',
label_trans: 'products.versione',
fieldtype: costanti.FieldType.select,
jointable: 'versions',
}),
AddCol({ name: 'status', label_trans: 'products.status', fieldtype: costanti.FieldType.string }),
*/
AddCol({ name: 'price_acquistato', label_trans: 'products.price_acquistato', fieldtype: costanti.FieldType.number, required: true }),
AddCol({ name: 'after_price', label_trans: 'products.after_price' }),
AddCol({
@@ -2184,12 +2196,6 @@ export const colTableProducts = [
label_trans: 'ecomm.note',
fieldtype: costanti.FieldType.html
}),
AddCol({
name: 'versione',
label_trans: 'products.versione',
fieldtype: costanti.FieldType.select,
jointable: 'versions',
}),
AddCol({
name: 'maxbookableGASQty',
label_trans: 'ecomm.maxbookableGASQty',
@@ -2208,7 +2214,6 @@ export const colTableProducts = [
AddCol({ name: 'canBeShipped', label_trans: 'products.canBeShipped', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'canBeBuyOnline', label_trans: 'products.canBeBuyOnline', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'status', label_trans: 'products.status', fieldtype: costanti.FieldType.string }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]

View File

@@ -6,7 +6,7 @@
<div v-if="loadpage" class="panel">
<div v-if="true">
<!--<CSelectUserActive></CSelectUserActive>-->
<div class="text-center text-h7 text-blue">Filtra Prodotti per:</div>
<!-- <div class="text-center text-h7 text-blue">Filtra Prodotti per:</div>
<div class="text-center">
<q-btn-toggle
v-model="cosa"
@@ -33,12 +33,6 @@
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('gas.ordina_sul_gas') }}
<!--<br />
{{
t('gas.x_prodotti_gas', {
qta: productStore.getNumQtaGas(),
})
}}-->
</div>
<q-icon right name="fas fa-user-friends" />
</div>
@@ -48,18 +42,12 @@
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('gas.bottega') }}
<!--<br />
{{
t('gas.x_prodotti_bottega', {
qta: productStore.getNumQtaBottega(),
})
}}-->
</div>
<q-icon right name="fas fa-store" />
</div>
</template>
</q-btn-toggle>
</div>
</div> -->
</div>
<div class="container">
@@ -259,6 +247,7 @@
:offset="2000"
debounce="200"
class="q-pa-xs row items-start"
style="place-content: center"
>
<div
class="q-pa-xs"