PCB lista categorie
This commit is contained in:
@@ -43,7 +43,7 @@ export default defineComponent({
|
||||
return cart.items || null
|
||||
}
|
||||
|
||||
function getNumItems() {
|
||||
function getNumItems(): number {
|
||||
const cart = productStore.getCart()
|
||||
if (!!cart.items)
|
||||
return cart.items.length || 0
|
||||
@@ -51,7 +51,7 @@ export default defineComponent({
|
||||
return 0
|
||||
}
|
||||
|
||||
function getCart() {
|
||||
function getCart(): ICart {
|
||||
return productStore.getCart()
|
||||
}
|
||||
|
||||
@@ -70,21 +70,21 @@ export default defineComponent({
|
||||
|
||||
const aggiorna = fieldname !== 'status'
|
||||
tools.saveFieldToServer($q, 'carts', mycart.value._id, mydata, aggiorna)
|
||||
myrec.value = oldrec.value
|
||||
oldrec.value[fieldname] = myrec.value[fieldname]
|
||||
}
|
||||
}
|
||||
|
||||
function myTotalPrice() {
|
||||
function myTotalPrice(): string {
|
||||
if (productStore.cart && productStore.cart.totalPrice) {
|
||||
return productStore.cart.totalPrice.toFixed(2)
|
||||
} else {
|
||||
return 0
|
||||
return '0'
|
||||
}
|
||||
}
|
||||
|
||||
function myTotalQty() {
|
||||
function myTotalQty(): number {
|
||||
if (productStore.cart) {
|
||||
return productStore.cart.totalQty
|
||||
return productStore.cart.totalQty!
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
@@ -93,6 +93,7 @@ export default defineComponent({
|
||||
async function load() {
|
||||
mycart.value = getCart()
|
||||
myrec.value = Object.keys(mycart)
|
||||
oldrec.value = myrec.value
|
||||
note.value = mycart.value.note!
|
||||
|
||||
if (mycart.value)
|
||||
|
||||
Reference in New Issue
Block a user