- Aggiornamento template mail (tramite i campi in HTML)
- Aggiornato Carrello
This commit is contained in:
@@ -55,6 +55,10 @@ export default defineComponent({
|
||||
products.loadOrders()
|
||||
}
|
||||
|
||||
function existsOrders() {
|
||||
return products.getNumOrders() > 0
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -64,6 +68,8 @@ export default defineComponent({
|
||||
numOrders,
|
||||
closecart,
|
||||
getnumItemsCart,
|
||||
existsOrders,
|
||||
globalStore,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -4,23 +4,27 @@
|
||||
<div class="myheader row justify-between">
|
||||
<div class="col-6">
|
||||
<q-btn class="q-mx-xs" round dense flat icon="fas fa-shopping-cart">
|
||||
<q-badge v-if="getnumItemsCart() > 0" color="red" floating transparent>
|
||||
<q-badge
|
||||
v-if="getnumItemsCart() > 0"
|
||||
color="red"
|
||||
floating
|
||||
transparent
|
||||
>
|
||||
{{ getnumItemsCart() }}
|
||||
</q-badge>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right">
|
||||
<span v-if="myTotalPrice" class="text-grey q-mr-xs">Totale:</span> <span class="text-subtitle1 q-mr-sm ">€ {{
|
||||
myTotalPrice ? myTotalPrice.toFixed(2) : 0 }}</span>
|
||||
<span v-if="myTotalPrice" class="text-grey q-mr-xs">Totale:</span>
|
||||
<span class="text-subtitle1 q-mr-sm"
|
||||
>€ {{ myTotalPrice ? myTotalPrice.toFixed(2) : 0 }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
<div id="mybody">
|
||||
<div v-for="(rec, index) in ordersCart" :key="index" class="col">
|
||||
|
||||
<CSingleCart :order="rec.order" :showall="false">
|
||||
</CSingleCart>
|
||||
|
||||
<CSingleCart :order="rec.order" :showall="false"> </CSingleCart>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="numOrders === 0" style="text-align: center" class="text-grey">
|
||||
@@ -28,12 +32,31 @@
|
||||
</div>
|
||||
<div v-else style="text-align: center">
|
||||
<div class="text-center">
|
||||
<q-btn rounded icon="fas fa-shopping-cart" color="primary" :label="$t('ecomm.btn_cassa')"
|
||||
class="q-mb-sm" to="/checkout">
|
||||
<q-btn
|
||||
rounded
|
||||
icon="fas fa-shopping-cart"
|
||||
color="primary"
|
||||
:label="$t('ecomm.btn_cassa')"
|
||||
@click="globalStore.rightCartOpen = false"
|
||||
class="q-mb-sm"
|
||||
to="/checkout"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<q-btn
|
||||
v-if="existsOrders()"
|
||||
rounded
|
||||
icon="fas fa-clipboard-list"
|
||||
color="positive"
|
||||
:label="$t('ecomm.btn_ordini')"
|
||||
class="q-mb-sm"
|
||||
@click="globalStore.rightCartOpen = false"
|
||||
to="/orderinfo"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -192,16 +192,6 @@ export default defineComponent({
|
||||
return false
|
||||
}
|
||||
|
||||
function getQtyAvailable() {
|
||||
let qty = myproduct.value.quantityAvailable!
|
||||
return qty
|
||||
}
|
||||
|
||||
function getQtyBookableAvailable() {
|
||||
let qty = myproduct.value.bookableAvailableQty!
|
||||
return qty
|
||||
}
|
||||
|
||||
function getQtyWarn() {
|
||||
if (myorder.quantity > 0) {
|
||||
return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantity })
|
||||
@@ -274,55 +264,6 @@ export default defineComponent({
|
||||
return 'myimgproduct centermydiv'
|
||||
}
|
||||
|
||||
function enableSubQty() {
|
||||
let qty = myorder.quantity + myorder.quantitypreordered
|
||||
return qty ? qty > 0 : false
|
||||
}
|
||||
|
||||
function enableAddQty() {
|
||||
if (site.value.ecomm && site.value.ecomm.enablePreOrders) {
|
||||
return (getQtyBookableAvailable() > 0
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantitypreordered + 1 < myproduct.value.maxBookableQty))
|
||||
)
|
||||
|| (getQtyAvailable() > 0)
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantity + 1 < myproduct.value.maxBookableQty ))
|
||||
|
||||
} else {
|
||||
return (getQtyAvailable() > 0)
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantity + 1 < myproduct.value.maxBookableQty ))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function qtaNextAdd() {
|
||||
let step = 1
|
||||
if (getQtyAvailable() > 0) {
|
||||
if (myorder.quantity === 0)
|
||||
step = myproduct.value.minBuyQty | 1
|
||||
} else {
|
||||
if (myorder.quantitypreordered === 0)
|
||||
step = myproduct.value.minBuyQty | 1
|
||||
}
|
||||
|
||||
return step
|
||||
}
|
||||
|
||||
function qtaNextSub() {
|
||||
let step = 1
|
||||
let minqta = myproduct.value.minBuyQty | 1
|
||||
if (getQtyAvailable() > 0) {
|
||||
if (myorder.quantity === minqta)
|
||||
step = minqta
|
||||
} else {
|
||||
if (myorder.quantitypreordered === minqta)
|
||||
step = minqta
|
||||
}
|
||||
|
||||
return step
|
||||
}
|
||||
|
||||
function visuListDisponibili() {
|
||||
openlistorders.value = true
|
||||
@@ -362,9 +303,6 @@ export default defineComponent({
|
||||
t,
|
||||
storeSelected,
|
||||
gasordineSelected,
|
||||
enableSubQty,
|
||||
enableAddQty,
|
||||
getQtyAvailable,
|
||||
getQtyWarn,
|
||||
openlistorders,
|
||||
func_tools,
|
||||
@@ -375,12 +313,9 @@ export default defineComponent({
|
||||
shared_consts,
|
||||
site,
|
||||
getQtyWarnPreOrdered,
|
||||
getQtyBookableAvailable,
|
||||
listord,
|
||||
sumval,
|
||||
getGasordines,
|
||||
qtaNextAdd,
|
||||
qtaNextSub,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="q-pa-md row items-start q-gutter-md">
|
||||
<div class="row items-start q-gutter-md">
|
||||
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
|
||||
|
||||
<q-card
|
||||
@@ -163,7 +163,7 @@
|
||||
<q-item
|
||||
v-if="
|
||||
cosa === shared_consts.PROD.BOTTEGA ||
|
||||
(cosa === shared_consts.PROD.GAS && getQtyAvailable() > 0)
|
||||
(cosa === shared_consts.PROD.GAS && products.getQtyAvailable(myproduct) > 0)
|
||||
"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? visuListDisponibili() : null"
|
||||
@@ -178,7 +178,7 @@
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="prod_disp">
|
||||
{{ getQtyAvailable() }}
|
||||
{{ products.getQtyAvailable(myproduct) }}
|
||||
</span>
|
||||
<div class="prod_qtywarn">
|
||||
{{ getQtyWarn() }}
|
||||
@@ -200,7 +200,7 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="getQtyBookableAvailable() > 0 || myproduct.bookableQty > 0"
|
||||
v-if="products.getQtyBookableAvailable(myproduct) > 0 || myproduct.bookableQty > 0"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? visuListBookable() : null"
|
||||
>
|
||||
@@ -214,7 +214,7 @@
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="prod_preorder">
|
||||
{{ getQtyBookableAvailable() }}
|
||||
{{ products.getQtyBookableAvailable(myproduct) }}
|
||||
</span>
|
||||
<div class="prod_qtywarn">
|
||||
<span v-if="getQtyWarnPreOrdered()">{{
|
||||
@@ -269,11 +269,11 @@
|
||||
<div class="row q-mb-sm no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
icon="fas fa-cart-arrow-down"
|
||||
:color="enableSubQty() ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !enableSubQty()"
|
||||
:color="products.enableSubQty(myorder) ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !products.enableSubQty(myorder)"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.subcart', { qta: qtaNextSub() })"
|
||||
:label="t('products.subcart', { qta: products.qtaNextSub(myorder, myproduct) })"
|
||||
@click="addtoCart(false)"
|
||||
>
|
||||
</q-btn>
|
||||
@@ -294,10 +294,10 @@
|
||||
<q-btn
|
||||
icon-right="fas fa-cart-plus"
|
||||
color="positive"
|
||||
:disable="checkifCartDisable() || !enableAddQty()"
|
||||
:disable="checkifCartDisable() || !products.enableAddQty(myorder, myproduct)"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.addcart', { qta: qtaNextAdd() })"
|
||||
:label="t('products.addcart', { qta: products.qtaNextAdd(myorder, myproduct) })"
|
||||
@click="addtoCart(true)"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
}
|
||||
|
||||
.imgNormal{
|
||||
height: 80px;
|
||||
height: 110px !important;
|
||||
width: 80px;
|
||||
}
|
||||
.imgSmall{
|
||||
height: 50px;
|
||||
height: 60px !important;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
@@ -34,4 +34,12 @@
|
||||
.gasordine {
|
||||
font-style: italic;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.prezzo_singolo{
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.q-item__section--thumbnail img{
|
||||
height: 100px;
|
||||
}
|
||||
@@ -1,100 +1,130 @@
|
||||
<template>
|
||||
<div v-if="order && order.product" class="q-pa-xs q-gutter-xs">
|
||||
<div v-if="order.product" class="row items-center justify-evenly no-wrap">
|
||||
<div class="col-2 text-h6 ellipsis">
|
||||
<q-img
|
||||
v-if="order.product && order.product.productInfo.img"
|
||||
:src="`` + order.product.productInfo.img"
|
||||
:alt="order.product.productInfo.name"
|
||||
:class="myimgclass"
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<div class="col-4 q-ml-xs">
|
||||
<div v-if="order.idGasordine" class="gasordine">
|
||||
{{ products.getSingleGasordine(order, true) }}<br>
|
||||
</div>
|
||||
{{ order.product.productInfo.name }}
|
||||
<div v-if="order.product">
|
||||
<q-item>
|
||||
<q-item-section top thumbnail class="q-ml-none">
|
||||
<img
|
||||
v-if="order.product && order.product.productInfo.img"
|
||||
:src="`` + order.product.productInfo.img"
|
||||
:alt="order.product.productInfo.name"
|
||||
:class="myimgclass()"
|
||||
/>
|
||||
</q-item-section>
|
||||
|
||||
<!--<div v-if="showalle">
|
||||
<br /><span class="text-grey">{{ order.product.description }}</span>
|
||||
</div>
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<div v-if="order.idGasordine" class="gasordine">
|
||||
{{ products.getSingleGasordine(order, true) }}<br />
|
||||
</div>
|
||||
{{ order.product.productInfo.name }}
|
||||
</q-item-label>
|
||||
<q-item-label caption>
|
||||
<div
|
||||
class="text-black text-h8"
|
||||
v-if="order.product.productInfo.unit"
|
||||
>
|
||||
{{ tools.getWeightTotalByOrder(order) }}
|
||||
{{ tools.getUnitsMeasure(order.product.productInfo.unit, true) }}
|
||||
</div>
|
||||
<div class="row q-mb-xs no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
v-if="showall && !nomodif"
|
||||
:disable="!products.enableSubQty(order)"
|
||||
size="sm"
|
||||
icon="fas fa-cart-arrow-down"
|
||||
:color="products.enableSubQty(order) ? 'negative' : 'grey'"
|
||||
@click="addsubqty(false, true)"
|
||||
rounded
|
||||
:label="
|
||||
t('products.subcart', {
|
||||
qta: products.qtaNextSub(order, order.product),
|
||||
})
|
||||
"
|
||||
></q-btn>
|
||||
<div v-if="showall" :class="`q-mx-sm text-blue-14`">
|
||||
{{ order.quantity }}
|
||||
</div>
|
||||
<div v-if="order.quantity > 0 && order.quantitypreordered > 0">
|
||||
+ {{ t('ecomm.preord') }}:
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="order.quantitypreordered > 0"
|
||||
:class="`q-mx-sm text-blue-14`"
|
||||
>
|
||||
{{ order.quantitypreordered }}
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="showall && !nomodif"
|
||||
icon-right="fas fa-cart-plus"
|
||||
color="positive"
|
||||
:disable="!products.enableAddQty(order, order.product)"
|
||||
rounded
|
||||
size="sm"
|
||||
:label="
|
||||
t('products.addcart', {
|
||||
qta: products.qtaNextAdd(order, order.product),
|
||||
})
|
||||
"
|
||||
@click="addsubqty(true, false)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<div class="col-2 no-wrap text-subtitle3_short q-mr-sm">
|
||||
<span class="prezzo_singolo">
|
||||
{{ order.quantity + order.quantitypreordered }} x €
|
||||
{{ order.price ? order.price : 0 }}
|
||||
</span>
|
||||
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">
|
||||
= €
|
||||
{{
|
||||
order.TotalPriceProduct
|
||||
? order.TotalPriceProduct.toFixed(2)
|
||||
: 0
|
||||
}}
|
||||
</span>
|
||||
<span v-if="isApplicatoSconto()">
|
||||
<span class="ordine_scontato"
|
||||
>(<span class="barrato"
|
||||
>€
|
||||
{{
|
||||
(
|
||||
order.price * order.quantity +
|
||||
order.price * order.quantitypreordered
|
||||
).toFixed(2)
|
||||
}}</span
|
||||
>)</span
|
||||
>
|
||||
</span>
|
||||
<span v-if="isApplicatoSconto()" class="ordine_scritta_sconto">{{
|
||||
$t('ecomm.sconto_applicato', { risparmio: getRisparmio() })
|
||||
}}</span>
|
||||
</div>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side top>
|
||||
<q-item-label>
|
||||
<div class="col-1">
|
||||
<q-btn
|
||||
v-if="!nomodif"
|
||||
icon="fas fa-trash"
|
||||
color="negative"
|
||||
round
|
||||
size="xs"
|
||||
@click="removeFromCard"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<!--<q-item-section side top>
|
||||
<q-item-label caption>meta</q-item-label>
|
||||
</q-item-section>
|
||||
-->
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="row q-mb-xs no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
v-if="showall && !nomodif"
|
||||
round
|
||||
size="xs"
|
||||
text-color="grey"
|
||||
icon="fas fa-minus"
|
||||
@click="addsubqty(false, true)"
|
||||
></q-btn>
|
||||
<div v-if="order.quantity > 0" :class="`q-mx-sm text-blue-14`">
|
||||
{{ order.quantity }}
|
||||
</div>
|
||||
<div v-if="order.quantity > 0 && order.quantitypreordered > 0">
|
||||
+ {{ t('ecomm.preord') }}:
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="order.quantitypreordered > 0"
|
||||
:class="`q-mx-sm text-blue-14`"
|
||||
>
|
||||
{{ order.quantitypreordered }}
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="showall && !nomodif"
|
||||
round
|
||||
size="xs"
|
||||
text-color="grey"
|
||||
icon="fas fa-plus"
|
||||
@click="addsubqty(true, false)"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div
|
||||
class="text-black q-ml-xs text-h8 text-center"
|
||||
v-if="order.product.productInfo.unit"
|
||||
>
|
||||
{{ tools.getWeightTotalByOrder(order) }}
|
||||
{{ tools.getUnitsMeasure(order.product.productInfo.unit, true) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 no-wrap text-subtitle3_short q-mr-sm">
|
||||
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''"
|
||||
>€ {{
|
||||
order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0
|
||||
}}</span
|
||||
>
|
||||
<span v-if="isApplicatoSconto()">
|
||||
<span class="ordine_scontato"
|
||||
>(<span class="barrato"
|
||||
>€
|
||||
{{
|
||||
(
|
||||
order.price * order.quantity +
|
||||
order.price * order.quantitypreordered
|
||||
).toFixed(2)
|
||||
}}</span
|
||||
>)</span
|
||||
>
|
||||
</span>
|
||||
<span v-if="isApplicatoSconto()" class="ordine_scritta_sconto">{{
|
||||
$t('ecomm.sconto_applicato', { risparmio: getRisparmio() })
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<q-btn
|
||||
v-if="!nomodif"
|
||||
icon="fas fa-times"
|
||||
color="negative"
|
||||
round
|
||||
size="xs"
|
||||
@click="removeFromCard"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
dense
|
||||
:class="
|
||||
bgcolor +
|
||||
` cursor-pointer q-my-sm ` +
|
||||
` cursor-pointer q-mx-sm ` +
|
||||
clcolor +
|
||||
` ` +
|
||||
myclass +
|
||||
|
||||
@@ -315,3 +315,7 @@ canvas {
|
||||
.titlesite {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.q-drawer-cart{
|
||||
width: 350px !important;
|
||||
}
|
||||
@@ -52,7 +52,9 @@
|
||||
<q-avatar @click="toHome" class="imglink">
|
||||
<img :src="imglogo()" height="27" alt="Immagine Logo" />
|
||||
</q-avatar>
|
||||
<div v-if="$q.screen.gt.xs" class="q-mx-sm titlesite">{{ getappname() }}</div>
|
||||
<div v-if="$q.screen.gt.xs" class="q-mx-sm titlesite">
|
||||
{{ getappname() }}
|
||||
</div>
|
||||
</q-toolbar-title>
|
||||
|
||||
<!--
|
||||
@@ -234,6 +236,7 @@
|
||||
<q-drawer
|
||||
v-if="site.confpages && site.confpages.enableEcommerce"
|
||||
v-model="rightCartOpen"
|
||||
class="q-drawer-cart"
|
||||
side="right"
|
||||
elevated
|
||||
>
|
||||
@@ -248,7 +251,7 @@
|
||||
>
|
||||
</q-btn>
|
||||
<div v-if="tools.isLogged()" class="text-weight-bold text-cart">
|
||||
Carrello
|
||||
{{ $t('ecomm.carrello') }}
|
||||
</div>
|
||||
<CMyCart v-if="isfinishLoading"></CMyCart>
|
||||
</q-drawer>
|
||||
@@ -373,7 +376,6 @@
|
||||
id="user-actions"
|
||||
class="column justify-center q-gutter-sm q-ma-sm center-150"
|
||||
>
|
||||
|
||||
<q-btn
|
||||
rounded
|
||||
color="primary"
|
||||
@@ -387,7 +389,8 @@
|
||||
color="orange"
|
||||
icon="house"
|
||||
:to="`/attivita/` + getMyUsername()"
|
||||
> {{ t('otherpages.myactivities') }}
|
||||
>
|
||||
{{ t('otherpages.myactivities') }}
|
||||
</q-btn>
|
||||
<!--<q-btn round color="warning" icon="lock"></q-btn>-->
|
||||
<q-btn
|
||||
|
||||
Reference in New Issue
Block a user