- Categorie
- ProductInfo
This commit is contained in:
@@ -6,6 +6,8 @@ import { IOperators, IOrder, IProduct } from '@src/model'
|
||||
import { defineComponent, PropType, toRef } from 'vue'
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -30,6 +32,9 @@ export default defineComponent({
|
||||
setup(props) {
|
||||
const products = useProducts()
|
||||
const order = toRef(props, 'order')
|
||||
const { t } = useI18n()
|
||||
|
||||
const $q = useQuasar()
|
||||
|
||||
function myimgclass() {
|
||||
if (props.showall) {
|
||||
@@ -71,14 +76,16 @@ export default defineComponent({
|
||||
order: props.order,
|
||||
}).then((res: any) => {
|
||||
if (res.risult) {
|
||||
order.value.quantity = res.myord.quantity
|
||||
order.value.quantitypreordered = res.myord.quantitypreordered
|
||||
if (res.myord) {
|
||||
order.value.quantity = res.myord.quantity
|
||||
order.value.quantitypreordered = res.myord.quantitypreordered
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function isApplicatoSconto() {
|
||||
const totalipotetico = order.value.price * (order.value.quantity + order.value.quantitypreordered)
|
||||
const totalipotetico = order.value.product!.price * (order.value.quantity + order.value.quantitypreordered)
|
||||
if (totalipotetico > order.value.TotalPriceProduct) {
|
||||
return true
|
||||
}
|
||||
@@ -89,8 +96,8 @@ export default defineComponent({
|
||||
products.removeFromCart({ order: order.value })
|
||||
}
|
||||
|
||||
function getRisparmio(): string {
|
||||
return ((order.value.price * order.value.quantity) - order.value.TotalPriceProduct).toFixed(2)
|
||||
function getRisparmio(): string {
|
||||
return ((order.value.product!.price * order.value.quantity) - order.value.TotalPriceProduct).toFixed(2)
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -101,6 +108,7 @@ export default defineComponent({
|
||||
getRisparmio,
|
||||
tools,
|
||||
products,
|
||||
t,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user