Payeer e AdvCash

This commit is contained in:
Paolo Arena
2020-09-04 00:08:36 +02:00
parent 25dcde96df
commit f94186be75
33 changed files with 561 additions and 217 deletions

View File

@@ -41,6 +41,7 @@ export const DefaultUser: IUserFields = {
img: '',
teleg_id: 0,
saw_zoom_presentation: false,
ask_zoom_partecipato: false,
saw_and_accepted: false,
qualified: false,
qualified_2invitati: false,
@@ -60,6 +61,8 @@ export const DefaultProfile: IUserProfile = {
sex: 0,
country_pay: '',
email_paypal: '',
payeer_id: '',
advcash_id: '',
revolut: '',
link_payment: '',
note_payment: '',
@@ -69,6 +72,7 @@ export const DefaultProfile: IUserProfile = {
my_dream: '',
manage_telegram: false,
saw_zoom_presentation: false,
ask_zoom_partecipato: false,
saw_and_accepted: false,
paymenttypes: [],
qualified: false,
@@ -87,6 +91,7 @@ const state: IUserState = {
isAdmin: false,
isManager: false,
isTutor: false,
isZoomeri: false,
isTraduttrici: false,
usersList: [],
countusers: 0,
@@ -147,16 +152,23 @@ namespace Getters {
return false
}, 'VistoZoom')
const DiceDiAverPartecipato = b.read((mystate) => {
if (mystate.my && mystate.my.profile) {
return (mystate.my.profile.ask_zoom_partecipato)
}
return false
}, 'DiceDiAverPartecipato')
const isServerError = b.read((mystate) => {
return (state.servercode === tools.ERR_SERVERFETCH)
return (mystate.servercode === tools.ERR_SERVERFETCH)
}, 'isServerError')
const getServerCode = b.read((mystate) => {
return state.servercode
return mystate.servercode
}, 'getServerCode')
const getMsg = b.read((mystate) => {
return state.msg
return mystate.msg
}, 'getMsg')
const getNameSurnameByUserId = b.read((mystate: IUserState) => (userId: string) => {
@@ -259,6 +271,9 @@ namespace Getters {
get VistoZoom() {
return VistoZoom()
},
get DiceDiAverPartecipato() {
return DiceDiAverPartecipato()
},
get getServerCode() {
return getServerCode()
},
@@ -312,6 +327,7 @@ namespace Mutations {
mystate.isAdmin = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Admin.value)
mystate.isManager = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Manager.value)
mystate.isTutor = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Tutor.value)
mystate.isZoomeri = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Zoomeri.value)
mystate.isTeacher = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Teacher.value)
mystate.isTraduttrici = tools.isBitActive(mystate.my.perm, shared_consts.Permissions.Traduttrici.value)
@@ -392,6 +408,11 @@ namespace Mutations {
mystate.servercode = num
}
function setDiceDiAverPartecipato(mystate: IUserState, partecipato: boolean) {
console.log('setDiceDiAverPartecipato', partecipato)
mystate.my.profile.ask_zoom_partecipato = partecipato
}
function setResStatus(mystate: IUserState, status: number) {
mystate.resStatus = status
}
@@ -468,6 +489,7 @@ namespace Mutations {
setResStatus: b.commit(setResStatus),
setAuth: b.commit(setAuth),
clearAuthData: b.commit(clearAuthData),
setDiceDiAverPartecipato: b.commit(setDiceDiAverPartecipato),
setErrorCatch: b.commit(setErrorCatch),
getMsgError: b.commit(getMsgError),
setusersList: b.commit(setusersList)

View File

@@ -457,7 +457,7 @@ export const fieldsTable = {
getTableJoinByName(table) {
if (table === 'permissions')
return [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Tutor, shared_consts.Permissions.Traduttrici]
return [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Tutor, shared_consts.Permissions.Traduttrici, shared_consts.Permissions.Zoomeri]
else if (table === 'accepted')
return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
else if (table === 'fieldstype')
@@ -564,6 +564,13 @@ export const fieldsTable = {
label_trans: 'reg.saw_zoom_presentation',
fieldtype: tools.FieldType.boolean
}),
AddCol({
name: 'profile.ask_zoom_partecipato',
field: 'profile',
subfield: 'ask_zoom_partecipato',
label_trans: 'reg.ask_zoom_partecipato',
fieldtype: tools.FieldType.boolean
}),
AddCol({
name: 'profile.qualified',
field: 'profile',
@@ -585,6 +592,18 @@ export const fieldsTable = {
subfield: 'email_paypal',
label_trans: 'reg.email_paypal'
}),
AddCol({
name: 'profile.payeer_id',
field: 'profile',
subfield: 'payeer_id',
label_trans: 'reg.payeer_id'
}),
AddCol({
name: 'profile.advcash_id',
field: 'profile',
subfield: 'advcash_id',
label_trans: 'reg.advcash_id'
}),
AddCol({
name: 'profile.revolut',
field: 'profile',
@@ -709,6 +728,18 @@ export const fieldsTable = {
subfield: 'email_paypal',
label_trans: 'reg.email_paypal'
}),
AddCol({
name: 'profile.payeer_id',
field: 'profile',
subfield: 'payeer_id',
label_trans: 'reg.payeer_id'
}),
AddCol({
name: 'profile.advcash_id',
field: 'profile',
subfield: 'advcash_id',
label_trans: 'reg.advcash_id'
}),
AddCol({
name: 'profile.revolut',
field: 'profile',

View File

@@ -33,7 +33,8 @@ export const lists = {
DAMMI_PRIMO_UTENTE_LIBERO: 390,
CAN_EDIT_TABLE: 400,
SHOW_PREV_REC: 401
SHOW_PREV_REC: 401,
ZOOM_GIA_PARTECIPATO: 510
},
selectTheme: [

View File

@@ -1483,6 +1483,29 @@ export const tools = {
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
} else if (func === lists.MenuAction.ZOOM_GIA_PARTECIPATO) {
// console.log('param1', par.param1, 'id', par.param1._id)
const mydatatosave = {
id: par.param1._id,
ind_order: par.param1.ind_order,
myfunc: func,
data: par.param2,
username: par.param2.username,
notifBot: null,
}
// if (par.param2.notifBot)
// mydatatosave.notifBot = { un: par.param2.notifBot, txt: par.param3 }
// myself.EseguiCallServer()
GlobalStore.actions.callFunz({ mydata: mydatatosave }).then((ris) => {
if (ris) {
myself.Callback(func)
tools.showPositiveNotif(myself.$q, par.param3)
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed'))
})
} else if (func === lists.MenuAction.REGALA_INVITATO) {
// console.log('param1', par.param1, 'id', par.param1._id)
let mydatatosave = {
@@ -2073,6 +2096,10 @@ export const tools = {
return UserStore.state.isTutor
},
isZoomeri() {
return UserStore.state.isZoomeri
},
isTraduttrici() {
return UserStore.state.isTraduttrici
},
@@ -2183,7 +2210,7 @@ export const tools = {
${ mythis.$t('cal.endtime')} ${ tools.getstrTime(myevent.dateTimeEnd) }`
} else {
mystr = `${tools.getstrDate(myevent.dateTimeStart)}
${mythis.$t('cal.starttime')} ${ tools.getstrTime(myevent.dateTimeStart) }
${mythis.$t('cal.starttime')} ${ tools.getstrTime(myevent.dateTimeStart) }
${ mythis.$t('cal.endtime')} ${ tools.getstrTime(myevent.dateTimeEnd) }`
}
} else {
@@ -3121,8 +3148,15 @@ export const tools = {
param1: eventparam,
param2: true
})
}
,
},
AskGiaPartecipatoZoom(mythis, user) {
console.log('AskGiaPartecipatoZoom', user.username)
tools.askConfirm(mythis.$q, translate('steps.zoom_gia_partecipato'), translate('steps.zoom_gia_partecipato'), translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.ZOOM_GIA_PARTECIPATO, 0, {
param1: user,
param2: user,
param3: 'Confermato',
})
},
ActionRecTable(mythis, action, table, id, item, askaction) {
// console.log('ActionRecTable', id)
return tools.askConfirm(mythis.$q, 'Action', translate(askaction) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, table, action, 0, {
@@ -3508,7 +3542,7 @@ export const tools = {
const arrlang = ['IT', 'ES', 'PT', 'BR', 'US', 'GB', 'UK', 'DE', 'FR', 'SI', 'MD', 'IE', 'KE', 'AU', 'ML', 'DO',
'NG', 'SK', 'CH', 'CM', 'CO', 'CG', 'PE', 'MS', 'SM', 'HR', 'RO', 'VE', 'CL', 'PL', 'EG', 'AR', 'MX', 'SN', 'PK', 'AT', 'NP',
'CU', 'MA', 'PH', 'BA', 'UA', 'BE', 'NL', 'CI']
'CU', 'MA', 'PH', 'BA', 'UA', 'BE', 'NL', 'CI', 'BF']
const flag = arrlang.find((mylang) => mylang === lang)
if (!!flag) {
@@ -3630,6 +3664,8 @@ export const tools = {
return 'Montserrat'
} else if (nat === 'CI') {
return 'Cote d\'Ivoire'
} else if (nat === 'BF') {
return 'Burkina Faso'
} else if (nat === 'IE') {
return 'Ireland'
} else if (nat === 'KE') {
@@ -3685,19 +3721,14 @@ export const tools = {
return ris
},
isPayPalSel(user) {
let ispaypal = false
isSel2Metodi(user) {
if (user.profile.paymenttypes) {
if (user.profile.paymenttypes.includes('paypal')) {
if (!!user.profile.email_paypal) {
if (user.profile.email_paypal !== '')
ispaypal = true
}
}
return user.profile.paymenttypes.length > 1
}
return ispaypal
return false
},
getnumrequisiti(user) {
let req = 0
@@ -3708,7 +3739,7 @@ export const tools = {
req += user.profile.saw_zoom_presentation ? 1 : 0
if (!!user.profile.my_dream)
req += user.profile.my_dream.length >= 10 ? 1 : 0
req += this.isPayPalSel(user) ? 1 : 0
req += this.isSel2Metodi(user) ? 1 : 0
return req
},
@@ -3857,6 +3888,54 @@ export const tools = {
}
return mylink
},
isselectPaypal() {
if (UserStore.state.my.profile) {
if (UserStore.state.my.profile.paymenttypes) {
if (UserStore.state.my.profile.paymenttypes.includes('paypal')) {
return true
}
}
return false
}
},
isselectPayeer() {
if (UserStore.state.my.profile) {
if (UserStore.state.my.profile.paymenttypes) {
if (UserStore.state.my.profile.paymenttypes.includes('payeer')) {
return true
}
}
return false
}
},
isselectRevolut() {
if (UserStore.state.my.profile) {
if (UserStore.state.my.profile.paymenttypes) {
if (UserStore.state.my.profile.paymenttypes.includes('revolut')) {
return true
}
}
return false
}
},
isselectAdvCash() {
if (UserStore.state.my.profile) {
if (UserStore.state.my.profile.paymenttypes) {
if (UserStore.state.my.profile.paymenttypes.includes('advcash')) {
return true
}
}
return false
}
}
// getLocale() {