agiornamento, sistemazioni varie PCB

This commit is contained in:
Surya Paolo
2024-01-23 00:10:52 +01:00
parent fbebd925b1
commit 8a5a2bd79a
38 changed files with 174 additions and 104 deletions

View File

@@ -4,6 +4,7 @@ APP_ID="17"
DIRECTORY_LOCAL=newfreeplanet
DIRECTORY_SERVER=freeplanet_serverside
SERVERDIR_WEBSITE="/var/customers/webs/paolouser/piuchebuono.app/"
SERVERPW_WEBSITE=pwdadmin@1AOK
APP_URL="https://piuchebuono.app"
URL_FACEBOOK=""
PROVA_PAOLO=""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -2,7 +2,7 @@
<div>
<div class="row">
<div :class="` `" :style="withBorder() ? `` : ``">
<div v-if="title && type === costanti.FieldType.string" class="q-ma-xs">
<div v-if="title && ((type === costanti.FieldType.string || type === costanti.FieldType.number))" class="q-ma-xs">
<q-field
rounded
outlined

View File

@@ -121,7 +121,7 @@
</q-item>
<q-item
v-if="
cosa === shared_consts.PROD.BOTTEGA ||
cosa === shared_consts.PROD.TUTTI || cosa === shared_consts.PROD.BOTTEGA ||
(cosa === shared_consts.PROD.GAS &&
products.getQtyAvailable(myproduct) > 0)
"
@@ -464,33 +464,6 @@
</q-item-section>
</q-item>
<q-item
v-if="
tools.isManager() && products.getQtyBloccataAvailable(myproduct) > 0
"
>
<q-item-section>
<q-item-section avatar>
<q-icon
name="fas fa-store"
style="padding-right: 16px !important"
/>
</q-item-section>
<q-item-section
v-if="
tools.isManager() &&
products.getQtyBloccataAvailable(myproduct) > 0
"
>
<q-item-label> {{ t('ecomm.bloccati') }}: </q-item-label>
<q-item-label>
<span class="text-black q-ml-xs text-h8">
{{ products.getQtyBloccataAvailable(myproduct) }}</span
>
</q-item-label>
</q-item-section>
</q-item-section>
</q-item>
<q-item v-if="isOrdGas() && myproduct.qtyToReachForGas > 0">
<q-item-section avatar>
<q-icon

View File

@@ -3,7 +3,7 @@
v-if="tools.isSeller() && productStore.userActive"
v-model="productStore.userActive"
:options="userStore.usersList"
label="Spesa dell'Utente:"
:label="t('ecomm.carrello_utente')"
filled
:bg-color="userStore.my._id !== productStore.userActive._id ? 'green' : undefined"
:option-label="(opt) => tools.getNomeUtenteEUsernameByRecUser(opt)"

View File

