- aggiornato sistema per inviare le newsletter !
This commit is contained in:
@@ -263,6 +263,7 @@ export default defineComponent({
|
||||
endload,
|
||||
search,
|
||||
insertArticolo,
|
||||
globalStore,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,8 +5,16 @@
|
||||
<div v-if="recOrderCart" class="panel">
|
||||
<div>
|
||||
<div class="container">
|
||||
<div class="q-pa-sm col items-start q-gutter-xs" v-for="(itemorder, index) in getItemsCart()" :key="index">
|
||||
<CSingleCart :order="itemorder.order" :idOrdersCart="recOrderCart._id" :showall="true" />
|
||||
<div
|
||||
class="q-pa-sm col items-start q-gutter-xs"
|
||||
v-for="(itemorder, index) in getItemsCart()"
|
||||
:key="index"
|
||||
>
|
||||
<CSingleCart
|
||||
:order="itemorder.order"
|
||||
:idOrdersCart="recOrderCart._id"
|
||||
:showall="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
@@ -15,30 +23,71 @@
|
||||
<span class="text-subtitle1 q-mr-sm">€ {{ myTotalPrice() }}</span>
|
||||
</div>
|
||||
|
||||
<q-input v-if="getNumItems() > 0" v-model="note" style="max-width: 400px" :label="$t('ecomm.note')" filled dense
|
||||
debounce="1000" autogrow @input="change_field('note')">
|
||||
<q-input
|
||||
v-if="getNumItems() > 0"
|
||||
v-model="note"
|
||||
style="max-width: 400px"
|
||||
:label="$t('ecomm.note')"
|
||||
filled
|
||||
dense
|
||||
debounce="1000"
|
||||
autogrow
|
||||
@input="change_field('note')"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
</div>
|
||||
<div class="center-text">
|
||||
<br />
|
||||
|
||||
<div
|
||||
class="q-ma-sm q-pa-sm text-h7"
|
||||
v-if="globalStore && globalStore.site.ecomm.NoteExtraOnCart"
|
||||
>
|
||||
{{ globalStore.site.ecomm.NoteExtraOnCart }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<q-btn v-if="recOrderCart &&
|
||||
recOrderCart.status < shared_consts.OrderStatus.CHECKOUT_SENT
|
||||
" rounded icon="fas fa-shopping-cart" color="green" :label="$t('ecomm.completa_ord')" class="q-mb-sm"
|
||||
:disabled="myTotalQty() < 1" @click="completeOrder()"></q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
recOrderCart &&
|
||||
recOrderCart.status < shared_consts.OrderStatus.CHECKOUT_SENT
|
||||
"
|
||||
rounded
|
||||
icon="fas fa-shopping-cart"
|
||||
color="green"
|
||||
:label="$t('ecomm.completa_ord')"
|
||||
class="q-mb-sm"
|
||||
:disabled="myTotalQty() < 1"
|
||||
@click="completeOrder()"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="text-align: center" class="text-grey">
|
||||
{{ $t('ecomm.carrello_vuoto') }}
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="q-gutter-y-md column text-center q-mx-auto" style="width: 350px; max-width: 100%">
|
||||
<q-input filled stack-label dense :label="$t('ecomm.code_add_to_cart')" v-model="search" class="q-ml-md"
|
||||
@keyup.enter="insertArticolo()">
|
||||
<br />
|
||||
<div
|
||||
class="q-gutter-y-md column text-center q-mx-auto"
|
||||
style="width: 350px; max-width: 100%"
|
||||
>
|
||||
<q-input
|
||||
filled
|
||||
stack-label
|
||||
dense
|
||||
:label="$t('ecomm.code_add_to_cart')"
|
||||
v-model="search"
|
||||
class="q-ml-md"
|
||||
@keyup.enter="insertArticolo()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon class="insert" name="fas fa-shopping-cart" color="green" @click="insertArticolo()" />
|
||||
<q-icon
|
||||
class="insert"
|
||||
name="fas fa-shopping-cart"
|
||||
color="green"
|
||||
@click="insertArticolo()"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import { Chart, ChartItem, ChartConfiguration } from 'chart.js'
|
||||
import { Chart, BarController, BarElement, LineController, LinearScale, CategoryScale, PointElement, LineElement, Title, ChartItem, ChartConfiguration } from 'chart.js';
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -68,6 +68,9 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
Chart.register(BarController, BarElement,
|
||||
LineController, LinearScale, CategoryScale, PointElement, LineElement, Title);
|
||||
|
||||
myarrdata.value = []
|
||||
myarrdataLine.value = []
|
||||
myarrbg.value = []
|
||||
@@ -173,7 +176,7 @@ export default defineComponent({
|
||||
fill: true,
|
||||
}
|
||||
|
||||
if (props.showMedia)
|
||||
if (props.showMedia && myarrdataLine.value)
|
||||
chartData.datasets.push(media)
|
||||
|
||||
const configBar: ChartConfiguration = {
|
||||
|
||||
@@ -49,7 +49,7 @@ export default defineComponent({
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb },
|
||||
components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp },
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -832,7 +832,6 @@
|
||||
</CMyValueDb>
|
||||
</q-card>
|
||||
|
||||
|
||||
<q-dialog v-if="myproduct" v-model="openlistorders">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
@@ -916,34 +915,68 @@
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-if="myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda" v-model="apriSchedaPDF" maximized>
|
||||
<q-card>
|
||||
<q-dialog
|
||||
v-if="true &&
|
||||
myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda
|
||||
"
|
||||
v-model="apriSchedaPDF"
|
||||
maximized
|
||||
>
|
||||
<q-card>
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ myproduct.productInfo.name }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" label="CHIUDI" icon="close" v-close-popup></q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
label="CHIUDI"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-main>
|
||||
<iframe :src="myproduct.productInfo.link_scheda" frameborder="0" width="100%" height="100%"></iframe>
|
||||
</q-card-main>
|
||||
<q-card-section>
|
||||
<iframe
|
||||
:src="myproduct.productInfo.link_scheda"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
></iframe>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<q-card-actions align="bottom">
|
||||
<q-btn color="primary" label="Chiudi" @click="apriSchedaPDF = false" />
|
||||
</q-card-actions>
|
||||
</q-dialog>
|
||||
|
||||
<!--
|
||||
<q-dialog v-if="myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda" v-model="apriSchedaPDF" fullscreen>
|
||||
<div class="q-pa-md">
|
||||
<vue-pdf-app style="height: 100vh;" :pdf="myproduct.productInfo.link_scheda"></vue-pdf-app>
|
||||
|
||||
</div>
|
||||
<q-card-actions align="bottom">
|
||||
<q-btn color="primary" label="Chiudi" @click="apriSchedaPDF = false" />
|
||||
</q-card-actions>
|
||||
<q-dialog
|
||||
v-if="false &&
|
||||
myproduct && myproduct.productInfo && myproduct.productInfo.link_scheda
|
||||
"
|
||||
v-model="apriSchedaPDF"
|
||||
fullscreen
|
||||
>
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ myproduct.productInfo.name }}
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
label="CHIUDI"
|
||||
icon="close"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section>
|
||||
<vue-pdf-app
|
||||
:pdf="myproduct.productInfo.link_scheda"
|
||||
style="height: 100vh;"
|
||||
></vue-pdf-app>
|
||||
</q-card-section>
|
||||
</q-dialog>
|
||||
-->
|
||||
|
||||
<q-dialog
|
||||
v-model="isFullScreen"
|
||||
|
||||
@@ -26,6 +26,7 @@ const msg_website_it = {
|
||||
fundraising: 'Sostieni il Progetto',
|
||||
notifs: 'Configura le Notifiche',
|
||||
unsubscribe: 'Disiscriviti',
|
||||
unsubscribe_user: 'Disiscriviti User',
|
||||
test: 'Test',
|
||||
projects: 'Progetti',
|
||||
report: 'Report Ore',
|
||||
|
||||
@@ -291,6 +291,7 @@ export interface IPolicy {
|
||||
|
||||
export interface IECommSettings {
|
||||
enablePreOrders: boolean
|
||||
NoteExtraOnCart: string
|
||||
}
|
||||
|
||||
export interface ISites {
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
imgbackground="images/calendario_eventi.jpg"
|
||||
sizes="max-height: 120px"
|
||||
>
|
||||
<q-toggle
|
||||
v-model="globalStore.editOn"
|
||||
color="green"
|
||||
icon="fas fa-pencil-alt"
|
||||
dense
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<q-card>
|
||||
<div v-show="false">
|
||||
<q-tabs
|
||||
@@ -245,12 +253,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="
|
||||
q-ma-xs q-pa-sm
|
||||
text-center
|
||||
rounded-borders
|
||||
q-list--bordered
|
||||
"
|
||||
class="q-ma-xs q-pa-sm text-center rounded-borders q-list--bordered"
|
||||
>
|
||||
<CTitleBanner title="Invia Newsletter:"></CTitleBanner>
|
||||
|
||||
@@ -325,12 +328,7 @@
|
||||
|
||||
<div
|
||||
v-if="newsstate.nextnewstosent"
|
||||
class="
|
||||
q-ma-md q-pa-sm
|
||||
text-center
|
||||
rounded-borders
|
||||
q-list--bordered
|
||||
"
|
||||
class="q-ma-md q-pa-sm text-center rounded-borders q-list--bordered"
|
||||
>
|
||||
<q-card class="bg-grey-3 relative-position card-example">
|
||||
<q-card-section>
|
||||
@@ -497,12 +495,7 @@
|
||||
|
||||
<div
|
||||
v-if="newsstate.lastnewstosent"
|
||||
class="
|
||||
q-ma-md q-pa-sm
|
||||
text-center
|
||||
rounded-borders
|
||||
q-list--bordered
|
||||
"
|
||||
class="q-ma-md q-pa-sm text-center rounded-borders q-list--bordered"
|
||||
>
|
||||
<q-card class="bg-grey-3 relative-position card-example">
|
||||
<q-card-section>
|
||||
@@ -730,12 +723,7 @@
|
||||
></CTitleBanner>
|
||||
|
||||
<div
|
||||
class="
|
||||
q-ma-md q-pa-sm
|
||||
text-center
|
||||
rounded-borders
|
||||
q-list--bordered
|
||||
"
|
||||
class="q-ma-md q-pa-sm text-center rounded-borders q-list--bordered"
|
||||
>
|
||||
<q-chip
|
||||
dense
|
||||
@@ -794,12 +782,7 @@
|
||||
|
||||
<CTitleBanner title="Importa lista di Email:"></CTitleBanner>
|
||||
<div
|
||||
class="
|
||||
q-ma-md q-pa-sm
|
||||
text-center
|
||||
rounded-borders
|
||||
q-list--bordered
|
||||
"
|
||||
class="q-ma-md q-pa-sm text-center rounded-borders q-list--bordered"
|
||||
>
|
||||
<q-input
|
||||
v-model="mailinglist_imported"
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
<div>
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<div v-if="mysite">
|
||||
<q-toggle
|
||||
v-model="globalStore.editOn"
|
||||
color="green"
|
||||
icon="fas fa-pencil-alt"
|
||||
dense
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<CTitleBanner title="Impostazioni"></CTitleBanner>
|
||||
<CMyFieldDb
|
||||
title="Attiva PreOrdini"
|
||||
@@ -23,6 +31,16 @@
|
||||
:type="costanti.FieldType.boolean"
|
||||
>
|
||||
</CMyFieldDb>
|
||||
<CMyFieldDb
|
||||
title="Note Extra sul Carrello"
|
||||
table="sites"
|
||||
mykey="ecomm"
|
||||
mysubkey="NoteExtraOnCart"
|
||||
:id="mysite._id"
|
||||
:rec="mysite"
|
||||
:type="costanti.FieldType.string"
|
||||
>
|
||||
</CMyFieldDb>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -444,6 +444,16 @@ function getRoutesAd(site: ISites) {
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 200,
|
||||
path: '/unsubscribe_user',
|
||||
materialIcon: 'fas fa-envelope',
|
||||
name: 'pages.unsubscribe_user',
|
||||
component: () => import('@/views/unsubscribe_user/unsubscribe_user.vue'),
|
||||
inmenu: false,
|
||||
infooter: false,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 15,
|
||||
|
||||
@@ -16,18 +16,6 @@ function getRoutesEcomm(site: ISites) {
|
||||
level_parent: 0,
|
||||
level_child: 0.5,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 30,
|
||||
path: '/catalogo',
|
||||
materialIcon: 'fas fa-lemon',
|
||||
name: 'pages.catalogo',
|
||||
component: () => import('@/views/ecommerce/catalogo/catalogo.vue'),
|
||||
inmenu: true,
|
||||
submenu: true,
|
||||
level_parent: 0,
|
||||
level_child: 0.5,
|
||||
},
|
||||
{
|
||||
active: true,
|
||||
order: 30,
|
||||
|
||||
@@ -422,8 +422,8 @@ const msg_de = {
|
||||
finish_job: 'Sent terminated',
|
||||
processing_job: 'Work in progress',
|
||||
error_job: 'Info Error',
|
||||
statesub: 'Subscribed',
|
||||
wrongerr: 'Invalid Email',
|
||||
news_on: 'Subscribed',
|
||||
email_errata: 'Invalid Email',
|
||||
},
|
||||
privacy_policy: 'Privacy Policy',
|
||||
cookies: 'Wir verwenden Cookies für eine bessere Webleistung.',
|
||||
|
||||
@@ -799,8 +799,8 @@ const msg_enUs = {
|
||||
finish_job: 'Work in progress',
|
||||
processing_job: 'Lavoro in corso',
|
||||
error_job: 'Info Error',
|
||||
statesub: 'Subscribed',
|
||||
wrongerr: 'Invalid Email',
|
||||
news_on: 'Subscribed',
|
||||
email_errata: 'Invalid Email',
|
||||
},
|
||||
privacy_policy: 'Privacy Policy',
|
||||
cookies: 'Usiamo i Cookie per una migliore prestazione web.',
|
||||
|
||||
@@ -724,8 +724,8 @@ const msg_es = {
|
||||
finish_job: 'Envio terminado',
|
||||
processing_job: 'En curso',
|
||||
error_job: 'Info Error',
|
||||
statesub: 'Subscribir',
|
||||
wrongerr: 'Email invalide',
|
||||
news_on: 'Subscribir',
|
||||
email_errata: 'Email invalide',
|
||||
},
|
||||
privacy_policy: 'Privacy Policy',
|
||||
cookies: 'Usiamo i Cookie per una migliore prestazione web.',
|
||||
|
||||
@@ -624,8 +624,8 @@ const msg_fr = {
|
||||
finish_job: 'Envoy Terminé',
|
||||
processing_job: 'travaux en cours',
|
||||
error_job: 'info d\'erreur',
|
||||
statesub: 'Abonné',
|
||||
wrongerr: 'Email inválido',
|
||||
news_on: 'Abonné',
|
||||
email_errata: 'Email inválido',
|
||||
},
|
||||
privacy_policy: 'Politique de confidentialité',
|
||||
cookies: 'Nous utilisons des cookies pour améliorer les performances Web.',
|
||||
|
||||
@@ -1080,8 +1080,8 @@ const msg_it = {
|
||||
finish_job: 'Invio Terminato',
|
||||
processing_job: 'Lavoro in corso',
|
||||
error_job: 'Info Errori',
|
||||
statesub: 'Sottoscritto',
|
||||
wrongerr: 'Email non valida',
|
||||
news_on: 'Sottoscritto',
|
||||
email_errata: 'Email non valida',
|
||||
},
|
||||
privacy_policy: 'Privacy Policy',
|
||||
cookies: 'Usiamo i Cookie per una migliore prestazione web. Accetti l\'utilizzo? (Consigliato ACCETTA)',
|
||||
|
||||
@@ -636,8 +636,8 @@ const msg_pt = {
|
||||
finish_job: 'Invio Terminato',
|
||||
processing_job: 'Lavoro in corso',
|
||||
error_job: 'Info Errori',
|
||||
statesub: 'Sottoscritto',
|
||||
wrongerr: 'Email non valida',
|
||||
news_on: 'Sottoscritto',
|
||||
email_errata: 'Email non valida',
|
||||
},
|
||||
privacy_policy: 'Política de Privacidade',
|
||||
cookies: 'Nós usamos Cookies para um melhor desempenho na web.',
|
||||
|
||||
@@ -107,8 +107,8 @@ export const colmailinglist = [
|
||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||
AddCol({ name: 'statesub', label_trans: 'newsletter.statesub', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'wrongerr', label_trans: 'newsletter.wrongerr', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'news_on', label_trans: 'newsletter.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'newsletter.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
AddCol(DeleteRec),
|
||||
]
|
||||
@@ -2668,6 +2668,9 @@ export const colTableUsers = [
|
||||
AddCol({ name: 'note', label_trans: 'reg.note' }),
|
||||
// AddCol({ name: 'aportador_solidario_ind_order', label_trans: 'reg.aportador_solidario_ind_order' }),
|
||||
// AddCol({ name: 'aportador_solidario_nome_completo', label_trans: 'reg.aportador_solidario_nome_completo' }),
|
||||
AddCol({ name: 'news_on', label_trans: 'reg.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'reg.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
|
||||
AddCol({
|
||||
name: 'profile.special_req',
|
||||
@@ -2945,6 +2948,11 @@ export const colTableUsersISP = [
|
||||
label_trans: 'reg.notAsk_ToVerify',
|
||||
fieldtype: costanti.FieldType.boolean
|
||||
}),
|
||||
|
||||
AddCol({ name: 'news_on', label_trans: 'reg.news_on', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'email_errata', label_trans: 'reg.email_errata', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: costanti.FieldType.string }),
|
||||
|
||||
AddCol({ name: 'trust_modified', label_trans: 'reg.trust_modified', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({ name: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
|
||||
|
||||
@@ -929,6 +929,18 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}).catch((error) => this.getServerCode)
|
||||
},
|
||||
|
||||
async unsubscribe_news_on_fielduser(paramquery: any) {
|
||||
return Api.SendReq('/news/unsubscribe_user', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
if (res.data.code === serv_constants.RIS_UNSUBSCRIBED_OK) {
|
||||
console.log('DESOTTOSCRITTO ALLA NEWSLETTER !!')
|
||||
} else {
|
||||
console.log('Risultato di unsubscribe: ', res.data.code)
|
||||
}
|
||||
return { code: res.data.code, msg: res.data.msg }
|
||||
}).catch((error) => this.getServerCode)
|
||||
},
|
||||
|
||||
async importemail(paramquery: any) {
|
||||
return Api.SendReq('/news/import', 'POST', paramquery)
|
||||
.then((res) => res).catch((error) => ({ numtot: 0, numadded: 0, numalreadyexisted: 0 }))
|
||||
|
||||
@@ -634,6 +634,14 @@
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="AbilitaNewsletterALL"
|
||||
color="primary"
|
||||
@click="EseguiFunz('AbilitaNewsletterALL')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./dbop.ts">
|
||||
</script>
|
||||
|
||||
@@ -38,7 +38,10 @@ export default defineComponent({
|
||||
// console.log('load')
|
||||
param.value = { em: $route.query.em, mc: $route.query.mc, locale: tools.getLocale() }
|
||||
console.log('idlink = ', param.value)
|
||||
return userStore.unsubscribe(param.value)
|
||||
const vecchio_sistema = false;
|
||||
let ris = null;
|
||||
ris = userStore.unsubscribe(param.value)
|
||||
return ris
|
||||
.then((ris: any) => {
|
||||
riscode.value = ris.code
|
||||
risultato.value = ris.msg
|
||||
|
||||
6
src/views/unsubscribe_user/unsubscribe_user.scss
Executable file
6
src/views/unsubscribe_user/unsubscribe_user.scss
Executable file
@@ -0,0 +1,6 @@
|
||||
.mypanel {
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
|
||||
63
src/views/unsubscribe_user/unsubscribe_user.ts
Executable file
63
src/views/unsubscribe_user/unsubscribe_user.ts
Executable file
@@ -0,0 +1,63 @@
|
||||
import { serv_constants } from '@store/Modules/serv_constants'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
import { computed, defineComponent, ref } from 'vue'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'unsubscribe_user',
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const $route = useRoute()
|
||||
|
||||
const risultato = ref('...')
|
||||
const riscode = ref(0)
|
||||
const param = ref(<any>null)
|
||||
|
||||
const disiscritto = computed(() => {
|
||||
return riscode.value === serv_constants.RIS_UNSUBSCRIBED_OK
|
||||
})
|
||||
|
||||
const errore = computed(() => {
|
||||
return riscode.value !== serv_constants.RIS_UNSUBSCRIBED_OK
|
||||
})
|
||||
|
||||
const email = computed(() => {
|
||||
return $route.query.email
|
||||
})
|
||||
|
||||
function load() {
|
||||
// console.log('load')
|
||||
param.value = { em: $route.query.em, mc: $route.query.mc, locale: tools.getLocale(), email: $route.query.email }
|
||||
console.log('idlink = ', param.value)
|
||||
let ris = null;
|
||||
ris = userStore.unsubscribe_news_on_fielduser(param.value)
|
||||
return ris
|
||||
.then((ris: any) => {
|
||||
riscode.value = ris.code
|
||||
risultato.value = ris.msg
|
||||
|
||||
}).catch((err: any) => {
|
||||
console.log('ERR = ' + err)
|
||||
})
|
||||
}
|
||||
|
||||
load()
|
||||
|
||||
return {
|
||||
disiscritto,
|
||||
errore,
|
||||
email,
|
||||
risultato,
|
||||
param,
|
||||
}
|
||||
}
|
||||
})
|
||||
57
src/views/unsubscribe_user/unsubscribe_user.vue
Executable file
57
src/views/unsubscribe_user/unsubscribe_user.vue
Executable file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<q-page v-if="param && param.em" padding class="vreg">
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-primary text-white"
|
||||
color="primary q-title"
|
||||
style="text-align: center"
|
||||
>
|
||||
<span class="mybanner"
|
||||
>{{
|
||||
$t(
|
||||
'components.authentication.email_verification.title_unsubscribe'
|
||||
)
|
||||
}}: {{ email }}</span
|
||||
>
|
||||
</q-banner>
|
||||
<br />
|
||||
|
||||
<transition
|
||||
enter-active-class="animated fadeIn"
|
||||
leave-active-class="animated fadeOut"
|
||||
appear
|
||||
>
|
||||
<div>
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-warning text-black"
|
||||
style="text-align: center"
|
||||
v-if="errore"
|
||||
>
|
||||
<span class="mybanner">{{ risultato }}</span>
|
||||
</q-banner>
|
||||
<q-banner
|
||||
class="bg-positive text-white"
|
||||
style="text-align: center"
|
||||
rounded
|
||||
v-if="disiscritto"
|
||||
>
|
||||
<span class="mybanner">{{
|
||||
$t(
|
||||
'components.authentication.email_verification.title_unsubscribe_done'
|
||||
)
|
||||
}}</span>
|
||||
</q-banner>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./unsubscribe_user.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './unsubscribe_user.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user