- Downline User
- Not registered if already exists. - Forgot Password
This commit is contained in:
5
src/boot/googlemap.ts
Normal file
5
src/boot/googlemap.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import google from '../googlemap'
|
||||
|
||||
export default ({ app, router, Vue }) => {
|
||||
Vue.prototype.$google = google
|
||||
}
|
||||
5
src/boot/mycharts.ts
Normal file
5
src/boot/mycharts.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import Chartkick from 'vue-chartkick'
|
||||
|
||||
export default async ({ Vue }) => {
|
||||
Vue.use(Chartkick)
|
||||
}
|
||||
7
src/boot/vuetelinput.ts
Normal file
7
src/boot/vuetelinput.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import VueTelInput from 'vue-tel-input'
|
||||
|
||||
// "async" is optional
|
||||
export default async ({ Vue }) => {
|
||||
// something to do
|
||||
Vue.use(VueTelInput)
|
||||
}
|
||||
0
src/components/CMyDashboard/CMyDashboard.scss
Normal file
0
src/components/CMyDashboard/CMyDashboard.scss
Normal file
73
src/components/CMyDashboard/CMyDashboard.ts
Normal file
73
src/components/CMyDashboard/CMyDashboard.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
|
||||
import { UserStore } from '../../store/Modules'
|
||||
import { DefaultUser } from '@src/store/Modules/UserStore'
|
||||
|
||||
import MixinUsers from '../../mixins/mixin-users'
|
||||
import { CProfile } from '../CProfile'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CMyFieldDb } from '../CMyFieldDb'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
import { CUserBadge } from '../CUserBadge'
|
||||
|
||||
@Component({
|
||||
components: { CProfile, CTitleBanner, CMyFieldDb, CCopyBtn, CUserBadge }
|
||||
})
|
||||
|
||||
export default class CMyDashboard extends MixinUsers {
|
||||
@Prop({ required: true }) public username
|
||||
|
||||
public $v
|
||||
public $q
|
||||
public dashboard = { aportador: DefaultUser, numpeople_aportador: 0, downline: [], downbyuser: [] }
|
||||
|
||||
public mythis() {
|
||||
return this
|
||||
}
|
||||
|
||||
public created() {
|
||||
this.update_username()
|
||||
}
|
||||
|
||||
@Watch('this.username')
|
||||
public changeusername() {
|
||||
this.update_username()
|
||||
|
||||
}
|
||||
public update_username() {
|
||||
if (this.username === '')
|
||||
this.username = this.getMyUsername()
|
||||
|
||||
UserStore.actions.getDashboard({ username: this.username }).then((ris) => {
|
||||
// console.log('getDashboard', ris)
|
||||
if (ris.aportador === undefined) {
|
||||
this.dashboard.aportador = DefaultUser
|
||||
} else {
|
||||
this.dashboard.aportador = ris.aportador
|
||||
}
|
||||
if (ris.numpeople_aportador === undefined) {
|
||||
this.dashboard.numpeople_aportador = 0
|
||||
} else {
|
||||
this.dashboard.numpeople_aportador = ris.numpeople_aportador
|
||||
}
|
||||
if (ris.downline === undefined) {
|
||||
this.dashboard.downline = []
|
||||
} else {
|
||||
this.dashboard.downline = ris.downline
|
||||
}
|
||||
|
||||
if (ris.downbyuser === undefined) {
|
||||
this.dashboard.downbyuser = []
|
||||
} else {
|
||||
this.dashboard.downbyuser = ris.downbyuser
|
||||
}
|
||||
|
||||
// console.log('this.dashboard', this.dashboard)
|
||||
})
|
||||
}
|
||||
|
||||
get getRefLink() {
|
||||
return UserStore.getters.getRefLink(this.username)
|
||||
}
|
||||
|
||||
}
|
||||
70
src/components/CMyDashboard/CMyDashboard.vue
Normal file
70
src/components/CMyDashboard/CMyDashboard.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="q-ma-xs q-gutter-xs q-pa-xs" v-if="username !== ''">
|
||||
<CTitleBanner class="q-pa-xs" :title="$t('pages.dashboard') +` (`+ username + `)`" bgcolor="bg-info" clcolor="text-white"
|
||||
mystyle=" " myclass="myshad">
|
||||
|
||||
<CCopyBtn :title="$t('reg.reflink')" :texttocopy="getRefLink">
|
||||
|
||||
</CCopyBtn>
|
||||
|
||||
<CTitleBanner class="shadow-2" :title="$t('reg.aportador_solidario')" bgcolor="bg-accent"
|
||||
clcolor="text-white"
|
||||
mystyle=" " myclass="myshad" :canopen="true">
|
||||
|
||||
<CUserBadge v-if="!!dashboard.aportador.name" :user="dashboard.aportador" :index="0" :numpeople="dashboard.numpeople_aportador"
|
||||
mycolor="accent">
|
||||
|
||||
</CUserBadge>
|
||||
<div v-else class="q-pa-sm text-center">
|
||||
Nessun Invitante
|
||||
</div>
|
||||
</CTitleBanner>
|
||||
|
||||
<CTitleBanner class="shadow-2 rounded-borders" :title="$t('dashboard.downline')" bgcolor="bg-positive"
|
||||
clcolor="text-white"
|
||||
mystyle=" " myclass="myshad" :canopen="true">
|
||||
|
||||
<q-list bordered v-if="!!dashboard.downline && dashboard.downline.length > 0" class="rounded-borders">
|
||||
<div v-for="(user, index) in dashboard.downline" :key="index">
|
||||
<CUserBadge :yourinvite="true" :user="user" mycolor="primary" :index="index" :numpeople="dashboard.downbyuser[user.username].length">
|
||||
|
||||
</CUserBadge>
|
||||
<div style="margin-left:10px;" v-for="(user2, index2) in dashboard.downbyuser[user.username]" :key="index2">
|
||||
<CUserBadge :yourinvite="false" :user="user2" mycolor="orange" :index="index2" :numpeople="dashboard.downbyuser[user2.username].length">
|
||||
|
||||
</CUserBadge>
|
||||
</div>
|
||||
</div>
|
||||
</q-list>
|
||||
<div v-else class="q-pa-sm text-center">
|
||||
Nessun Invitato
|
||||
</div>
|
||||
</CTitleBanner>
|
||||
|
||||
</CTitleBanner>
|
||||
|
||||
<!--
|
||||
<CTitleBanner class="q-pa-xs" :title="$t('text.dashboard.madegift')" bgcolor="bg-info" clcolor="text-white"
|
||||
mystyle=" " myclass="myshad">
|
||||
<div class="q-pa-sm text-center">
|
||||
|
||||
<div v-if="madegift" class="q-gutter-md">
|
||||
<q-icon name="fas fa-gift" size="lg" color="green"></q-icon>
|
||||
<q-icon name="fas fa-thumbs-up" size="lg" color="green"></q-icon>
|
||||
</div>
|
||||
<div v-else class="q-gutter-md">
|
||||
<q-icon name="fas fa-gift" size="lg" color="grey"></q-icon>
|
||||
<q-icon name="fas fa-exclamation-triangle" size="lg" color="orange"></q-icon>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</CTitleBanner>
|
||||
-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyDashboard.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyDashboard.scss';
|
||||
</style>
|
||||
1
src/components/CMyDashboard/index.ts
Normal file
1
src/components/CMyDashboard/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {default as CMyDashboard} from './CMyDashboard.vue'
|
||||
14
src/components/CRequisiti/CRequisiti.scss
Normal file
14
src/components/CRequisiti/CRequisiti.scss
Normal file
@@ -0,0 +1,14 @@
|
||||
.requisiti_on, .requisiti_off{
|
||||
margin: 4px;
|
||||
border-radius: 3rem;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.requisiti_on {
|
||||
border: solid 3px #49b502;
|
||||
}
|
||||
|
||||
.requisiti_off {
|
||||
border: solid 3px #ef0901;
|
||||
}
|
||||
|
||||
19
src/components/CRequisiti/CRequisiti.ts
Normal file
19
src/components/CRequisiti/CRequisiti.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
|
||||
@Component({})
|
||||
|
||||
export default class CRequisiti extends Vue {
|
||||
@Prop({ required: true }) public statebool: boolean
|
||||
@Prop({ required: true }) public msgTrue: string
|
||||
@Prop({ required: true }) public msgFalse: string
|
||||
|
||||
get getcl() {
|
||||
if (this.statebool)
|
||||
return 'requisiti_on'
|
||||
else
|
||||
return 'requisiti_off'
|
||||
}
|
||||
}
|
||||
15
src/components/CRequisiti/CRequisiti.vue
Normal file
15
src/components/CRequisiti/CRequisiti.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div class="q-ma-md">
|
||||
<div :class="getcl">
|
||||
<div v-if="statebool" v-html="msgTrue"></div>
|
||||
<div v-else v-html="msgFalse"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CRequisiti.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CRequisiti.scss';
|
||||
</style>
|
||||
1
src/components/CRequisiti/index.ts
Normal file
1
src/components/CRequisiti/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {default as CRequisiti} from './CRequisiti.vue'
|
||||
7
src/components/CUserBadge/CUserBadge.scss
Normal file
7
src/components/CUserBadge/CUserBadge.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
.myuserbadge{
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
border: solid 1px #4198ef;
|
||||
border-radius: 1rem;
|
||||
padding: 2px;
|
||||
}
|
||||
58
src/components/CUserBadge/CUserBadge.ts
Normal file
58
src/components/CUserBadge/CUserBadge.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import Vue from 'vue'
|
||||
import { GlobalStore } from '@store'
|
||||
import { UserStore } from '../../store/Modules'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
|
||||
import { validationMixin } from 'vuelidate'
|
||||
|
||||
import MixinBase from '../../mixins/mixin-base'
|
||||
import { IUserFields } from '../../model'
|
||||
|
||||
@Component({
|
||||
name: 'CUserBadge',
|
||||
components: { }
|
||||
})
|
||||
|
||||
export default class CUserBadge extends MixinBase {
|
||||
@Prop({ required: true }) public index: number
|
||||
@Prop({ required: false, default: false }) public yourinvite: boolean
|
||||
@Prop({ required: true }) public user: IUserFields
|
||||
@Prop({ required: true }) public numpeople: number
|
||||
@Prop({ required: true }) public mycolor: string
|
||||
public $v
|
||||
public $t: any
|
||||
|
||||
public getletter(user) {
|
||||
return user.name[0].toUpperCase()
|
||||
}
|
||||
|
||||
public getnumber(user, index) {
|
||||
return index
|
||||
}
|
||||
|
||||
public getstatecolor(user) {
|
||||
return (user.profile.teleg_id) ? 'green' : 'gray'
|
||||
}
|
||||
|
||||
public getmoneycolor(user) {
|
||||
return (user.made_gift) ? 'green' : 'gray'
|
||||
}
|
||||
|
||||
get madegift() {
|
||||
return UserStore.state.my.made_gift
|
||||
}
|
||||
|
||||
public getzoomcolor(user) {
|
||||
return (user.profile.saw_zoom_presentation) ? 'green' : 'gray'
|
||||
}
|
||||
|
||||
public get2peoplecolor() {
|
||||
return (this.getnumpeople() >= 2) ? 'green' : 'gray'
|
||||
}
|
||||
|
||||
public getnumpeople() {
|
||||
return this.numpeople
|
||||
}
|
||||
|
||||
}
|
||||
41
src/components/CUserBadge/CUserBadge.vue
Normal file
41
src/components/CUserBadge/CUserBadge.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-item class="q-my-sm q-pa-sm myuserbadge shadow-5" clickable v-ripple>
|
||||
<q-item-section avatar>
|
||||
<div class="row" style="margin-left: 4px;">
|
||||
<q-avatar v-if="yourinvite" :text-color="mycolor" size="md">
|
||||
{{ getnumber(user, index + 1) }}°
|
||||
</q-avatar>
|
||||
<q-avatar :color="mycolor" text-color="white" size="md">
|
||||
{{ getletter(user) }}
|
||||
</q-avatar>
|
||||
</div>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>{{ user.name }} {{ user.surname }}<br>
|
||||
<span class="text-grey">({{ user.username }})</span>
|
||||
</q-item-label>
|
||||
<!--<q-item-label caption lines="1">{{ user.email }}</q-item-label>-->
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side>
|
||||
<div class="row q-gutter-xs justify-center items-center">
|
||||
<q-icon size="xs" name="fab fa-telegram" :color="getstatecolor(user)"></q-icon>
|
||||
<q-icon size="xs" name="fas fa-video" :color="getzoomcolor(user)"></q-icon>
|
||||
<q-avatar :text-color="mycolor" size="md">
|
||||
{{ getnumpeople() }}
|
||||
</q-avatar>
|
||||
<q-icon size="xs" name="fas fa-user-friends" :color="get2peoplecolor()"></q-icon>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CUserBadge.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CUserBadge.scss';
|
||||
</style>
|
||||
1
src/components/CUserBadge/index.ts
Normal file
1
src/components/CUserBadge/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {default as CUserBadge} from './CUserBadge.vue'
|
||||
0
src/components/CVideo/CVideo.scss
Normal file
0
src/components/CVideo/CVideo.scss
Normal file
21
src/components/CVideo/CVideo.ts
Normal file
21
src/components/CVideo/CVideo.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
import { UserStore } from '@store'
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
|
||||
import MixinBase from '../../mixins/mixin-base'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
|
||||
@Component({
|
||||
components: { }
|
||||
})
|
||||
|
||||
export default class CVideo extends MixinBase {
|
||||
@Prop({ required: true }) public myvideokey: string
|
||||
@Prop({ required: false, default: '' }) public title: boolean
|
||||
|
||||
get getvideotit() {
|
||||
return this.title
|
||||
}
|
||||
}
|
||||
27
src/components/CVideo/CVideo.vue
Normal file
27
src/components/CVideo/CVideo.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row justify-evenly items-center q-gutter-sm ">
|
||||
|
||||
<div class="text-center">
|
||||
<div class="subtitle_small text-blue" v-html="getvideotit"></div>
|
||||
<div class="">
|
||||
<iframe
|
||||
:width="tools.getwidthscale(mythis(), getValDb('YT_W', false), 800)"
|
||||
:height="tools.getheightbywidth(mythis(), getValDb('YT_W', false), getValDb('YT_H', false), 800)"
|
||||
:src="tools.getvideobyidyoutube(myvideokey)"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CVideo.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CVideo.scss';
|
||||
</style>
|
||||
1
src/components/CVideo/index.ts
Normal file
1
src/components/CVideo/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {default as CVideo} from './CVideo.vue'
|
||||
26
src/model/NotevoleStore.ts
Normal file
26
src/model/NotevoleStore.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { IUserFields, IUserProfile } from '@src/model/UserStore'
|
||||
|
||||
export interface ICheckUser {
|
||||
verified_email?: boolean
|
||||
teleg_id?: number
|
||||
profile?: IUserProfile
|
||||
}
|
||||
|
||||
export interface INotData {
|
||||
num_tot_lista?: number
|
||||
num_reg_lista?: number
|
||||
num_reg?: number
|
||||
email_non_verif?: number
|
||||
num_teleg_attivo?: number
|
||||
num_teleg_pending?: number
|
||||
num_part_zoom?: number
|
||||
num_users_dream?: number
|
||||
arr_nations?: string
|
||||
lastsreg?: IUserFields[]
|
||||
checkuser?: ICheckUser | any
|
||||
reg_daily?: string
|
||||
}
|
||||
|
||||
export interface INotevoleState {
|
||||
datastat: INotData
|
||||
}
|
||||
92
src/store/Modules/NotevoleStore.ts
Normal file
92
src/store/Modules/NotevoleStore.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import Api from '@api'
|
||||
import { IAction, INotevoleState, IParamsQuery } from 'model'
|
||||
import { storeBuilder } from './Store/Store'
|
||||
|
||||
import { serv_constants } from '../Modules/serv_constants'
|
||||
import { tools } from '../Modules/tools'
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
import { GlobalStore, NotevoleStore, Todos, Projects, CalendarStore, UserStore } from '@store'
|
||||
import globalroutines from './../../globalroutines/index'
|
||||
|
||||
import { static_data } from '@src/db/static_data'
|
||||
import { db_data } from '@src/db/db_data'
|
||||
|
||||
import translate from './../../globalroutines/util'
|
||||
import * as Types from '@src/store/Api/ApiTypes'
|
||||
import { ICalendarState, ICfgServer } from '@src/model'
|
||||
|
||||
const state: INotevoleState = {
|
||||
datastat: {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const b = storeBuilder.module<INotevoleState>('NotevoleModule', state)
|
||||
|
||||
namespace Getters {
|
||||
// const fullName = b.read(function fullName(state): string {
|
||||
// return state.NotevoleInfos.firstname?capitalize(state.NotevoleInfos.firstname) + " " + capitalize(state.NotevoleInfos.lastname):null;
|
||||
// })
|
||||
|
||||
// const isNotevoleInvalid = b.read((mystate) => {
|
||||
// try {
|
||||
// const ris = (mystate.my._id === undefined) || (mystate.my._id.trim() === '') || (mystate.my.tokens[0] === undefined)
|
||||
// // console.log('state._id', state._id, 'ris', ris)
|
||||
// return ris
|
||||
// } catch (e) {
|
||||
// return true
|
||||
// }
|
||||
// }, 'isNotevoleInvalid')
|
||||
|
||||
export const getters = {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace Mutations {
|
||||
export const mutations = {
|
||||
}
|
||||
}
|
||||
|
||||
namespace Actions {
|
||||
|
||||
async function notevoleload(context) {
|
||||
|
||||
const paramquery = {
|
||||
locale: tools.getLocale(),
|
||||
username: UserStore.state.my.username
|
||||
}
|
||||
|
||||
return await Api.SendReq('/ayni/load', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
state.datastat = res.data.datastat
|
||||
state.datastat.arr_nations = JSON.parse(state.datastat.arr_nations)
|
||||
state.datastat.reg_daily = JSON.parse(state.datastat.reg_daily)
|
||||
state.datastat.checkuser = JSON.parse(state.datastat.checkuser)
|
||||
|
||||
return state.datastat
|
||||
}).catch((error) => {
|
||||
return null
|
||||
})
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
notevoleload: b.dispatch(notevoleload)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const stateGetter = b.state()
|
||||
|
||||
// Module
|
||||
const NotevoleModule = {
|
||||
get state() {
|
||||
return stateGetter()
|
||||
},
|
||||
actions: Actions.actions,
|
||||
getters: Getters.getters,
|
||||
mutations: Mutations.mutations
|
||||
}
|
||||
|
||||
export default NotevoleModule
|
||||
7
src/typings/libs/google.d.ts
vendored
Normal file
7
src/typings/libs/google.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { google } from '../../googlemap'
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$google: google
|
||||
}
|
||||
}
|
||||
25
src/validation/aportadorexist.ts
Normal file
25
src/validation/aportadorexist.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { default as Axios, AxiosResponse } from 'axios'
|
||||
// import { IPayload } from 'model'
|
||||
import { GlobalConfig, PayloadMessageTypes } from '../common'
|
||||
import { tools } from '../store/Modules/tools'
|
||||
|
||||
// const SITE_URL = GlobalConfig.uri.site
|
||||
const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/users/'
|
||||
|
||||
export function aportadorexist(userName: string) {
|
||||
if (userName === tools.APORTADOR_NONE)
|
||||
return true
|
||||
|
||||
let onSuccess = (res: AxiosResponse) => {
|
||||
// console.log('res.status', res.status)
|
||||
return res.status === PayloadMessageTypes.statusfound
|
||||
}
|
||||
|
||||
return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + userName)
|
||||
.then(onSuccess)
|
||||
.catch((err) => {
|
||||
// console.log('err', err)
|
||||
return false
|
||||
})
|
||||
|
||||
}
|
||||
0
src/views/admin/dbop/dbop.scss
Normal file
0
src/views/admin/dbop/dbop.scss
Normal file
25
src/views/admin/dbop/dbop.ts
Normal file
25
src/views/admin/dbop/dbop.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import Vue from 'vue'
|
||||
import { Component } from 'vue-property-decorator'
|
||||
|
||||
import { GlobalStore } from '@store'
|
||||
import { tools } from '../../../store/Modules/tools'
|
||||
import { UserStore } from '../../../store/Modules'
|
||||
import { CTitleBanner } from '../../../components/CTitleBanner'
|
||||
|
||||
@Component({
|
||||
components: { CTitleBanner }
|
||||
})
|
||||
export default class Dbop extends Vue {
|
||||
public ris: string = ''
|
||||
|
||||
public async changeCellInt() {
|
||||
|
||||
const mydata = {
|
||||
dbop: 'changeCellInt'
|
||||
}
|
||||
|
||||
this.ris = await UserStore.actions.execDbOp({ mydata })
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
27
src/views/admin/dbop/dbop.vue
Normal file
27
src/views/admin/dbop/dbop.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<CTitleBanner title="Operazioni su DB:"></CTitleBanner>
|
||||
<div class="q-ma-md q-pa-sm text-center rounded-borders q-list--bordered">
|
||||
|
||||
<q-btn label="Passa i codici Telefoni sul campo cell" color="primary" @click="changeCellInt"></q-btn>
|
||||
</div>
|
||||
|
||||
|
||||
<q-field
|
||||
stack-label
|
||||
dense
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline text-center" tabindex="0">{{ris}}</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./dbop.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './dbop';
|
||||
</style>
|
||||
1
src/views/admin/dbop/index.ts
Normal file
1
src/views/admin/dbop/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export {default as dbop} from './dbop.vue'
|
||||
18
src/views/updatepassword/request-resetpwd-validate.ts
Normal file
18
src/views/updatepassword/request-resetpwd-validate.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ISignupOptions } from 'model'
|
||||
import { email, minLength, required, sameAs } from 'vuelidate/lib/validators'
|
||||
// import { ValidationRuleset } from 'vuelidate'
|
||||
import { complexity, registeredemail, registereduser, aportadorexist } from '../../validation'
|
||||
|
||||
export const validations = {
|
||||
form: {
|
||||
repeatPassword: {
|
||||
required,
|
||||
sameAsPassword: sameAs('password')
|
||||
},
|
||||
password: {
|
||||
required,
|
||||
minLength: minLength(8),
|
||||
complexity
|
||||
}
|
||||
}
|
||||
}
|
||||
0
src/views/updatepassword/updatepassword.scss
Normal file
0
src/views/updatepassword/updatepassword.scss
Normal file
125
src/views/updatepassword/updatepassword.ts
Normal file
125
src/views/updatepassword/updatepassword.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
import { serv_constants } from '../../store/Modules/serv_constants'
|
||||
|
||||
import { UserStore } from '../../store/Modules/index'
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { Logo } from '../../components/logo'
|
||||
import { validationMixin } from 'vuelidate'
|
||||
import { CTitleBanner } from '../../components/CTitleBanner'
|
||||
import { validations } from './request-resetpwd-validate'
|
||||
|
||||
@Component({
|
||||
mixins: [validationMixin],
|
||||
validations,
|
||||
components: { Logo, CTitleBanner }
|
||||
})
|
||||
|
||||
export default class Updatepassword extends Vue {
|
||||
public $q
|
||||
public $t
|
||||
public $v
|
||||
|
||||
public emailsent = false
|
||||
public form = {
|
||||
password: '',
|
||||
repeatPassword: '',
|
||||
tokenforgot: '',
|
||||
email: '',
|
||||
idapp: ''
|
||||
}
|
||||
|
||||
public created() {
|
||||
// this.load()
|
||||
}
|
||||
|
||||
get emailinviata() {
|
||||
return this.emailsent
|
||||
}
|
||||
|
||||
public submit() {
|
||||
this.$v.form.$touch()
|
||||
|
||||
if (this.$v.form.$error) {
|
||||
tools.showNotif(this.$q, this.$t('reg.err.errore_generico'))
|
||||
return
|
||||
}
|
||||
|
||||
this.$q.loading.show({ message: this.$t('reset.incorso') })
|
||||
|
||||
// console.log('this.$route.query', this.$route.query)
|
||||
this.form.tokenforgot = this.$route.query.tokenforgot.toString()
|
||||
this.form.email = this.$route.query.email.toString()
|
||||
this.form.idapp = process.env.APP_ID
|
||||
|
||||
console.log(this.form)
|
||||
UserStore.actions.resetpwd(this.form)
|
||||
.then((ris) => {
|
||||
console.log('ris', ris)
|
||||
if (ris.code === serv_constants.RIS_CODE_OK)
|
||||
this.$router.push('/signin')
|
||||
else if (ris.code === serv_constants.RIS_CODE_TOKEN_RESETPASSWORD_NOT_FOUND)
|
||||
tools.showNegativeNotif(this.$q, this.$t('reset.token_scaduto'))
|
||||
else
|
||||
tools.showNegativeNotif(this.$q, this.$t('fetch.errore_server'))
|
||||
|
||||
this.$q.loading.hide()
|
||||
}).catch(error => {
|
||||
console.log('ERROR = ' + error)
|
||||
this.$q.loading.hide()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public errorMsg(cosa: string, item: any) {
|
||||
try {
|
||||
if (!item.$error) {
|
||||
return ''
|
||||
}
|
||||
// console.log('errorMsg', cosa, item)
|
||||
if (item.$params.email && !item.email) {
|
||||
return this.$t('reg.err.email')
|
||||
}
|
||||
|
||||
if (cosa === 'repeatpassword') {
|
||||
if (!item.sameAsPassword) {
|
||||
return this.$t('reg.err.sameaspassword')
|
||||
}
|
||||
}
|
||||
|
||||
// console.log('item', item)
|
||||
|
||||
if (item.minLength !== undefined) {
|
||||
if (!item.minLength) {
|
||||
return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char')
|
||||
}
|
||||
}
|
||||
if (item.complexity !== undefined) {
|
||||
if (!item.complexity) {
|
||||
return this.$t('reg.err.complexity')
|
||||
}
|
||||
}
|
||||
// if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') }
|
||||
|
||||
if (item.required !== undefined) {
|
||||
if (!item.required) {
|
||||
return this.$t('reg.err.required')
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(' ....avanti')
|
||||
if (cosa === 'email') {
|
||||
// console.log("EMAIL " + item.isUnique);
|
||||
// console.log(item);
|
||||
if (!item.isUnique) {
|
||||
return this.$t('reg.err.duplicate_email')
|
||||
}
|
||||
}
|
||||
|
||||
return ''
|
||||
} catch (error) {
|
||||
// console.log("ERR : " + error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
81
src/views/updatepassword/updatepassword.vue
Normal file
81
src/views/updatepassword/updatepassword.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div class="mypanel">
|
||||
|
||||
<div v-if="!emailinviata">
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-primary text-white"
|
||||
style="text-align: center;">
|
||||
<span class="mybanner">{{ $t('reset.title_update_pwd')}}</span>
|
||||
</q-banner>
|
||||
<br>
|
||||
|
||||
<div class="column">
|
||||
|
||||
<q-input
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
rounded outlined
|
||||
@blur="$v.form.password.$touch"
|
||||
:error="$v.form.password.$error"
|
||||
:error-message="`${errorMsg('password', $v.form.password)}`"
|
||||
maxlength="30"
|
||||
:label="$t('reg.password')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="vpn_key"/>
|
||||
</template>
|
||||
|
||||
</q-input>
|
||||
|
||||
<q-input
|
||||
v-model="form.repeatPassword"
|
||||
type="password"
|
||||
maxlength="30"
|
||||
rounded outlined
|
||||
@blur="$v.form.repeatPassword.$touch"
|
||||
:error="$v.form.repeatPassword.$error"
|
||||
:error-message="`${errorMsg('repeatpassword', $v.form.repeatPassword)}`"
|
||||
|
||||
:label="$t('reg.repeatPassword')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="vpn_key"/>
|
||||
</template>
|
||||
|
||||
</q-input>
|
||||
|
||||
|
||||
<div align="center">
|
||||
<q-btn rounded size="lg" color="primary" @click="submit" :disable="$v.$error">
|
||||
{{$t('reset.update_password')}}
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-primary text-white"
|
||||
style="text-align: center;">
|
||||
<span class="mybanner">{{ $t('reset.email_sent')}}</span>
|
||||
</q-banner>
|
||||
<br>
|
||||
|
||||
<div>
|
||||
{{ $t('reset.check_email')}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./updatepassword.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './updatepassword';
|
||||
</style>
|
||||
Reference in New Issue
Block a user