catalogo, avanti, grafica
This commit is contained in:
@@ -3375,13 +3375,17 @@ export const tools = {
|
||||
return myval.charAt(0).toUpperCase() + myval.slice(1)
|
||||
},
|
||||
|
||||
firstchars(value: any, numchars = 200) {
|
||||
firstchars(value: any, numchars = 200, capitalizeFirst = false) {
|
||||
if (!value) {
|
||||
return ''
|
||||
}
|
||||
try {
|
||||
let mycar = value.substring(0, numchars)
|
||||
if (value.length > numchars) mycar += '...'
|
||||
|
||||
if (capitalizeFirst) {
|
||||
mycar = mycar.charAt(0).toUpperCase() + mycar.slice(1);
|
||||
}
|
||||
return mycar
|
||||
} catch (e) {
|
||||
return value
|
||||
@@ -3912,7 +3916,7 @@ export const tools = {
|
||||
// this.$q.lang.set(mylang)
|
||||
|
||||
},
|
||||
|
||||
|
||||
getIdApp() {
|
||||
return process.env.APP_ID
|
||||
},
|
||||
@@ -8532,6 +8536,54 @@ export const tools = {
|
||||
window.location.reload();
|
||||
},
|
||||
|
||||
disponibStr(quantita: any) {
|
||||
if (!quantita) {
|
||||
// Disponibilità non pervenuta, non scrivere niente
|
||||
return ''
|
||||
}
|
||||
quantita = parseInt(quantita)
|
||||
let ris = ''
|
||||
if (quantita < 0) {
|
||||
ris = 'Disponibile per il Pre-Ordine'
|
||||
} else if (quantita === 0) {
|
||||
ris = 'Terminato!'
|
||||
} else if ((quantita > 0) && (quantita <= 3)) {
|
||||
if (quantita === 1)
|
||||
ris = 'Ultimo pezzo !'
|
||||
else
|
||||
ris = 'Ultimi ' + quantita + ' pezzi'
|
||||
} else if ((quantita > 3) && (quantita <= 10)) {
|
||||
ris = 'Media'
|
||||
} else {
|
||||
ris = 'Alta'
|
||||
}
|
||||
|
||||
return ris
|
||||
|
||||
},
|
||||
|
||||
colordisponib(quantita: any) {
|
||||
if (!quantita) {
|
||||
// Disponibilità non pervenuta, non scrivere niente
|
||||
return 'gray'
|
||||
}
|
||||
quantita = parseInt(quantita)
|
||||
let color = ''
|
||||
if (quantita < 0) {
|
||||
color = 'blue'
|
||||
} else if (quantita === 0) {
|
||||
color = 'gray'
|
||||
} else if ((quantita > 0) && (quantita <= 3)) {
|
||||
color = 'red'
|
||||
} else if ((quantita > 3) && (quantita <= 10)) {
|
||||
color = 'orange'
|
||||
} else if (quantita > 10) {
|
||||
color = 'green'
|
||||
}
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
|
||||
// FINE !
|
||||
|
||||
|
||||
Reference in New Issue
Block a user