- Bot Telegram ...

This commit is contained in:
Paolo Arena
2020-01-03 22:03:59 +01:00
parent 7b64358016
commit 9b9dcbfde1
10 changed files with 84 additions and 48 deletions

View File

@@ -206,7 +206,7 @@ export default class CGridTableRec extends Vue {
const startRow = (page - 1) * rowsPerPage
const endRow = startRow + fetchCount
console.log('startRow', startRow)
// console.log('startRow', startRow)
this.serverData = []
@@ -382,7 +382,7 @@ export default class CGridTableRec extends Vue {
public refresh() {
this.serverData = []
console.log('refresh')
// console.log('refresh')
// console.log('this.search', this.search)
if (!!this.search && this.search !== '')
this.myfilter = this.search

View File

@@ -1,32 +1,34 @@
<template>
<div>
<q-banner
inline-actions
rounded dense
:class="bgcolor+` q-my-md `+clcolor+ ` ` + myclass"
style="text-align: center; "
@click="myvisible = !myvisible"
>
<template v-slot:avatar>
<q-icon v-if="canopen" :name="icon" color="white" />
</template>
<template v-slot:action>
<q-icon v-if="canopen" :name="iconopen" color="white" />
</template>
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
</q-banner>
<div>
<q-banner
inline-actions
rounded dense
:class="bgcolor+` q-my-sm `+clcolor+ ` ` + myclass"
style="text-align: center; "
@click="myvisible = !myvisible"
>
<template v-slot:avatar>
<q-icon v-if="canopen" :name="icon" color="white"/>
</template>
<template v-slot:action>
<div class="cursor-pointer">
<q-icon v-if="canopen" :name="iconopen" color="white"/>
</div>
</template>
<span :class="`mybanner `+ myclasstext" :style="mystyle">{{title}}</span>
</q-banner>
<q-slide-transition>
<div v-show="myvisible">
<slot></slot>
</div>
</q-slide-transition>
<q-slide-transition>
<div v-show="myvisible">
<slot></slot>
</div>
</q-slide-transition>
</div>
</div>
</template>
<script lang="ts" src="./CTitleBanner.ts">
</script>
<style lang="scss" scoped>
@import './CTitleBanner.scss';
@import './CTitleBanner.scss';
</style>

View File

@@ -340,7 +340,7 @@ export default class Header extends Vue {
return UserStore.state.isLogged
}
get isVerified() {
get isEmailVerified() {
return UserStore.state.my.verified_email
}

View File

@@ -147,7 +147,7 @@
{{ $t('user.loggati') }}
</div>
<div v-if="isLogged && !isVerified" class="text-verified">{{
<div v-if="isLogged && !isEmailVerified" class="text-verified">{{
$t('components.authentication.email_verification.verify_email') }}
</div>

View File

@@ -36,3 +36,4 @@ export * from './COpenStreetMap'
export * from './CTitleBanner'
export * from './CGallery'
export * from './CProfile'
export * from './CStatus'

View File

@@ -20,6 +20,7 @@ export interface IUserProfile {
teleg_id?: number
teleg_checkcode?: number
paymenttypes?: IPaymentType[]
manage_telegram?: boolean
}
export interface IPaymentType {

View File

@@ -124,6 +124,8 @@ const msgglobal = {
country_pay: 'Paese di Destinazione Pagamenti',
username_telegram: 'Username Telegram',
teleg_id: 'Telegram ID',
teleg_checkcode: 'Codice Telegram',
manage_telegram: 'Gestori Telegram',
paymenttype: 'Modalità di Pagamenti Disponbili',
img: 'Immagine',
date_reg: 'Data Reg.',
@@ -506,6 +508,8 @@ const msgglobal = {
username_telegram: 'Usuario Telegram',
teleg_id: 'Telegram ID',
paymenttype: 'Métodos de pago disponibles',
teleg_checkcode: 'Codice Telegram',
manage_telegram: 'Gestori Telegram',
img: 'File image',
date_reg: 'Fecha Reg.',
perm: 'Permisos',
@@ -877,6 +881,8 @@ const msgglobal = {
username_telegram: 'Nom d\'utilisateur du Telegram',
teleg_id: 'Telegram ID',
paymenttype: 'Méthodes de paiement disponibles',
teleg_checkcode: 'Codice Telegram',
manage_telegram: 'Gestori Telegram',
img: 'Fichier image',
date_reg: 'Date Inscript.',
perm: 'Autorisations',
@@ -1248,6 +1254,8 @@ const msgglobal = {
username_telegram: 'Username Telegram',
teleg_id: 'Telegram ID',
paymenttype: 'Available Payment Methods',
teleg_checkcode: 'Codice Telegram',
manage_telegram: 'Gestori Telegram',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',
@@ -1619,6 +1627,8 @@ const msgglobal = {
username_telegram: 'Username Telegram',
teleg_id: 'Telegram ID',
paymenttype: 'Available Payment Methods',
teleg_checkcode: 'Codice Telegram',
manage_telegram: 'Gestori Telegram',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',

View File

@@ -788,30 +788,39 @@ namespace Actions {
return await Api.SendReq('/loadsite/' + myuserid + '/' + process.env.APP_ID + '/' + showall, 'GET', null)
.then((res) => {
CalendarStore.state.bookedevent = (res.data.bookedevent) ? res.data.bookedevent : []
CalendarStore.state.eventlist = (res.data.eventlist) ? res.data.eventlist : []
CalendarStore.state.operators = (res.data.operators) ? res.data.operators : []
CalendarStore.state.wheres = (res.data.wheres) ? res.data.wheres : []
CalendarStore.state.contribtype = (res.data.contribtype) ? res.data.contribtype : []
GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : []
GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
GlobalStore.state.paymenttypes = (res.data.paymenttypes) ? [...res.data.paymenttypes] : []
GlobalStore.state.gallery = (res.data.gallery) ? [...res.data.gallery] : []
console.log('____________________________ res', res)
if (res.status === 200) {
CalendarStore.state.bookedevent = (res.data.bookedevent) ? res.data.bookedevent : []
CalendarStore.state.eventlist = (res.data.eventlist) ? res.data.eventlist : []
CalendarStore.state.operators = (res.data.operators) ? res.data.operators : []
CalendarStore.state.wheres = (res.data.wheres) ? res.data.wheres : []
CalendarStore.state.contribtype = (res.data.contribtype) ? res.data.contribtype : []
GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : []
GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
GlobalStore.state.paymenttypes = (res.data.paymenttypes) ? [...res.data.paymenttypes] : []
GlobalStore.state.gallery = (res.data.gallery) ? [...res.data.gallery] : []
if (showall) {
GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : []
GlobalStore.state.mailinglist = (res.data.mailinglist) ? [...res.data.mailinglist] : []
GlobalStore.state.mypage = (res.data.mypage) ? [...res.data.mypage] : []
if (showall) {
GlobalStore.state.newstosent = (res.data.newstosent) ? [...res.data.newstosent] : []
GlobalStore.state.mailinglist = (res.data.mailinglist) ? [...res.data.mailinglist] : []
GlobalStore.state.mypage = (res.data.mypage) ? [...res.data.mypage] : []
}
if (res.data.myuser) {
UserStore.mutations.authUser(res.data.myuser)
UserStore.mutations.updateLocalStorage(res.data.myuser)
}
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
if (res.data.myuser === null && UserStore.state.isLogged) {
// Fai Logout
UserStore.actions.logout()
GlobalStore.state.RightDrawerOpen = true
}
}
if (res.data.myuser) {
UserStore.mutations.authUser(res.data.myuser)
UserStore.mutations.updateLocalStorage(res.data.myuser)
}
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
})
.catch((error) => {
console.log('error dbLoad', error)

View File

@@ -48,6 +48,7 @@ export const DefaultProfile: IUserProfile = {
username_telegram: '',
teleg_id: 0,
teleg_checkcode: 0,
manage_telegram: false,
paymenttypes: []
}
@@ -185,6 +186,12 @@ namespace Getters {
}, 'getRefLink')
const isVerificato = b.read((mystate: IUserState) => {
const teleg_ok = mystate.my.profile.teleg_id > 0
return teleg_ok
}, 'isVerificato')
export const getters = {
get isUserInvalid() {
return isUserInvalid()
@@ -231,6 +238,9 @@ namespace Getters {
get getPaymenttypeById() {
return getPaymenttypeById()
},
get isVerificato() {
return isVerificato()
},
}
}
@@ -680,6 +690,8 @@ namespace Actions {
Mutations.mutations.updateLocalStorage(myuser)
GlobalStore.actions.loadSite()
}
}

View File

@@ -406,6 +406,7 @@ export const fieldsTable = {
AddCol({ name: 'profile.country_pay', field: 'profile', subfield: 'country_pay', label_trans: 'reg.country_pay', fieldtype: tools.FieldType.nationality }),
AddCol({ name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id' }),
AddCol({ name: 'profile.teleg_checkcode', field: 'profile', subfield: 'teleg_checkcode', label_trans: 'reg.teleg_checkcode' }),
AddCol({ name: 'profile.manage_telegram', field: 'profile', subfield: 'manage_telegram', label_trans: 'reg.manage_telegram', fieldtype: tools.FieldType.boolean }),
AddCol({ name: 'profile.paymenttypes', field: 'profile', subfield: 'paymenttypes', label_trans: 'reg.paymenttype', fieldtype: tools.FieldType.multiselect, jointable: 'paymenttypes' }),
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),