@@ -99,6 +99,7 @@ export interface IProductsState {
cart: ICart
orders: IOrderCart[]
catprods: ICatProd[]
catprods_gas: ICatProd[]
subcatprods: ISubCatProd[]
productInfos: IProductInfo[]
userActive: IUserShort

View File

@@ -1723,6 +1723,8 @@ const msg_it = {
active: 'Prodotto Acquistabile',
not_active: 'Prodotto Non Acquistabile',
totalPrice: 'Totale',
carrello_utente: 'Carrello dell\'Utente',
tutti: 'Tutti',
},
gas: {
name: 'Ordine Gas',

View File

@@ -68,7 +68,7 @@ export const tools = {
COOK_SEARCH: 'SEARCH_',
COOK_SELCART: 'SELCART_',
COOK_TAB_CIRCUIT: 'TAB_CIRC',
COOK_COSA_PRODOTTI: 'PROD',
COOK_COSA_PRODOTTI: 'PROD_N',
FRIENDS_SEARCH: 'FR_SE',
GROUP_SEARCH: 'GR_SE',
@@ -4313,6 +4313,10 @@ export const tools = {
scrollToTopAll() {
window.scrollTo(0, 0);
},
scrollToTopValue(val: number) {
window.scrollTo(0, val);
},
scrollToTop() {
const element = document.getElementById('mypage')
this.scrollToElement(element)
@@ -4331,6 +4335,10 @@ export const tools = {
}
},
scrollTop() {
return window.scrollY || document.documentElement.scrollTop;
},
getCellForWhatsapp(numbercell: string) {
if (!numbercell) return ''
let mynum = numbercell.replace(/-/g, '')

View File

@@ -105,14 +105,21 @@ export const useProducts = defineStore('Products', {
cart: { items: [], totalPrice: 0, totalQty: 0, userId: '' },
orders: [],
catprods: [],
catprods_gas: [],
subcatprods: [],
productInfos: [],
userActive: { username: '', name: '', surname: '', _id: '' },
}),
getters: {
getCatProds: (state: IProductsState) => (): ICatProd[] => {
return state.catprods
getCatProds: (state: IProductsState) => (cosa: number): ICatProd[] => {
if (cosa === shared_consts.PROD.GAS)
return state.catprods_gas
else if (cosa === shared_consts.PROD.GAS)
return state.catprods
else
return [...state.catprods, ...state.catprods_gas]
},
getNumProdTot: (state: IProductsState) => (): number => {
@@ -125,7 +132,7 @@ export const useProducts = defineStore('Products', {
const hasGasOrdines = rec.idGasordine
if ((cosa === shared_consts.PROD.GAS && hasGasOrdines) ||
(cosa === shared_consts.PROD.BOTTEGA && ((!hasGasOrdines || (hasGasOrdines && rec.idGasordine))))) {
(cosa === shared_consts.PROD.BOTTEGA && (!hasGasOrdines))) {
return true;
}
@@ -1026,6 +1033,11 @@ export const useProducts = defineStore('Products', {
return arrprod.length
},
getNumQtaTutti() {
const arrprod = this.getProducts(shared_consts.PROD.TUTTI)
return arrprod.length
},
getNumQtaBottega() {
const arrprod = this.getProducts(shared_consts.PROD.BOTTEGA)
return arrprod.length

View File

@@ -327,6 +327,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'departments') ris = state.departments
else if (table === 'categorys') ris = state.categories
else if (table === 'catprods') ris = Products.catprods
else if (table === 'catprods_gas') ris = Products.catprods_gas
else if (table === 'sharewithus') ris = state.sharewithus
else if (table === 'paymenttypes') ris = state.paymenttypes
else if (table === 'circuits') ris = circuitStore.listcircuits
@@ -1553,6 +1554,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.providers = (res.data.providers) ? [...res.data.providers] : []
Products.catprods = (res.data.catprods) ? [...res.data.catprods] : []
Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : []
this.gasordines = (res.data.gasordines) ? [...res.data.gasordines] : []
this.scontisticas = (res.data.scontisticas) ? [...res.data.scontisticas] : []

View File

@@ -79,13 +79,13 @@ export default defineComponent({
async function mounted() {
loadpage.value = false
await productStore.loadProducts()
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.BOTTEGA, true)
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.TUTTI, true)
// Inizializza
loadpage.value = true
}
function getCatProds() {
let arrcat = productStore.getCatProds()
let arrcat = productStore.getCatProds(cosa.value)
let riscat: any = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })

View File

@@ -16,10 +16,20 @@
dense
toggle-color="purple"
:options="[
{ value: shared_consts.PROD.TUTTI, slot: 'tutti' },
{ value: shared_consts.PROD.BOTTEGA, slot: 'bottega' },
{ value: shared_consts.PROD.GAS, slot: 'gas' },
]"
>
<template v-slot:tutti>
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('ecomm.tutti') }}
</div>
<q-icon right name="fas fa-user-friends" />
</div>
</template>
<template v-slot:gas>
<div class="row items-center no-wrap">
<div class="text-center">
@@ -60,6 +70,7 @@
<q-input
filled
stack-label
rounded
:dense="tools.isMobile() ? true : false"
:label="t('ecomm.code_o_text_search')"
v-model="search"

View File

@@ -20,14 +20,6 @@
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('gas.tutti') }}
<br />
{{
t('gas.x_prodotti_gas', {
qta:
productStore.getNumQtaGas() +
productStore.getNumQtaBottega(),
})
}}
</div>
<q-icon right name="fas fa-user-friends" />
</div>
@@ -36,10 +28,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>
@@ -49,12 +37,6 @@
<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>

View File

@@ -11,4 +11,15 @@ $heightBtn: 100%;
.prod_trov{
font-style: italic;
color: blue;
}
.fixed-group {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #ffffff; /* Customize the background color as needed */
z-index: 1000; /* Adjust the z-index to ensure it's above other elements */
transition: all 1s ease;
}

View File

@@ -1,4 +1,4 @@
import { defineComponent, onMounted, ref, watch, computed } from 'vue'
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount } from 'vue'
import { tools } from '@store/Modules/tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
@@ -14,7 +14,6 @@ import { CProductCard } from '@src/components/CProductCard'
import { CSelectUserActive } from '@src/components/CSelectUserActive'
import { IProduct } from '@src/model'
export default defineComponent({
name: 'ProductsList',
components: { CProductCard, CSelectUserActive },
@@ -32,33 +31,70 @@ export default defineComponent({
const cosa = ref(0)
const cat = ref('')
const loadpage = ref(false)
const refreshpage = ref(false)
const arrProducts = ref<any>([])
// Create a ref for the component to fix
const componentToFixRef = ref(<any>null);
const isFixed = ref(false);
// Register the scroll event on component mount
const handleScroll = () => {
const scrollTop = window.scrollY || document.documentElement.scrollTop;
// Set a threshold value based on how much scroll is needed to fix the components
const threshold = 300;
// Update the isFixed ref based on the scroll position
isFixed.value = scrollTop > threshold;
};
watch(() => cat.value, (newval, oldval) => {
calcArrProducts()
})
watch(() => search.value, (newval, oldval) => {
calcArrProducts()
if (tools.scrollTop() > 300) {
tools.scrollToTopValue(300)
}
})
watch(() => cosa.value, (newval, oldval) => {
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString())
if (cosa.value !== shared_consts.PROD.TUTTI)
cat.value = ''
calcArrProducts()
})
const getArrProducts = computed(() => {
function calcArrProducts() {
refreshpage.value = true
let arrprod = productStore.getProducts(cosa.value)
let catstr = cat.value;
let lowerSearchText = search.value.toLowerCase().trim();
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr) {
return arrprod
} else {
arrprod = arrprod.filter((product: IProduct) => {
let lowerName = product.productInfo.name!.toLowerCase();
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
let nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// Check if any word in lowerName starts with lowerSearchText
let anyWordStartsWithSearch = lowerName.split(/\s+/).some(word => nameMatch.test(word));
return (codeMatch.test(product.productInfo.code!) || anyWordStartsWithSearch) && hasCategoria;
});
}
return arrprod.filter((product: IProduct) => {
let lowerName = product.productInfo.name!.toLowerCase();
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
let nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// Check if any word in lowerName starts with lowerSearchText
let anyWordStartsWithSearch = lowerName.split(/\s+/).some(word => nameMatch.test(word));
return (codeMatch.test(product.productInfo.code!) || anyWordStartsWithSearch) && hasCategoria;
});
})
arrProducts.value = arrprod
refreshpage.value = false
}
/*function getProducts() {
let arrprod = productStore.getProducts(cosa.value)
@@ -79,13 +115,21 @@ export default defineComponent({
async function mounted() {
loadpage.value = false
await productStore.loadProducts()
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.BOTTEGA, true)
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.TUTTI, true)
// Inizializza
loadpage.value = true
window.addEventListener('scroll', handleScroll);
calcArrProducts()
}
// Remove the event listener on component destroy
onBeforeUnmount(() => {
window.removeEventListener('scroll', handleScroll);
});
function getCatProds() {
let arrcat = productStore.getCatProds()
let arrcat = productStore.getCatProds(cosa.value)
let riscat: any = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
@@ -94,7 +138,6 @@ export default defineComponent({
return riscat
}
onMounted(mounted)
return {
@@ -102,7 +145,6 @@ export default defineComponent({
costanti,
tools,
toolsext,
getArrProducts,
search,
cosa,
shared_consts,
@@ -111,6 +153,10 @@ export default defineComponent({
productStore,
t,
loadpage,
refreshpage,
componentToFixRef,
isFixed,
arrProducts,
}
}
})

View File

@@ -6,6 +6,7 @@
<div v-if="loadpage" class="panel">
<div>
<CSelectUserActive></CSelectUserActive>
<div class="text-center text-h7 text-blue">Filtra Prodotti per:</div>
<div class="text-center">
<q-btn-toggle
v-model="cosa"
@@ -13,23 +14,32 @@
:size="tools.isMobile() ? '0.75rem' : '1rem'"
rounded
glossy
dense
toggle-color="purple"
toggle-color="primary"
:options="[
{ value: shared_consts.PROD.TUTTI, slot: 'tutti' },
{ value: shared_consts.PROD.BOTTEGA, slot: 'bottega' },
{ value: shared_consts.PROD.GAS, slot: 'gas' },
]"
>
<template v-slot:tutti>
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('ecomm.tutti') }}
</div>
<q-icon right name="fas fa-check-square" />
</div>
</template>
<template v-slot:gas>
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('gas.ordina_sul_gas') }}
<br />
<!--<br />
{{
t('gas.x_prodotti_gas', {
qta: productStore.getNumQtaGas(),
})
}}
}}-->
</div>
<q-icon right name="fas fa-user-friends" />
</div>
@@ -39,12 +49,12 @@
<div class="row items-center no-wrap">
<div class="text-center">
{{ t('gas.bottega') }}
<br />
<!--<br />
{{
t('gas.x_prodotti_bottega', {
qta: productStore.getNumQtaBottega(),
})
}}
}}-->
</div>
<q-icon right name="fas fa-store" />
</div>
@@ -52,25 +62,36 @@
</q-btn-toggle>
</div>
</div>
<div class="container">
<div
class="column text-center q-mx-auto q-py-sm q-mb-sm"
style="width: 350px; max-width: 100%"
>
<q-input
filled
stack-label
:dense="tools.isMobile() ? true : false"
:label="t('ecomm.code_o_text_search')"
v-model="search"
debounce="500"
class="q-ml-md"
<q-slide-transition>
<div
v-show="isFixed || tools.scrollTop() < 300"
:class="
'column text-center q-mx-auto q-py-sm q-mb-sm ' +
(isFixed ? 'fixed-group ' : '')
"
style="width: 350px; max-width: 100%"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</div>
<div>
<q-input
ref="componentToFixRef"
filled
stack-label
rounded
:dense="tools.isMobile() ? true : false"
:label="t('ecomm.code_o_text_search')"
v-model="search"
debounce="300"
class="q-ml-md"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</div>
</div>
</q-slide-transition>
<div class="row q-gutter-xs justify-center q-mx-auto">
<div v-for="(reccat, index) in getCatProds()" :key="index">
<q-btn
@@ -88,17 +109,17 @@
</div>
</div>
<div class="text-center q-py-sm prod_trov">
{{
<span v-show="productStore.getNumProdTot() !== arrProducts.length">{{
t('ecomm.prodotti_trovati', {
qta: getArrProducts.length,
qta: arrProducts.length,
qtatot: productStore.getNumProdTot(),
})
}}{{}}
}}</span>
</div>
<div class="row justify-around">
<div
class="q-pa-xs row items-start"
v-for="(product, index) in getArrProducts"
v-for="(product, index) in arrProducts"
:key="index"
>
<CProductCard :id="product._id" :complete="false" :cosa="cosa" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB