- aggiornamento Cataloghi
- Gestione delle versioni del prodotto ("Nuovi","Usati","Epub", ecc..)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="18"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="18"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker_1.0.39.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="15"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="15"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fioredellavita",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Fiore Della Vita",
|
||||
"productName": "Fiore Della Vita",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="18"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="16"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gruppomacro",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Gruppo Macro Editori",
|
||||
"productName": "Gruppo Macro",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="17"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="16"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="1.0.48"
|
||||
APP_VERSION="1.0.49"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
2
now.txt
2
now.txt
@@ -1 +1 @@
|
||||
TERMINA DI LAVORARE SU gruppomacro.app: (Sovrascrivo !)
|
||||
TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.49",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -18,7 +18,7 @@ import 'animate.css';
|
||||
export default {
|
||||
components: {
|
||||
appHeader: MyHeader,
|
||||
appFooter: MyFooter,
|
||||
MyFooter,
|
||||
CFirstPageApp,
|
||||
CProvaPao,
|
||||
BannerCookies, /* , CPreloadImages */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</q-inner-loading>
|
||||
</q-page-container>
|
||||
|
||||
<app-footer></app-footer>
|
||||
<MyFooter></MyFooter>
|
||||
|
||||
</q-layout>
|
||||
</div>
|
||||
|
||||
@@ -2163,6 +2163,15 @@ export const shared_consts = {
|
||||
AUDIOLIBRO: 22,
|
||||
VIDEO: 23,
|
||||
CARTE: 25,
|
||||
// -----------
|
||||
NUOVO: 101,
|
||||
USATO: 102,
|
||||
DOWNLOAD: 103,
|
||||
DVD: 104,
|
||||
EPUB: 105,
|
||||
MOBI: 106,
|
||||
PDF: 107,
|
||||
STREAMING: 108,
|
||||
},
|
||||
|
||||
VERSIONE: {
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
import { defineComponent } from 'vue'
|
||||
import { PropType, defineComponent } from 'vue'
|
||||
|
||||
import { Catalogo } from '@src/views/ecommerce'
|
||||
import { ICatalogo } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CCatalogo',
|
||||
components: { Catalogo },
|
||||
props: {
|
||||
// add options ICatalogo
|
||||
options: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: [],
|
||||
excludeproductTypes: [],
|
||||
formato: [],
|
||||
Categoria: [],
|
||||
Editore: [],
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<Catalogo>
|
||||
<Catalogo :optcatalogo="optcatalogo">
|
||||
|
||||
</Catalogo>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ import { CPrice } from '../CPrice'
|
||||
|
||||
import { func_tools, toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import { IBaseOrder, IGasordine, IOrder, IOrderCart, IProduct, IVariazione } from '@src/model'
|
||||
import { IBaseOrder, ICatalogo, IGasordine, IOrder, IOrderCart, IProduct, IVariazione } from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
@@ -28,7 +28,7 @@ import 'vue3-pdf-app/dist/icons/main.css'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CCatalogoCard',
|
||||
emits: ['selauthor'],
|
||||
emits: ['selauthor', 'opendetail'],
|
||||
props: {
|
||||
product: {
|
||||
type: Object as PropType<IProduct | null>,
|
||||
@@ -54,7 +54,19 @@ export default defineComponent({
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => { }
|
||||
}
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: [0],
|
||||
excludeproductTypes: [],
|
||||
formato: [],
|
||||
Categoria: [],
|
||||
Editore: [],
|
||||
}),
|
||||
},
|
||||
},
|
||||
components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice },
|
||||
setup(props, { emit }) {
|
||||
@@ -477,6 +489,19 @@ export default defineComponent({
|
||||
emit('selauthor', id, autore)
|
||||
}
|
||||
|
||||
function click_opendetail(id: any, autore: any) {
|
||||
emit('opendetail')
|
||||
}
|
||||
function escludiArticolo(variazione: IVariazione) {
|
||||
let hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (variazione.arrversioni || []).every((item: any) => props.optcatalogo.excludeproductTypes.includes(item)))
|
||||
|
||||
return hasExcludeProductTypes
|
||||
}
|
||||
|
||||
function checkIfVariazioneDaVisu(variazione: IVariazione) {
|
||||
return !escludiArticolo(variazione)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
onBeforeUnmount(beforeDestroy)
|
||||
|
||||
@@ -531,6 +556,8 @@ export default defineComponent({
|
||||
indvariazSel,
|
||||
checkifCartEnable,
|
||||
click_author,
|
||||
click_opendetail,
|
||||
checkIfVariazioneDaVisu,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
dense
|
||||
>
|
||||
</q-toggle>
|
||||
<q-page-sticky v-if="complete" position="bottom-right" :offset="[18, 0]">
|
||||
<q-btn fab icon="fas fa-arrow-up" class="semi-transparent" color="primary" v-close-popup/>
|
||||
</q-page-sticky>
|
||||
|
||||
<q-card-section>
|
||||
<div
|
||||
:class="{ 'flex q-pa-sm': true, 'shadow-2': options.in_3d }"
|
||||
@@ -40,32 +44,39 @@
|
||||
'cursor-pointer': !complete,
|
||||
'shadow-4': true,
|
||||
}"
|
||||
@click="
|
||||
@click="click_opendetail()"
|
||||
>
|
||||
<!--@click="
|
||||
complete
|
||||
? toggleFullScreen
|
||||
: naviga(`/catalogo/` + myproduct._id + '/' + cosa)
|
||||
"
|
||||
>
|
||||
"-->
|
||||
<div
|
||||
class="absolute transparent"
|
||||
style="left: 90%; top: 0; transform: translateX(-50%)"
|
||||
style="left: 90%; top: -18px; transform: translateX(-50%)"
|
||||
>
|
||||
<q-btn
|
||||
color="blue"
|
||||
color="blue-6"
|
||||
class="semi-transparent"
|
||||
round
|
||||
icon="search"
|
||||
@click="toggleFullScreen"
|
||||
size="md"
|
||||
@click.stop="toggleFullScreen"
|
||||
size="sm"
|
||||
/>
|
||||
</div>
|
||||
</q-img>
|
||||
|
||||
<div class="scheda-book">
|
||||
<q-card-title>
|
||||
<span class="book-title" :data-col="options.quante_col">{{
|
||||
myproduct.productInfo.name
|
||||
}}</span>
|
||||
<span class="book-title" :data-col="options.quante_col">
|
||||
<span
|
||||
v-if="!complete"
|
||||
class="cursor-pointer"
|
||||
@click="click_opendetail()"
|
||||
>{{ myproduct.productInfo.name }}
|
||||
</span>
|
||||
<span v-else>{{ myproduct.productInfo.name }} </span>
|
||||
</span>
|
||||
</q-card-title>
|
||||
<q-card-subtitle
|
||||
v-if="myproduct.productInfo.authors"
|
||||
@@ -78,8 +89,11 @@
|
||||
:key="author._id"
|
||||
>
|
||||
<span v-if="index > 0">, </span>
|
||||
<span class="author cursor-pointer text-primary"
|
||||
@click="click_author(author._id, author.name + ' ' + author.surname)"
|
||||
<span
|
||||
class="author cursor-pointer text-primary"
|
||||
@click="
|
||||
click_author(author._id, author.name + ' ' + author.surname)
|
||||
"
|
||||
>{{ author.name }} {{ author.surname }}</span
|
||||
>
|
||||
</span>
|
||||
@@ -141,21 +155,21 @@
|
||||
:key="index"
|
||||
@click="setvariazioneSelected(index)"
|
||||
>
|
||||
<div class="flex justify-between items-center q-mx-sm">
|
||||
<div v-if="checkIfVariazioneDaVisu(variazione)" class="flex justify-between items-center q-mx-sm">
|
||||
<q-badge
|
||||
class="q-badge--large"
|
||||
:color="
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.versione].color
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]].color
|
||||
"
|
||||
>
|
||||
<q-icon
|
||||
v-if="variazione.versione > 0"
|
||||
:name="tools.getIconByVersione(variazione.versione)"
|
||||
v-if="variazione.arrversioni[0] > 0"
|
||||
:name="tools.getIconByVersione(variazione.arrversioni[0])"
|
||||
color="white"
|
||||
></q-icon
|
||||
>
|
||||
{{
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.versione].label
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]].label
|
||||
}}
|
||||
</q-badge>
|
||||
<div v-if="variazione.formato && false">
|
||||
@@ -230,11 +244,9 @@
|
||||
v-for="(variazione, index) of myproduct.arrvariazioni"
|
||||
:key="index"
|
||||
>
|
||||
<div v-show="indvariazSel == index">
|
||||
<div v-show="indvariazSel == index && checkIfVariazioneDaVisu(variazione)">
|
||||
<div
|
||||
v-show="
|
||||
tools.disponibStr(variazione.quantita)
|
||||
"
|
||||
v-show="tools.disponibStr(variazione.quantita)"
|
||||
class="row justify-center q-mt-sm vertical-middle"
|
||||
style="align-items: center"
|
||||
>
|
||||
@@ -270,9 +282,9 @@
|
||||
>
|
||||
<span class="q-mr-sm">{{ $t('products.formato') }}:</span>
|
||||
<q-badge
|
||||
v-show="variazione.versione > 0"
|
||||
v-show="variazione.arrversioni[0] > 0"
|
||||
:color="
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.versione]
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]]
|
||||
.color
|
||||
"
|
||||
>{{ variazione.formato }}</q-badge
|
||||
@@ -281,9 +293,7 @@
|
||||
|
||||
<div class="row justify-center q-mt-sm">
|
||||
<q-btn
|
||||
v-if="
|
||||
variazione.addtocart_link && true
|
||||
"
|
||||
v-if="variazione.addtocart_link && true"
|
||||
:href="variazione.addtocart_link"
|
||||
target="_blank"
|
||||
color="primary"
|
||||
|
||||
1
src/components/CContainerCatalogoCard/CContainerCatalogoCard.scss
Executable file
1
src/components/CContainerCatalogoCard/CContainerCatalogoCard.scss
Executable file
@@ -0,0 +1 @@
|
||||
|
||||
94
src/components/CContainerCatalogoCard/CContainerCatalogoCard.ts
Executable file
94
src/components/CContainerCatalogoCard/CContainerCatalogoCard.ts
Executable file
@@ -0,0 +1,94 @@
|
||||
import { defineComponent, ref, toRef, computed, PropType, watch, onMounted, reactive, onBeforeUnmount } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import { CCatalogoCard } from '../CCatalogoCard'
|
||||
|
||||
import { func_tools, toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
import { ICatalogo } from '@src/model'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CContainerCatalogoCard',
|
||||
emits: ['selauthor'],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
cosa: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
complete: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => { }
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: [0],
|
||||
excludeproductTypes: [],
|
||||
formato: [],
|
||||
Categoria: [],
|
||||
Editore: [],
|
||||
}),
|
||||
},
|
||||
},
|
||||
components: { CCatalogoCard },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const opendetailbool = ref(false)
|
||||
|
||||
function selauthor(id: any, autore: any) {
|
||||
emit('selauthor', id, autore)
|
||||
}
|
||||
|
||||
function opendetail() {
|
||||
opendetailbool.value = true
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
//
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
t,
|
||||
func_tools,
|
||||
toolsext,
|
||||
shared_consts,
|
||||
globalStore,
|
||||
costanti,
|
||||
selauthor,
|
||||
opendetail,
|
||||
opendetailbool,
|
||||
}
|
||||
}
|
||||
})
|
||||
49
src/components/CContainerCatalogoCard/CContainerCatalogoCard.vue
Executable file
49
src/components/CContainerCatalogoCard/CContainerCatalogoCard.vue
Executable file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div>
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:complete="complete"
|
||||
:cosa="cosa"
|
||||
:options="options"
|
||||
@selauthor="selauthor"
|
||||
@opendetail="opendetail"
|
||||
:optcatalogo="optcatalogo"
|
||||
>
|
||||
</CCatalogoCard>
|
||||
</div>
|
||||
<q-dialog
|
||||
v-model="opendetailbool"
|
||||
position="top"
|
||||
:maximized="true"
|
||||
class="q-pt-none"
|
||||
>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<div class="row justify-center">
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:complete="true"
|
||||
:cosa="cosa"
|
||||
:options="{
|
||||
show_short_descr: true,
|
||||
show_price: true,
|
||||
show_cat: true,
|
||||
quante_col: 'c1',
|
||||
in_3d: true,
|
||||
}"
|
||||
:optcatalogo="optcatalogo"
|
||||
@selauthor="selauthor"
|
||||
>
|
||||
</CCatalogoCard>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CContainerCatalogoCard.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CContainerCatalogoCard.scss';
|
||||
</style>
|
||||
1
src/components/CContainerCatalogoCard/index.ts
Executable file
1
src/components/CContainerCatalogoCard/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CContainerCatalogoCard} from './CContainerCatalogoCard.vue'
|
||||
@@ -177,6 +177,8 @@ export default defineComponent({
|
||||
// console.log('myrec', myrec)
|
||||
myrec.value = ris
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
}).catch((err) => {
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
@@ -115,23 +115,7 @@ export default defineComponent({
|
||||
|
||||
visuadd.value = false
|
||||
|
||||
const newrec: IMyElem = {
|
||||
_id: undefined,
|
||||
type: newtype.value,
|
||||
path: props.myelem.path,
|
||||
order: order ? order : 1000,
|
||||
active: true,
|
||||
container: ''
|
||||
}
|
||||
|
||||
if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
|
||||
newrec.container2 = '8'
|
||||
newrec.height = 600
|
||||
} else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
|
||||
newrec.class2 = 'row justify-center'
|
||||
}
|
||||
|
||||
globalStore.addNewElem($q, t, newrec)
|
||||
let newrec = globalStore.prepareAddNewElem(order, $q, t, props.myelem, newtype.value)
|
||||
|
||||
emit('selElemClick', newrec)
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="myel.type === shared_consts.ELEMTYPE.CARD"
|
||||
v-else-if="myel.type === shared_consts.ELEMTYPE.CARD"
|
||||
:class="myel.span ? '' : ''"
|
||||
>
|
||||
<CSelectAnimation
|
||||
@@ -360,7 +360,7 @@
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
|
||||
<div v-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.MARGINI">
|
||||
<div v-if="enableEdit">
|
||||
<q-input
|
||||
dense
|
||||
@@ -977,13 +977,56 @@
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECKIFISLOGGED">
|
||||
<q-select
|
||||
v-model="myel.container"
|
||||
:options="[{label: 'Mostra Sempre', value: true }, { label: 'Solo se Offline', value: false}]"
|
||||
:options="[
|
||||
{ label: 'Mostra Sempre', value: true },
|
||||
{ label: 'Solo se Offline', value: false },
|
||||
]"
|
||||
label="Quando mostrarlo"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CATALOGO">
|
||||
<div v-if="enableEdit" class="row">
|
||||
<div>Cataloghi:</div><br>
|
||||
|
||||
<!--++AddCATALOGO_FIELDS-->
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit && myel.catalogo && myel.catalogo.productTypes"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.productTypes"
|
||||
:options="tools.SelectListVersione"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Includi"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit && myel.catalogo && myel.catalogo.excludeproductTypes"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.excludeproductTypes"
|
||||
:options="tools.SelectListVersione"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Escludi"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -117,7 +117,7 @@ export default defineComponent({
|
||||
|
||||
const newtype = ref(<any>'')
|
||||
|
||||
const isAppRunning = computed(() => globalStore.isAppRunning )
|
||||
const isAppRunning = computed(() => globalStore.isAppRunning)
|
||||
|
||||
watch(() => myel.value.order, (value, oldval) => {
|
||||
mounted()
|
||||
@@ -150,21 +150,7 @@ export default defineComponent({
|
||||
|
||||
function addNewElem(order?: number) {
|
||||
|
||||
const newrec: IMyElem = {
|
||||
_id: undefined,
|
||||
type: newtype.value,
|
||||
path: props.myelem.path,
|
||||
order: order ? order : 1000,
|
||||
active: true,
|
||||
container: ''
|
||||
}
|
||||
|
||||
if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
|
||||
newrec.container2 = '8'
|
||||
newrec.height = 600
|
||||
}
|
||||
|
||||
globalStore.addNewElem($q, t, newrec)
|
||||
let newrec = globalStore.prepareAddNewElem(order, $q, t, props.myelem, newtype.value)
|
||||
}
|
||||
|
||||
function dupElem(order?: number) {
|
||||
|
||||
@@ -559,7 +559,8 @@
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CATALOGO">
|
||||
<div v-if="editOn" class="elemEdit">PRODOTTI CATALOGO:</div>
|
||||
<CCatalogo> </CCatalogo>
|
||||
<CCatalogo
|
||||
:optcatalogo="myel.catalogo"> </CCatalogo>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.MAPPA">
|
||||
<div v-if="editOn" class="elemEdit">MAPPA:</div>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
</div>
|
||||
<slot></slot>
|
||||
<div v-if="!nofooter">
|
||||
<LandingFooter></LandingFooter>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -440,6 +440,8 @@ export default defineComponent({
|
||||
// if (!props.useinput) {
|
||||
if (props.value) {
|
||||
myvalue.value = props.value
|
||||
} else {
|
||||
myvalue.value = ''
|
||||
}
|
||||
// }
|
||||
}
|
||||
@@ -547,9 +549,9 @@ export default defineComponent({
|
||||
function filterFn(val: any, update: any, abort: any) {
|
||||
update(
|
||||
async () => {
|
||||
console.log('Filter val', val, val.length)
|
||||
console.log('Filter val:', val, 'len=', val.length)
|
||||
console.log('props.filter_extra', props.filter_extra)
|
||||
|
||||
console.log('valori.value', valori.value)
|
||||
|
||||
let myarr: any = []
|
||||
|
||||
@@ -743,6 +745,10 @@ export default defineComponent({
|
||||
return ''
|
||||
}
|
||||
|
||||
function selectText(event: any) {
|
||||
// Seleziona tutto il testo all'interno della casella di testo
|
||||
event.target.select();
|
||||
}
|
||||
onMounted(mounted)
|
||||
|
||||
|
||||
@@ -758,6 +764,7 @@ export default defineComponent({
|
||||
newvaluefuncfirst,
|
||||
getIcon,
|
||||
tools,
|
||||
selectText,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-else-if="pickup">
|
||||
|
||||
<q-select
|
||||
v-if="pickup"
|
||||
:model-value="myvalue"
|
||||
@@ -95,9 +96,12 @@
|
||||
:option-value="optval"
|
||||
:option-label="optlab"
|
||||
map-options
|
||||
:use-chips="myvalue && myvalue !== '' ? true : false"
|
||||
stack-label
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
@filter="filterFn"
|
||||
v-bind="$attrs"
|
||||
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<meta name="description" content="<%= productDescription %>">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="version" content="1.0.48">
|
||||
<meta name="version" content="1.0.49">
|
||||
<meta name="viewport"
|
||||
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ export interface IMyElem {
|
||||
styleadd?: string
|
||||
list?: IImgGallery[]
|
||||
listcards?: IMyCard[]
|
||||
catalogo?: ICatalogo
|
||||
elemsText?: IElemText[]
|
||||
}
|
||||
|
||||
@@ -637,6 +638,16 @@ export interface IMyCard {
|
||||
colorsub?: string
|
||||
}
|
||||
|
||||
export interface ICatalogo {
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: number[]
|
||||
excludeproductTypes: number[]
|
||||
formato: string[]
|
||||
Categoria: string[]
|
||||
Editore: string[]
|
||||
}
|
||||
|
||||
|
||||
export interface IGallery {
|
||||
_id?: string
|
||||
author_username?: string
|
||||
|
||||
@@ -38,12 +38,13 @@ export interface IProductInfo {
|
||||
publisher?: IPublisher
|
||||
date_publishing?: Date
|
||||
numpages?: number
|
||||
productType?: number
|
||||
productTypes?: number[]
|
||||
versioneGM?: string
|
||||
}
|
||||
|
||||
export interface IVariazione {
|
||||
active?: boolean
|
||||
versione?: number
|
||||
arrversioni?: number[]
|
||||
status?: string,
|
||||
price?: number
|
||||
sale_price?: number
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<div>{{ risraw }}</div>
|
||||
|
||||
<div v-html="risultato"></div>
|
||||
<div v-html="risultato.substring(0, 1000)"></div>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
@@ -335,6 +335,7 @@ export const tools = {
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
SelectListColors: [
|
||||
{ label: '[Nessuno]', value: '' },
|
||||
{ label: 'aliceblue', value: '#f0f8ff' },
|
||||
@@ -1391,6 +1392,13 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
SelectListVersione: [
|
||||
{ label: '[Tutti]', value: 0 },
|
||||
{ label: 'Nuovi', value: shared_consts.PRODUCTTYPE.NUOVO },
|
||||
{ label: 'Usati', value: shared_consts.PRODUCTTYPE.USATO },
|
||||
{ label: 'DVD', value: shared_consts.PRODUCTTYPE.DVD },
|
||||
],
|
||||
|
||||
INDEX_MENU_DELETE: 4,
|
||||
|
||||
menuPopupTodo:
|
||||
@@ -8644,8 +8652,9 @@ export const tools = {
|
||||
},
|
||||
|
||||
// get the last 2 digit fraction part, of a decimal number
|
||||
getDecPart2Digit(number: number) {
|
||||
return Math.round(number * 100) % 100
|
||||
getDecPart2Digit(number: number): string {
|
||||
let parts = number.toFixed(2).split('.');
|
||||
return parts.length > 1 ? parts[1] : '00';
|
||||
},
|
||||
|
||||
getRecordByField(field: any, record: any) {
|
||||
|
||||
@@ -2096,5 +2096,38 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
})
|
||||
},
|
||||
|
||||
prepareAddNewElem(order: any, $q: any, t: any, myelem: any, newtype: any) {
|
||||
|
||||
const newrec: IMyElem = {
|
||||
_id: undefined,
|
||||
type: newtype,
|
||||
path: myelem.path,
|
||||
order: order ? order : 1000,
|
||||
active: true,
|
||||
container: ''
|
||||
}
|
||||
|
||||
if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
|
||||
newrec.container2 = '8'
|
||||
newrec.height = 600
|
||||
} else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
|
||||
newrec.class2 = 'row justify-center'
|
||||
} else if (newrec.type === shared_consts.ELEMTYPE.CATALOGO) {
|
||||
newrec.catalogo = {
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: [0],
|
||||
excludeproductTypes: [],
|
||||
formato: [],
|
||||
Categoria: [],
|
||||
Editore: [],
|
||||
}
|
||||
}
|
||||
|
||||
this.addNewElem($q, t, newrec)
|
||||
|
||||
return newrec
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
@@ -551,6 +551,11 @@
|
||||
color="primary"
|
||||
@click="EseguiFunz('correggiCircuitiANull', '', '')"
|
||||
></q-btn>
|
||||
<br /><q-btn
|
||||
label="Correggi i ProductType in ProductTypes"
|
||||
color="primary"
|
||||
@click="EseguiFunz('correggiProductTypes', '', '')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount } from 'vue'
|
||||
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, PropType } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -12,17 +12,30 @@ import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { CProductCard } from '@src/components/CProductCard'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CCatalogoCard } from '@src/components/CCatalogoCard'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import { IProduct, ISearchList } from 'model'
|
||||
import { ICatalogo, IProduct, ISearchList } from 'model'
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
components: { CCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
||||
props: {},
|
||||
setup() {
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
||||
props: {
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: [0],
|
||||
excludeproductTypes: [],
|
||||
formato: [],
|
||||
Categoria: [],
|
||||
Editore: [],
|
||||
}),
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const productStore = useProducts()
|
||||
@@ -49,6 +62,8 @@ export default defineComponent({
|
||||
|
||||
const mycolumns = ref([])
|
||||
|
||||
const tabvisu = ref('categorie')
|
||||
|
||||
const searchList = ref([] as ISearchList[])
|
||||
|
||||
const arrProducts = ref<any>([])
|
||||
@@ -67,13 +82,6 @@ export default defineComponent({
|
||||
return lab
|
||||
})
|
||||
|
||||
const getlist = computed(() => {
|
||||
const mylist = searchList.value.find((rec: any) => rec.table === 'products')
|
||||
|
||||
return mylist
|
||||
})
|
||||
|
||||
|
||||
const arrLoaded = computed(() => {
|
||||
if (arrProducts.value && numRecLoaded.value)
|
||||
return arrProducts.value.slice(0, numRecLoaded.value)
|
||||
@@ -96,8 +104,8 @@ export default defineComponent({
|
||||
watch(() => cat.value, (newval, oldval) => {
|
||||
|
||||
if (cat.value) {
|
||||
filter.value.author = '' // disattivo il filtro autore
|
||||
search.value = '' // disattivo anche la ricerca per testo
|
||||
filter.value.author = '' // disattivo il filtro autore
|
||||
resetSearch()
|
||||
}
|
||||
|
||||
calcArrProducts()
|
||||
@@ -107,7 +115,7 @@ export default defineComponent({
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
watch(() => search.value, (newval, oldval) => {
|
||||
watch(() => getSearchText(), (newval, oldval) => {
|
||||
calcArrProducts()
|
||||
if (tools.scrollTop() > 300) {
|
||||
tools.scrollToTopValue(300)
|
||||
@@ -118,7 +126,7 @@ export default defineComponent({
|
||||
// Se filtroAuthor attivato, allora evito il filtro per Categoria
|
||||
if (filter.value.author) {
|
||||
cat.value = '' // disattivo il filtro categoria
|
||||
search.value = '' // disattivo anche la ricerca per testo
|
||||
resetSearch()
|
||||
}
|
||||
|
||||
calcArrProducts()
|
||||
@@ -134,22 +142,52 @@ export default defineComponent({
|
||||
calcArrProducts()
|
||||
})
|
||||
|
||||
function resetSearch() {
|
||||
const mialista = getSearchList()
|
||||
if (mialista && mialista.value && mialista.value.hasOwnProperty('name')) {
|
||||
mialista.value = null
|
||||
}
|
||||
search.value = ''
|
||||
}
|
||||
|
||||
function getSearchList() {
|
||||
const mylist = searchList.value.find((rec: any) => rec.table === 'products' && rec.key === 'titolo')
|
||||
|
||||
return mylist
|
||||
}
|
||||
|
||||
function getSearchText(): string {
|
||||
const lista = getSearchList()
|
||||
return lista && lista.value && lista.value.hasOwnProperty('name') ? lista.value.name : ''
|
||||
}
|
||||
|
||||
function calcArrProducts() {
|
||||
// console.log('calcArrProducts')
|
||||
|
||||
const searchtext = getSearchText()
|
||||
|
||||
refreshpage.value = true
|
||||
let arrprod = productStore.getProducts(cosa.value) || [];
|
||||
let filtroAuthor = filter.value.author || '';
|
||||
|
||||
let catstr = cat.value || '';
|
||||
//++AddCATALOGO_FIELDS
|
||||
|
||||
let filtroProductTypes = props.optcatalogo.productTypes || [0]
|
||||
let filtroExcludeProductTypes = props.optcatalogo.excludeproductTypes || [0]
|
||||
let boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
|
||||
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
|
||||
|
||||
//console.log('filtroVersione', filtroProductTypes)
|
||||
|
||||
let catstr = cat.value || ''
|
||||
|
||||
let gasselstr = ''
|
||||
if (cosa.value === shared_consts.PROD.GAS) {
|
||||
gasselstr = idGasSel.value || '';
|
||||
}
|
||||
let lowerSearchText = (search.value || '').toLowerCase().trim();
|
||||
let lowerSearchText = (searchtext || '').toLowerCase().trim();
|
||||
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
|
||||
} else {
|
||||
|
||||
@@ -159,6 +197,21 @@ export default defineComponent({
|
||||
let hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr));
|
||||
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
|
||||
|
||||
let hasProductTypes = true
|
||||
let hasExcludeProductTypes = false
|
||||
|
||||
//++AddCATALOGO_FIELDS
|
||||
|
||||
if (props.optcatalogo && !boolfiltroVuotoProductTypes) {
|
||||
// check if productInfo.productTypes array includes some item in props.optcatalogo.ProductTypes array
|
||||
hasProductTypes = !props.optcatalogo.productTypes || (props.optcatalogo.productTypes && (product.productInfo.productTypes || []).some((item: any) => props.optcatalogo.productTypes.includes(item)))
|
||||
}
|
||||
|
||||
if (props.optcatalogo && !boolfiltroVuotoExcludeProductTypes) {
|
||||
// check if productInfo.productTypes array exclude some item in props.optcatalogo.ProductTypes array
|
||||
hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => props.optcatalogo.excludeproductTypes.includes(item)))
|
||||
}
|
||||
|
||||
let productgassel = true
|
||||
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) {
|
||||
productgassel = (product.idGasordine === gasselstr)
|
||||
@@ -171,7 +224,7 @@ export default defineComponent({
|
||||
// Check if all words in lowerSearchText are present in lowerName
|
||||
let allWordsPresent = lowerSearchText.split(/\s+/).every(word => new RegExp(`\\b${word}\\b`, 'i').test(lowerName));
|
||||
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel;
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel && hasProductTypes && !hasExcludeProductTypes;
|
||||
} else {
|
||||
console.error('product or product.productInfo is null');
|
||||
return false;
|
||||
@@ -214,7 +267,7 @@ export default defineComponent({
|
||||
key: 'titolo',
|
||||
type: costanti.FieldType.select_by_server,
|
||||
value: '',
|
||||
addall: true,
|
||||
// addall: true,
|
||||
arrvalue: [],
|
||||
useinput: true,
|
||||
filter: null,
|
||||
@@ -224,9 +277,12 @@ export default defineComponent({
|
||||
|
||||
optauthors.value = productStore.getAuthors()
|
||||
|
||||
cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true)
|
||||
if (cosa.value === shared_consts.PROD.TUTTI)
|
||||
cosa.value = shared_consts.PROD.GAS
|
||||
//++Todo: Per ora visualizzo solo il "Negozio" e non i GAS...
|
||||
cosa.value = shared_consts.PROD.BOTTEGA
|
||||
|
||||
//cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true)
|
||||
//if (cosa.value === shared_consts.PROD.TUTTI)
|
||||
|
||||
|
||||
// Inizializza
|
||||
loadpage.value = true
|
||||
@@ -297,14 +353,16 @@ export default defineComponent({
|
||||
filter.value.author = id
|
||||
}
|
||||
|
||||
function searchval(newval: any, table: any, tablesel: any) {
|
||||
/*function searchval(newval: any, table: any, tablesel: any) {
|
||||
console.log('REFRR searchval', newval, table, 'tablesel', tablesel)
|
||||
if (newval === '') {
|
||||
search.value = ''
|
||||
if (newval) {
|
||||
if (newval.hasOwnProperty('name')) {
|
||||
search.value = newval.name
|
||||
}
|
||||
} else {
|
||||
search.value = newval.name
|
||||
resetSearch()
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
|
||||
// console.log('valoriopt', item.table)
|
||||
@@ -342,10 +400,10 @@ export default defineComponent({
|
||||
selauthor,
|
||||
searchList,
|
||||
fieldsTable,
|
||||
searchval,
|
||||
valoriopt,
|
||||
labelcombo,
|
||||
mycolumns,
|
||||
tabvisu,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,131 +7,25 @@
|
||||
<div v-if="true"></div>
|
||||
|
||||
<div class="container">
|
||||
<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%"
|
||||
>
|
||||
<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 v-if="cosa === shared_consts.PROD.GAS">
|
||||
<div v-if="!idGasSel">
|
||||
<div class="text-center text-h6 text-red">Ordini Attivi:</div>
|
||||
</div>
|
||||
<div class="row q-gutter-xs justify-center q-mx-auto">
|
||||
<div
|
||||
v-for="(recgas, index) in productStore.getGasordinesActives()"
|
||||
:key="index"
|
||||
>
|
||||
<q-btn
|
||||
push
|
||||
dense
|
||||
:size="tools.isMobile() ? '0.9rem' : '1.05rem'"
|
||||
:color="idGasSel === recgas._id ? 'primary' : undefined"
|
||||
:text-color="idGasSel === recgas._id ? 'white' : 'black'"
|
||||
:label="recgas.name"
|
||||
@click="idGasSel = recgas._id"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span
|
||||
v-show="productStore.getNumProdTot() !== arrProducts.length"
|
||||
>{{
|
||||
t('ecomm.prodotti_trovati', {
|
||||
qta: arrProducts.length,
|
||||
qtatot: productStore.getNumProdTot(),
|
||||
})
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
<div class="row justify-around" v-if="tools.isManager()">
|
||||
<q-toggle
|
||||
v-model="show_hide"
|
||||
push
|
||||
label="Mostra Nascosti"
|
||||
rounded
|
||||
glossy
|
||||
toggle-color="primary"
|
||||
></q-toggle>
|
||||
</div>
|
||||
<div class="row justify-around">
|
||||
<q-infinite-scroll
|
||||
v-if="arrLoaded && arrLoaded.length > 0"
|
||||
ref="myinfscroll"
|
||||
:initial-index="0"
|
||||
@load="onLoadScroll"
|
||||
:offset="2000"
|
||||
debounce="200"
|
||||
class="q-pa-xs row items-start"
|
||||
>
|
||||
<div
|
||||
class="q-pa-xs"
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
>
|
||||
<CCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
(show_hide &&
|
||||
productInfo.productType ===
|
||||
shared_consts.PRODUCTTYPE.PRODUCT)
|
||||
"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="product.active || show_hide"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
</div>
|
||||
<template v-slot:loading>
|
||||
<div class="text-center">
|
||||
<q-spinner-dots color="primary" size="40px" />
|
||||
</div>
|
||||
</template>
|
||||
</q-infinite-scroll>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="category-title">Categorie</div>
|
||||
<div class="row q-gutter-xs justify-center q-mx-auto bg-blue-1">
|
||||
<div v-for="(reccat, index) in getCatProds()" :key="index">
|
||||
<span
|
||||
:class="{
|
||||
category: true,
|
||||
category_sel: cat === reccat.value,
|
||||
}"
|
||||
@click="cat = reccat.value"
|
||||
>{{ reccat.label }}
|
||||
</span>
|
||||
|
|
||||
<!--<q-btn
|
||||
<q-tabs v-model="tabvisu" dense class="bg-indigo text-white">
|
||||
<q-tab name="categorie" icon="fas fa-folder-open" label="Categorie" />
|
||||
<q-tab name="autori" icon="fas fa-user" label="Autori" />
|
||||
<q-tab name="ricerca" icon="fas fa-search" label="Cerca" />
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabvisu" animated class="">
|
||||
<q-tab-panel name="categorie">
|
||||
<div class="row q-gutter-xs justify-center q-mx-auto bg-blue-1">
|
||||
<div v-for="(reccat, index) in getCatProds()" :key="index">
|
||||
<span
|
||||
:class="{
|
||||
category: true,
|
||||
category_sel: cat === reccat.value,
|
||||
}"
|
||||
@click="cat = reccat.value"
|
||||
>{{ reccat.label }}
|
||||
</span>
|
||||
|
|
||||
<!--<q-btn
|
||||
:push="cat === reccat.value"
|
||||
dense
|
||||
:size="tools.isMobile() ? '0.70rem' : '1rem'"
|
||||
@@ -143,97 +37,37 @@
|
||||
@click="cat = reccat.value"
|
||||
>
|
||||
</q-btn>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span
|
||||
v-show="productStore.getNumProdTot() !== arrProducts.length"
|
||||
>{{
|
||||
t('ecomm.prodotti_trovati', {
|
||||
qta: arrProducts.length,
|
||||
qtatot: productStore.getNumProdTot(),
|
||||
})
|
||||
}}</span
|
||||
>
|
||||
</div>
|
||||
<div class="row justify-around" v-if="tools.isManager()">
|
||||
<q-toggle
|
||||
v-model="show_hide"
|
||||
push
|
||||
label="Mostra Nascosti"
|
||||
rounded
|
||||
glossy
|
||||
toggle-color="primary"
|
||||
></q-toggle>
|
||||
</div>
|
||||
|
||||
<div class="col" v-for="(item, index) in searchList" :key="index">
|
||||
|
||||
<CMySelect
|
||||
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
|
||||
v-if="
|
||||
item.type === costanti.FieldType.select ||
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:label="
|
||||
item.value && item.value._id > 0 ? undefined : labelcombo(item)
|
||||
"
|
||||
v-model:value="item.value"
|
||||
@update:value="searchval(item.value, item.table, tablesel)"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:addlast="true"
|
||||
:tablesel="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
? item.tablesel
|
||||
: ''
|
||||
"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
:label-color="$q.dark.isActive ? 'white' : 'black'"
|
||||
myclass="comboselector"
|
||||
color="primary"
|
||||
|
||||
:dense="true"
|
||||
:icon_alternative="item.icon"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
:options="valoriopt(item, false)"
|
||||
:filter="item.filter"
|
||||
:filter_extra="item.filter_extra"
|
||||
style="font-size: 0.8rem !important"
|
||||
:useinput="
|
||||
item.useinput &&
|
||||
item.type !== costanti.FieldType.select_by_server
|
||||
"
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
|
||||
<q-toolbar>
|
||||
<q-select
|
||||
class="full-width"
|
||||
v-model="filter.author"
|
||||
:options="optauthors"
|
||||
label="Autore"
|
||||
placeholder="Tutti"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
stack-label
|
||||
filled
|
||||
@filter="filterFn"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter.author !== ''"
|
||||
class="cursor-pointer"
|
||||
name="clear"
|
||||
@click.stop.prevent="filter.author = ''"
|
||||
/> </template
|
||||
></q-select>
|
||||
<!--<q-select
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="autori">
|
||||
<q-toolbar>
|
||||
<q-select
|
||||
class="full-width"
|
||||
v-model="filter.author"
|
||||
:options="optauthors"
|
||||
label="Autore"
|
||||
placeholder="Tutti"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
stack-label
|
||||
use-chips
|
||||
filled
|
||||
rounded
|
||||
@filter="filterFn"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter.author !== ''"
|
||||
class="cursor-pointer"
|
||||
name="clear"
|
||||
@click.stop.prevent="filter.author = ''"
|
||||
/> </template
|
||||
></q-select>
|
||||
<!--<q-select
|
||||
v-model="filter.publisher"
|
||||
:options="publishers"
|
||||
label="Editore"
|
||||
@@ -254,57 +88,121 @@
|
||||
placeholder="Tutte"
|
||||
dense
|
||||
/>-->
|
||||
</q-toolbar>
|
||||
|
||||
<div class="row justify-around">
|
||||
<q-infinite-scroll
|
||||
v-if="arrLoaded && arrLoaded.length > 0"
|
||||
ref="myinfscroll"
|
||||
:initial-index="0"
|
||||
@load="onLoadScroll"
|
||||
:offset="2000"
|
||||
debounce="200"
|
||||
class="q-pa-xs row items-start"
|
||||
style="place-content: center"
|
||||
>
|
||||
<div
|
||||
class="q-pa-xs"
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
</q-toolbar>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="ricerca">
|
||||
<div class="col" v-for="(item, index) in searchList" :key="index">
|
||||
<CMySelect
|
||||
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
|
||||
v-if="
|
||||
item.type === costanti.FieldType.select ||
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:label="
|
||||
item.value && item.value._id > 0
|
||||
? undefined
|
||||
: labelcombo(item)
|
||||
"
|
||||
v-model:value="item.value"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:addlast="true"
|
||||
:tablesel="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
? item.tablesel
|
||||
: ''
|
||||
"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
:label-color="$q.dark.isActive ? 'white' : 'black'"
|
||||
myclass="comboselector"
|
||||
color="primary"
|
||||
:dense="true"
|
||||
:icon_alternative="item.icon"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
:options="valoriopt(item, false)"
|
||||
:filter="item.filter"
|
||||
:filter_extra="item.filter_extra"
|
||||
style="font-size: 0.8rem !important"
|
||||
:useinput="
|
||||
item.useinput &&
|
||||
item.type !== costanti.FieldType.select_by_server
|
||||
"
|
||||
>
|
||||
<CCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
(show_hide &&
|
||||
productInfo.productType ===
|
||||
shared_consts.PRODUCTTYPE.PRODUCT)
|
||||
"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:options="{
|
||||
show_short_descr: false,
|
||||
show_price: false,
|
||||
show_cat: false,
|
||||
quante_col: 'c2',
|
||||
in_3d: false,
|
||||
}"
|
||||
@selauthor="selauthor"
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="product.active || show_hide"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
</CMySelect>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span v-show="productStore.getNumProdTot() !== arrProducts.length">{{
|
||||
t('ecomm.prodotti_trovati', {
|
||||
qta: arrProducts.length,
|
||||
qtatot: productStore.getNumProdTot(),
|
||||
})
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="row justify-around" v-if="tools.isManager() && false">
|
||||
<q-toggle
|
||||
v-model="show_hide"
|
||||
push
|
||||
label="Mostra Nascosti"
|
||||
rounded
|
||||
glossy
|
||||
toggle-color="primary"
|
||||
></q-toggle>
|
||||
</div>
|
||||
|
||||
<div class="row justify-around">
|
||||
<q-infinite-scroll
|
||||
v-if="arrLoaded && arrLoaded.length > 0"
|
||||
ref="myinfscroll"
|
||||
:initial-index="0"
|
||||
@load="onLoadScroll"
|
||||
:offset="2000"
|
||||
debounce="200"
|
||||
class="q-pa-xs row items-start"
|
||||
style="place-content: center"
|
||||
>
|
||||
<div
|
||||
class="q-pa-xs"
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
(show_hide &&
|
||||
productInfo.productTypes.includes(
|
||||
shared_consts.PRODUCTTYPE.PRODUCT
|
||||
))
|
||||
|
||||
"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:optcatalogo="optcatalogo"
|
||||
:options="{
|
||||
show_short_descr: false,
|
||||
show_price: false,
|
||||
show_cat: false,
|
||||
quante_col: 'c2',
|
||||
in_3d: false,
|
||||
}"
|
||||
@selauthor="selauthor"
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="product.active || show_hide"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
</div>
|
||||
<template v-slot:loading>
|
||||
<div class="text-center">
|
||||
<q-spinner-dots color="primary" size="40px" />
|
||||
</div>
|
||||
<template v-slot:loading>
|
||||
<div class="text-center">
|
||||
<q-spinner-dots color="primary" size="40px" />
|
||||
</div>
|
||||
</template>
|
||||
</q-infinite-scroll>
|
||||
</div>
|
||||
</template>
|
||||
</q-infinite-scroll>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,8 @@ import { CMyPage } from '@/components/CMyPage'
|
||||
import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'mypagegood',
|
||||
@@ -19,6 +21,7 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
const idGood = computed(() => $route.params.idGood ? $route.params.idGood.toString() : 0)
|
||||
|
||||
return {
|
||||
@@ -26,6 +29,7 @@ export default defineComponent({
|
||||
idGood,
|
||||
toolsext,
|
||||
tools,
|
||||
shared_consts,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user