From e4570fc39358676a5da26f3c722068009c3e8c53 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Mon, 11 May 2020 22:43:54 +0200 Subject: [PATCH] Grosse Modifiche Completate ! --- src/components/CMyDashboard/CMyDashboard.ts | 29 +- src/components/CMyDashboard/CMyDashboard.vue | 310 +++--- src/components/CMyNave/CMyNave.scss | 50 +- src/components/CMyNave/CMyNave.ts | 216 ++++- src/components/CMyNave/CMyNave.vue | 918 ++++++++++-------- src/components/CTitleBanner/CTitleBanner.scss | 6 + src/components/CTitleBanner/CTitleBanner.ts | 7 + src/components/CTitleBanner/CTitleBanner.vue | 2 +- .../admin/listadoninavi/listadoninavi.ts | 5 +- .../admin/listadoninavi/listadoninavi.vue | 678 ++++++------- src/statics/lang/de.js | 4 + src/statics/lang/enUs.js | 25 +- src/statics/lang/es.js | 14 +- src/statics/lang/fr.js | 14 +- src/statics/lang/it.js | 16 +- src/statics/lang/pt.js | 14 +- src/statics/lang/si.js | 14 +- src/store/Modules/GlobalStore.ts | 5 +- src/store/Modules/tools.ts | 35 +- 19 files changed, 1342 insertions(+), 1020 deletions(-) diff --git a/src/components/CMyDashboard/CMyDashboard.ts b/src/components/CMyDashboard/CMyDashboard.ts index edec9fa..01ca338 100755 --- a/src/components/CMyDashboard/CMyDashboard.ts +++ b/src/components/CMyDashboard/CMyDashboard.ts @@ -58,6 +58,8 @@ export default class CMyDashboard extends MixinUsers { public showregalainv: boolean = false public id_listaingr: number = -1 public ind_order_ingr: number = -1 + public myrigaattuale: number = 0 + public mycolattuale: number = 0 public dashboard: IDashboard = { myself: DefaultUser, aportador: DefaultUser, @@ -76,10 +78,10 @@ export default class CMyDashboard extends MixinUsers { @Watch('UserStore.state.my.dashboard') public changedash() { - console.log('changedash') + // console.log('changedash') this.dashboard = UserStore.state.my.dashboard if (!!this.dashboard) - this.invitante_username = this.dashboard.myself.aportador_solidario + this.invitante_username = this.dashboard.myself.username } @@ -96,7 +98,7 @@ export default class CMyDashboard extends MixinUsers { public changetab(val) { tools.setCookie(tools.TABBED_DASHBOARD, val) - console.log('setcook', val) + // console.log('setcook', val) } @Watch('this.username') @@ -112,7 +114,7 @@ export default class CMyDashboard extends MixinUsers { } public async update_username() { - console.log('update_username') + // console.log('update_username') this.loading = true if (this.username === '') this.myusername = this.getMyUsername() @@ -125,9 +127,12 @@ export default class CMyDashboard extends MixinUsers { this.dashboard = ris if (!!this.dashboard) - this.invitante_username = this.dashboard.myself.aportador_solidario + this.invitante_username = this.dashboard.myself.username - console.log('this.invitante_username', this.invitante_username) + this.myrigaattuale = this.dashboard.lastnave.riga + this.mycolattuale = this.dashboard.lastnave.col + + // console.log('this.invitante_username', this.invitante_username) this.loading = false }) @@ -184,8 +189,8 @@ export default class CMyDashboard extends MixinUsers { public datanave(mianave) { // const mynavepart = this.getnavePartenzaByRigaCol(tools.getRiganave(mianave.riga), tools.getColnave(mianave.col)) if (!!mianave.nave_partenza) { - if (!!mianave.nave_partenza.date_start) - return tools.getstrshortDate(mianave.nave_partenza.date_start) + if (!!mianave.nave_partenza.date_gift_chat_open) + return tools.getstrshortDate(mianave.nave_partenza.date_gift_chat_open) } return ' --/-- ' } @@ -340,7 +345,7 @@ export default class CMyDashboard extends MixinUsers { get allowSubmit() { let error = this.$v.$error || this.$v.$invalid - error = error || (this.invitante_username === this.dashboard.myself.username) + // error = error || (this.invitante_username === this.dashboard.myself.username) return !error @@ -370,9 +375,11 @@ export default class CMyDashboard extends MixinUsers { tools.saveFieldToServer(this, 'navi', mianave._id, mydata) } - public getNaveSognatoreStr(mianave, index) { + public getNaveSognatoreStr(mianave) { const mynavedest = tools.getfirstnaveSognatore(mianave.riga, mianave.col) - return mynavedest.riga + '.' + parseInt(mynavedest.col, 10) + index + const ris = mynavedest.riga + '.' + mynavedest.col + // console.log('ris', ris) + return ris } public getNaveMediatoreStr(mianave) { diff --git a/src/components/CMyDashboard/CMyDashboard.vue b/src/components/CMyDashboard/CMyDashboard.vue index 277e37d..28e20bb 100755 --- a/src/components/CMyDashboard/CMyDashboard.vue +++ b/src/components/CMyDashboard/CMyDashboard.vue @@ -16,6 +16,10 @@ +
+ +
+
@@ -141,10 +145,112 @@ +
+
+ + + + +
+
+
- + + +
+
+ {{ $t('dashboard.num_tessitura') }} +
+
+ {{ $t('dashboard.posizione') }} +
+
+ {{ $t('dashboard.invitante') }} +
+
+ {{ $t('dashboard.downline') }} +
+ +
+ {{ $t('reg.elimina') }} +
+ +
+ +
+
+
+
{{ index }}
+
+
+
{{ mioimbarco.posiz.posiz }} / {{ + mioimbarco.posiz.totposiz }} +
+
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+ +
+
+
+ +
+ + + + +
+ +
+ + + +
+ +
@@ -154,21 +260,6 @@
-
- -
- -
-
Num
- -
{{$t('dashboard.nave')}}
-
-
-
- - -
-
@@ -191,13 +282,14 @@
-
-
+
+
{{$t('dashboard.donatore')}}
{{$t('dashboard.mediatore')}}
{{$t('dashboard.sognatore')}}
-
+
{{ tools.getrigacolstr(mianave) }} @@ -208,16 +300,36 @@ - {{ getNaveSognatoreStr(mianave, 0)}} + {{ getNaveSognatoreStr(mianave)}}
-
- +
+ + + + + + + + - + + + + @@ -225,7 +337,15 @@ -
{{ $t('dashboard.ho_effettuato_il_dono') }}
+
+ + {{ $t('dashboard.ho_effettuato_il_dono') }} + +
@@ -234,15 +354,18 @@
- +
+ :navi_partenzaprop="dashboard.navi_partenza" :listanavi="false" :dashboard="dashboard">
@@ -265,105 +388,11 @@
-->
- -
-
- {{ $t('dashboard.num_tessitura') }} -
-
- {{ $t('dashboard.posizione') }} -
-
- {{ $t('dashboard.invitante') }} -
-
- {{ $t('dashboard.downline') }} -
- -
- {{ $t('reg.elimina') }} -
-
- -
-
-
-
{{ index }}
-
-
-
{{ mioimbarco.posiz.posiz }} / {{ - mioimbarco.posiz.totposiz }} -
-
-
-
- - -
-
-
-
- - -
-
- -
-
- -
-
-
- -
- - - - - - - -
- - -
- +
@@ -372,21 +401,6 @@
- -
-
- - - - -
-
- -

UTENTE CANCELLATO (Nascosto: true) !

@@ -398,10 +412,6 @@
-
- -
-
@@ -424,10 +434,6 @@ --> - - - -
@@ -457,10 +463,7 @@ - - +
@@ -491,7 +494,7 @@ - +
- - -
- +
diff --git a/src/components/CMyNave/CMyNave.scss b/src/components/CMyNave/CMyNave.scss index 286914b..552f0db 100755 --- a/src/components/CMyNave/CMyNave.scss +++ b/src/components/CMyNave/CMyNave.scss @@ -1,4 +1,5 @@ -.donatore, .mediatore, .sognatore, .title-nave, .intermedio2, .intermedio3 { + +.title-nave { padding: 2px 4px; margin: 2px 4px; color: white; @@ -6,6 +7,33 @@ border-radius: 16px; } +.donatore, .mediatore, .sognatore, .intermedio1, .intermedio2, .intermedio4, .intermedio5{ + color: white; + background-color: lightblue; + padding: 1px 2px; + margin: 1px 2px; + font-size: 0.8rem; + border-radius: 32px; + font-weight: bold; + text-transform: uppercase; + max-width: 200px; + margin-left: auto; + margin-right: auto; +} + +.intermedio1{ + background-color: indigo; +} +.intermedio2{ + background-color: blue; +} +.intermedio4{ + background-color: yellow; + color: black; +} +.intermedio5{ + background-color: orange; +} .tutor{ @@ -17,24 +45,19 @@ .donatore { background-color: red; + text-transform: uppercase; } .mediatore { background-color: green; + text-transform: uppercase; } .sognatore { background-color: purple; + text-transform: uppercase; } -.intermedio2{ - background-color: orange; -} - -.intermedio3{ - background-color: yellow; - color: black; -} .cont_donatore, .cont_sognatore, .cont_mediatore, .cont_tragitto, .cont_pos, .cont_intestaz, .cont_pos_intest, .cont_intestaz_small { border: solid 2px #4198ef; @@ -51,6 +74,13 @@ .you { background-color: yellow; } +.issognatore { + background-color: orangered; + color: white; + font-size: 1.10rem; + border-radius: 64px; + font-weight: bold; +} .cont_tragitto{ color: blue; @@ -102,7 +132,7 @@ } .titlenave{ - width: 55px; + width: 75px; text-align: center; } diff --git a/src/components/CMyNave/CMyNave.ts b/src/components/CMyNave/CMyNave.ts index ff2909f..f9f6ad8 100755 --- a/src/components/CMyNave/CMyNave.ts +++ b/src/components/CMyNave/CMyNave.ts @@ -25,10 +25,12 @@ export default class CMyNave extends MixinNave { @Prop({ required: false, default: null }) public posizprop @Prop({ required: true }) public navi_partenzaprop: any[] @Prop({ required: true }) public listanavi: boolean + @Prop({ required: false, default: null }) public dashboard: any public navi_partenza: any[] public $t public $v public link_chat: string = '' + public tabnave: string = 'donatore' public cosa: string = 'tragitto' public cosa2: string = 'donatore' public nave: any = null @@ -50,6 +52,11 @@ export default class CMyNave extends MixinNave { public loading: boolean = false public showmsguser: boolean = false public seluser = null + public showtesto: boolean = false + public notifBot: boolean = true + public deleteUser: boolean = true + public AddImbarco: boolean = true + public seltesto: string = '' public msg_tosend_user: string = '' public username_sostituire: string = '' public MyPagination: { @@ -59,7 +66,7 @@ export default class CMyNave extends MixinNave { rowsNumber: number, // specifying this determines pagination is server-side rowsPerPage: number } = { sortBy: 'index', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 } - public coldonatori: any[] = [ + public coldonatori_cell: any[] = [ /*{ name: 'index', required: true, @@ -70,6 +77,23 @@ export default class CMyNave extends MixinNave { },*/ { name: 'name', align: 'center', label: translate('reg.name'), field: 'name', sortable: true }, // { name: 'surname', align: 'center', label: translate('reg.surname'), field: 'surname', sortable: true }, + // { name: 'date_made_gift', align: 'center', label: 'Inviato', field: 'date_made_gift', sortable: true }, + // { name: 'tel', align: 'center', label: 'Tel', field: 'tel', sortable: true }, + { name: 'made_gift', align: 'center', label: 'Conferm.', field: 'made_gift', sortable: true }, + ] + + public coldonatori: any[] = [ + { + name: 'index', + required: true, + label: 'Num', + align: 'left', + field: 'index', + sortable: true + }, + { name: 'nave', align: 'center', label: 'Gift Chat', field: 'nave', sortable: true }, + { name: 'name', align: 'center', label: 'Nome Cognome', field: 'name', sortable: true }, + { name: 'posizione', align: 'center', label: 'Posizione', field: 'posizione', sortable: true }, { name: 'date_made_gift', align: 'center', label: 'Inviato', field: 'date_made_gift', sortable: true }, // { name: 'tel', align: 'center', label: 'Tel', field: 'tel', sortable: true }, { name: 'made_gift', align: 'center', label: 'Conferm.', field: 'made_gift', sortable: true }, @@ -130,6 +154,17 @@ export default class CMyNave extends MixinNave { this.aggiorna() } + public created() { + if (!!tools.getCookie(tools.TABBED_NAVE)) { + this.tabnave = tools.getCookie(tools.TABBED_NAVE) + } + } + + public changetab(val) { + tools.setCookie(tools.TABBED_NAVE, val) + // console.log('setcook', val) + } + public aggiorna() { this.riga = tools.getValDb('riga', false, 1) @@ -232,6 +267,12 @@ export default class CMyNave extends MixinNave { } public sonoMediatore() { + if (!this.nave) + return false + + if (!this.nave.rec.donatore.recmediatore) + return false + if (!!this.nave) { if (!!this.nave.rec.donatore) return this.nave.rec.donatore.recmediatore.ind_order === this.myindorder @@ -245,6 +286,15 @@ export default class CMyNave extends MixinNave { } public partenza_primo_donatore() { + if (!!this.nave) { + if (!!this.mediatore_navepers) { + return this.mediatore_navepers.date_gift_chat_open + } + } + return '' + } + + public fine_doni() { if (!!this.nave) { if (!!this.mediatore_navepers) { return this.mediatore_navepers.date_start @@ -255,13 +305,13 @@ export default class CMyNave extends MixinNave { public getGiornoDelDono() { if (!!this.nave) { - return tools.getstrDate(this.donatore_navepers.date_start) + return tools.getstrDate(this.donatore_navepers.date_gift_chat_open) } } get GiornoDelDonoArrivato() { if (!!this.nave) { - return tools.isDateArrived(this.donatore_navepers.date_start) + return tools.isDateArrived(this.donatore_navepers.date_gift_chat_open) } return false } @@ -408,12 +458,18 @@ export default class CMyNave extends MixinNave { } public sonoSecondaTessituraDonatore() { - const mediatore = this.getmediatore() - for (const rec of this.nave.rec.donatore.arrdonatori) { - if (!!rec) { - if (mediatore) { - if ((mediatore.ind_order === rec.ind_order) && (rec.num_tess % 2) === 0) - return true + if (!!this.nave) { + const mediatore = this.getmediatore() + if (!!this.nave.rec.donatore && !!mediatore) { + if (!!this.nave.rec.donatore.arrdonatori) { + for (const rec of this.nave.rec.donatore.arrdonatori) { + if (!!rec) { + if (mediatore) { + if ((mediatore.ind_order === rec.ind_order) && (rec.num_tess % 2) === 0) + return true + } + } + } } } } @@ -426,8 +482,10 @@ export default class CMyNave extends MixinNave { } public getmediatore() { - if (!!this.nave.rec.mediatore) - return this.nave.rec.mediatore.recmediatore + if (!!this.nave) { + if (!!this.nave.rec.mediatore) + return this.nave.rec.mediatore.recmediatore + } return null } @@ -455,7 +513,10 @@ export default class CMyNave extends MixinNave { return this.donatore_navepers.link_chat } - public getclassSelect(rec) { + public getclassSelect(rec, sognatore, index) { + if (sognatore && index === 0) { + return ' issognatore' + } if (rec.ind_order === this.myindorder) return ' you' } @@ -467,24 +528,24 @@ export default class CMyNave extends MixinNave { else { ris = (this.getrigaNaveByInd(ind)) + '.' + this.getcolNaveByInd(ind) } - let add = '' - // for (let index = 0; index < (4 - ris.length); index++) { - // add += ' ' - // } - - ris = add + ris return ris } public getdatanave(rec) { + if (!this.nave) + return '' + if (this.sonoDonatore()) { if (rec.ind === 1) { - return tools.getstrshortDate(this.nave.date_start) // Donatore + return tools.getstrshortDate(this.nave.date_gift_chat_open) // Donatore } } if (this.sonoMediatore()) { + if (!rec) + return false + if (rec.ind === 4) { - return tools.getstrshortDate(this.nave.date_start) // Mediatore + return tools.getstrshortDate(this.nave.date_gift_chat_open) // Mediatore } } @@ -492,13 +553,24 @@ export default class CMyNave extends MixinNave { const col = this.getcolNaveByInd(rec.ind) const mynavepart = this.getnavePartenzaByRigaCol(riga, col) if (!!mynavepart) { - if (!!mynavepart.date_start) - return tools.getstrshortDate(mynavepart.date_start) + if (!!mynavepart.date_gift_chat_open) + return tools.getstrshortDate(mynavepart.date_gift_chat_open) } return ' --/-- ' // return this.getNavePartByInd(rec.ind) } + public getlinkchat(row) { + const riga = tools.getRiganave(row.riga) + const col = tools.getColnave(row.col) + + const mynavepart = this.getnavePartenzaByRigaCol(riga, col) + if (!!mynavepart) { + if (!!mynavepart.link_chat) + return mynavepart.link_chat + } + } + public getTutor(rec) { const mynavepart = this.getnavePartenzaByRigaCol(rec.riga, rec.col) if (!!mynavepart) @@ -551,10 +623,12 @@ export default class CMyNave extends MixinNave { } public getclpos(rec) { - if (this.NaveeseguitabyInd(this.getrigaNaveByInd(rec.ind))) { - return 'you' - } else { - return '' + if (!!this.dashboard) { + if (this.dashboard.lastnave.riga >= this.getrigaNaveByInd(rec.ind)) { + return 'you' + } else { + return '' + } } } @@ -634,16 +708,27 @@ export default class CMyNave extends MixinNave { return tools.getstrshortDate(mydata) } - public gettitlemediatore() { - return this.getdatastr(this.partenza_primo_donatore()) + ' ' + this.$t('dashboard.nave') + ' ' + this.getisProvvisoriaMediatoreStr() + this.mediatore.riga + '.' + this.mediatore.col + ' ' + '🎁' + this.$t('ws.sitename') + public datefromto() { + if (this.partenza_primo_donatore() !== this.fine_doni()) + // return this.$t('words.da') + ' ' + this.getdatastr(this.partenza_primo_donatore()) + ' ' + this.$t('words.a') + ' ' + this.getdatastr(this.fine_doni()) + return this.getdatastr(this.partenza_primo_donatore()) + ' - ' + this.getdatastr(this.fine_doni()) + else + return this.getdatastr(this.fine_doni()) + } + + public gettitlemediatore(acapo) { + let add = ' - ' + if (acapo) + add = ' ' + return this.datefromto() + add + this.$t('dashboard.nave') + ' ' + this.getisProvvisoriaMediatoreStr() + this.mediatore.riga + '.' + this.mediatore.col + ' ' + '🎁' + this.$t('ws.sitename') } public gettitledonatore() { - return this.getdatastr(this.donatore_navepers.date_start) + ' ' + this.$t('dashboard.nave') + ' ' + this.getisProvvisoriaStr() + this.donatore_navepers.riga + '.' + this.donatore_navepers.col + ' ' + '🎁' + this.$t('ws.sitename') + return this.getdatastr(this.donatore_navepers.date_gift_chat_open) + ' ' + this.$t('dashboard.nave') + ' ' + this.getisProvvisoriaStr() + this.donatore_navepers.riga + '.' + this.donatore_navepers.col + ' ' + '🎁' + this.$t('ws.sitename') } public gettesto() { - return this.$t('dashboard.sonomediatore', { nomenave: this.gettitlemediatore() }) + return this.$t('dashboard.sonomediatore', { nomenave: this.gettitlemediatore(false) }) } public getisProvvisoriaStr() { @@ -761,16 +846,17 @@ export default class CMyNave extends MixinNave { public getpartenza() { let myrec = null - if (this.listanavi) - myrec = this.nave.rec - else { + if (this.listanavi) { + if (!!this.nave) + myrec = this.nave.rec + } else { if (!!this.posiz) myrec = this.posiz.rec } if (!!myrec) if (!!myrec.donatore.navepersistente) - return tools.getstrDate(myrec.donatore.navepersistente.date_start) + return tools.getstrDate(myrec.donatore.navepersistente.date_gift_chat_open) return '' } @@ -826,6 +912,7 @@ export default class CMyNave extends MixinNave { public Chiudi() { this.showmsguser = false + this.showtesto = false } public InviaMsgAUser() { @@ -885,7 +972,15 @@ export default class CMyNave extends MixinNave { await tools.askConfirm(this.$q, 'Sostituisci', notifBottxt + ' ?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.SOSTITUISCI, 0, { param1: user, - param2: { username: usernamesost, riga: user.riga, col: user.col }, + param2: { + username: usernamesost, + username_da_sostituire: user.username, + riga: user.riga, + col: user.col, + notifBot: this.notifBot, + deleteUser: this.deleteUser, + AddImbarco: this.AddImbarco, + }, param3: notifBottxt }) } @@ -894,4 +989,55 @@ export default class CMyNave extends MixinNave { return tools.getRiganave(row.riga) + '.' + tools.getColnave(row.col) } + get gettitolonave() { + if (this.listanavi) + return this.titolonave() + else + return this.$t('dashboard.tragitto') + } + + get getcol() { + if (tools.isMobile()) + return this.coldonatori_cell + else + return this.coldonatori + } + + public getlivellostr(index) { + + let str = '' + str += (7 - index) + '° - ' + if (index === 0) + str += this.$t('dashboard.sognatore') + else if ((index === 1) || (index === 2) || (index === 4) || (index === 5)) + str += this.$t('dashboard.intermedio') + else if (index === 3) + str += this.$t('dashboard.mediatore') + else if (index === 6) + str += this.$t('dashboard.donatori') + + return str + + } + + public getclasselivello(index) { + if (index === 0) + return 'sognatore' + else if (index === 3) + return 'mediatore' + else if (index === 6) + return 'donatore' + else + return 'intermedio' + index + } + + public async Mostraplacca(riga, col) { + const data = { + riga, + col + } + this.showtesto = true + this.seltesto = await GlobalStore.actions.GetData({ data }) + } + } diff --git a/src/components/CMyNave/CMyNave.vue b/src/components/CMyNave/CMyNave.vue index 866047f..d28671c 100755 --- a/src/components/CMyNave/CMyNave.vue +++ b/src/components/CMyNave/CMyNave.vue @@ -1,438 +1,479 @@