other components... (2)
This commit is contained in:
6
src/views/email/unsubscribe/unsubscribe.scss
Executable file
6
src/views/email/unsubscribe/unsubscribe.scss
Executable file
@@ -0,0 +1,6 @@
|
||||
.mypanel {
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
|
||||
76
src/views/email/unsubscribe/unsubscribe.ts
Executable file
76
src/views/email/unsubscribe/unsubscribe.ts
Executable file
@@ -0,0 +1,76 @@
|
||||
import { serv_constants } from '@store/Modules/serv_constants'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
import { 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',
|
||||
props: {
|
||||
mystr: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
myval: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0,
|
||||
},
|
||||
mybool: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const $route = useRoute()
|
||||
|
||||
const risultato = ref('...')
|
||||
const riscode = ref(0)
|
||||
|
||||
function disiscritto() {
|
||||
return riscode.value === serv_constants.RIS_UNSUBSCRIBED_OK
|
||||
}
|
||||
|
||||
function errore() {
|
||||
return riscode.value !== serv_constants.RIS_UNSUBSCRIBED_OK
|
||||
}
|
||||
|
||||
function email() {
|
||||
return $route.query.email
|
||||
}
|
||||
|
||||
function load() {
|
||||
// console.log('load')
|
||||
let param
|
||||
param = { em: $route.query.em, mc: $route.query.mc, locale: tools.getLocale() }
|
||||
console.log('idlink = ', param)
|
||||
return userStore.unsubscribe(param)
|
||||
.then((ris: any) => {
|
||||
riscode.value = ris.code
|
||||
risultato.value = ris.msg
|
||||
|
||||
}).catch((err) => {
|
||||
console.log('ERR = ' + err)
|
||||
})
|
||||
}
|
||||
|
||||
load()
|
||||
|
||||
return {
|
||||
disiscritto,
|
||||
errore,
|
||||
email,
|
||||
risultato,
|
||||
}
|
||||
}
|
||||
})
|
||||
48
src/views/email/unsubscribe/unsubscribe.vue
Executable file
48
src/views/email/unsubscribe/unsubscribe.vue
Executable file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<q-page 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
|
||||
|
||||
>
|
||||
|
||||
<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>
|
||||
</transition>
|
||||
|
||||
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./unsubscribe.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './unsubscribe.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user