- Fix: setlang
- Completed work: page '/vref' (Verify registration) OK
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
<template>
|
||||
<div class="mypanel">
|
||||
<q-alert color="primary q-title" style="text-align: center;">
|
||||
{{ $t('reg.title_verif_reg')}}
|
||||
</q-alert>
|
||||
<br>
|
||||
|
||||
<transition
|
||||
enter-active-class="animated flipInX"
|
||||
leave-active-class="animated flipOutX"
|
||||
appear
|
||||
>
|
||||
<q-alert
|
||||
v-if="giaverificato"
|
||||
type="warning"
|
||||
>
|
||||
{{ risultato}}
|
||||
</q-alert>
|
||||
<q-alert
|
||||
v-if="verificatook"
|
||||
type="positive"
|
||||
>
|
||||
{{ risultato}}
|
||||
</q-alert>
|
||||
</transition>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {mapActions} from 'vuex'
|
||||
import * as types from '../../store/mutation-types'
|
||||
import { rescodes } from '../../../store/Modules/rescodes'
|
||||
|
||||
import {serv_constants} from '../../store/Modules/serv_constants';
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
risultato : '',
|
||||
riscode: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.load();
|
||||
},
|
||||
computed:{
|
||||
giaverificato: function() {
|
||||
return this.riscode !== serv_constants.RIS_CODE_EMAIL_VERIFIED
|
||||
},
|
||||
verificatook: function() {
|
||||
return this.riscode === serv_constants.RIS_CODE_EMAIL_VERIFIED
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions("user", {
|
||||
verifreg: types.USER_VREG,
|
||||
}),
|
||||
load: function () {
|
||||
this.verifreg(this.$route.query).then((ris) => {
|
||||
this.riscode = ris.code;
|
||||
this.risultato = ris.msg;
|
||||
console.log("RIS = ");
|
||||
console.log(ris);
|
||||
|
||||
if (this.verificatook) {
|
||||
setTimeout(() => {
|
||||
this.$router.replace('/');
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.log("ERR = " + err);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mypanel {
|
||||
padding:10px;
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
</style>
|
||||
5
src/views/login/vreg/vreg.css
Normal file
5
src/views/login/vreg/vreg.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.mypanel {
|
||||
padding:10px;
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
62
src/views/login/vreg/vreg.ts
Normal file
62
src/views/login/vreg/vreg.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import Vue from 'vue'
|
||||
import { Component } from 'vue-property-decorator' // Questo va messo SEMPRE ! (ed anche $t ....) altrimenti non carica !
|
||||
|
||||
import { UserStore } from '@store'
|
||||
|
||||
import { serv_constants } from '../../../store/Modules/serv_constants'
|
||||
|
||||
import './vreg.css'
|
||||
import { ILinkReg } from '../../../model/other'
|
||||
|
||||
@Component({
|
||||
|
||||
})
|
||||
export default class Vreg extends Vue {
|
||||
public risultato: string = '---'
|
||||
public riscode: number = 0
|
||||
$t: any
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
console.log('Vreg constructor...')
|
||||
}
|
||||
|
||||
created() {
|
||||
console.log('vreg created')
|
||||
this.load()
|
||||
}
|
||||
|
||||
get myrisultato() {
|
||||
return this.risultato
|
||||
}
|
||||
|
||||
get giaverificato() {
|
||||
return this.riscode !== serv_constants.RIS_CODE_EMAIL_VERIFIED
|
||||
}
|
||||
|
||||
get verificatook() {
|
||||
return this.riscode === serv_constants.RIS_CODE_EMAIL_VERIFIED
|
||||
}
|
||||
|
||||
load() {
|
||||
console.log('load')
|
||||
let param: ILinkReg
|
||||
param = { idlink: this.$route.query.idlink.toString() }
|
||||
console.log('idlink = ', param)
|
||||
UserStore.actions.vreg(param).then((ris) => {
|
||||
this.riscode = ris.code
|
||||
this.risultato = ris.msg
|
||||
console.log('RIS = ')
|
||||
console.log(ris)
|
||||
|
||||
if (this.verificatook) {
|
||||
setTimeout(() => {
|
||||
this.$router.replace('/')
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.log('ERR = ' + err)
|
||||
})
|
||||
}
|
||||
}
|
||||
36
src/views/login/vreg/vreg.vue
Normal file
36
src/views/login/vreg/vreg.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<q-page padding class="vreg">
|
||||
<div class="mypanel">
|
||||
<q-alert color="primary q-title" style="text-align: center;">
|
||||
{{ $t('reg.title_verif_reg')}}
|
||||
</q-alert>
|
||||
<br>
|
||||
|
||||
<transition
|
||||
enter-active-class="animated flipInX"
|
||||
leave-active-class="animated flipOutX"
|
||||
appear
|
||||
>
|
||||
<span>
|
||||
<q-alert
|
||||
v-if="giaverificato"
|
||||
type="warning"
|
||||
>
|
||||
{{ myrisultato}}
|
||||
</q-alert>
|
||||
<q-alert
|
||||
v-if="verificatook"
|
||||
type="positive"
|
||||
>
|
||||
{{ myrisultato}}
|
||||
</q-alert>
|
||||
</span>
|
||||
</transition>
|
||||
|
||||
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./vreg.ts">
|
||||
</script>
|
||||
Reference in New Issue
Block a user