diff --git a/src/components/CMyNave/CMyNave.scss b/src/components/CMyNave/CMyNave.scss index e5d07df..cf0234b 100755 --- a/src/components/CMyNave/CMyNave.scss +++ b/src/components/CMyNave/CMyNave.scss @@ -35,6 +35,10 @@ border-radius: 16px; } +.cont_donatore { + justify-content: space-between; +} + .you { background-color: yellow; } @@ -56,7 +60,7 @@ } .extra{ - opacity: 0.6; + opacity: 1; } .passo{ @@ -106,3 +110,7 @@ .ricevuti{ color: green; } + +.title-nave { + color: blue; +} diff --git a/src/components/CMyNave/CMyNave.ts b/src/components/CMyNave/CMyNave.ts index 6b45e13..f5c14dc 100755 --- a/src/components/CMyNave/CMyNave.ts +++ b/src/components/CMyNave/CMyNave.ts @@ -150,7 +150,7 @@ export default class CMyNave extends MixinNave { for (const rec of this.nave.listadonatoridelsognatore) { index++ - arr.push({ index, ...rec}) + arr.push({ index, ...rec }) } } } @@ -348,6 +348,20 @@ export default class CMyNave extends MixinNave { return !!this.iodonatore } + 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)) + return true + } + } + } + + return false + } + public sonoSognatore() { return !!this.iosognatore } @@ -426,6 +440,10 @@ export default class CMyNave extends MixinNave { } public geticon(rec) { + if (!rec) + return '' + + // console.log('this.rigadoni', this.rigadoni, 'ind', rec.ind) if (!rec.ind) return '' if (this.rigadoni >= this.getrigaNaveByInd(rec.ind)) { @@ -444,7 +462,8 @@ export default class CMyNave extends MixinNave { tools.askConfirm(this.$q, msgtitle, msginvia + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.INVIA_MSG_A_DONATORI, 0, { param1: msgobj, - param2: navemediatore + param2: navemediatore, + param3: tools.TipoMsg.SEND_LINK_CHAT_DONATORI }) } @@ -502,6 +521,13 @@ export default class CMyNave extends MixinNave { return '' } + public getindex(recdonatore, index) { + if (recdonatore.ind_order === this.nave.rec.donatore.recmediatore.ind_order && (recdonatore.num_tess === 2)) + return 'TESS' + + return 'D' + (index) + } + public getposizione() { return this.$t('dashboard.posizione') + ' ' + this.getisProvvisoriaStr() + this.nave.riga + '.' + this.nave.col } diff --git a/src/components/CMyNave/CMyNave.vue b/src/components/CMyNave/CMyNave.vue index e2c5f86..380d34c 100755 --- a/src/components/CMyNave/CMyNave.vue +++ b/src/components/CMyNave/CMyNave.vue @@ -111,13 +111,13 @@
DONATORI:
-
- D{{index + 1}} - {{ donatore.name }} {{ donatore.surname }} ({{ - donatore.username }}) - {{ - donatore.riga}}.{{donatore.col}}
+
+ {{ getindex(donatore, index + 1) }} - {{ donatore.name }} {{ donatore.surname }} + ({{ + donatore.username }}) - {{ donatore.riga}}.{{donatore.col}} +
-
@@ -205,10 +205,18 @@
DONATORI:
-
- D{{index + 1}} - {{ donatore.name }} {{ donatore.surname }} ({{ - donatore.username }}) - {{ - donatore.riga}}.{{donatore.col}}
+
+
+ {{ getindex(donatore, index + 1) }} - {{ donatore.name }} {{ + donatore.surname }} ({{ + donatore.username }}) - {{ + donatore.riga}}.{{donatore.col}}
+ +
+
+ +
@@ -228,82 +236,88 @@
-
+
- -
- -
Quando effettuare il Regalo: {{ getGiornoDelDono() }}
-
- Metodi Disponibili: - - - +
+
-
- Importo: 33€ -
-
-
-
-
-
+
- E' arrivato il momento di Effettuare il proprio Dono!
- Inviare tramite PayPal a: {{ getemailPagamentoSognatore() - }}
- (Scegliere l'opzione "Invia ad Amici")
- - - - - - - - -
- {{$t('dashboard.clicca_conferma_dono')}}:
- -
- - -
-
-
-
- - {{ $t('dashboard.ho_effettuato_il_dono') }} - -
-
+
Quando effettuare il Regalo: {{ getGiornoDelDono() }}
-
- - {{ $t('dashboard.dono_ricevuto') }} - +
+ Metodi Disponibili: + + + +
+
+ Importo: 33€ +
+
+
+
+
+ +
+ + E' arrivato il momento di Effettuare il proprio Dono!
+ Inviare tramite PayPal a: {{ getemailPagamentoSognatore() + }}
+ (Scegliere l'opzione "Invia ad Amici")
+ + + + + + + + +
+ {{$t('dashboard.clicca_conferma_dono')}}:
+ +
+ + +
+
+
+
+ + {{ $t('dashboard.ho_effettuato_il_dono') }} + +
+
+
+
+ + {{ $t('dashboard.dono_ricevuto') }} + +
diff --git a/src/components/CStatus/CStatus.vue b/src/components/CStatus/CStatus.vue index 0edcf0a..4eb5535 100755 --- a/src/components/CStatus/CStatus.vue +++ b/src/components/CStatus/CStatus.vue @@ -1,392 +1,404 @@ diff --git a/src/rootgen/admin/allnavi/allnavi.ts b/src/rootgen/admin/allnavi/allnavi.ts index 792c6ca..a30c1d7 100755 --- a/src/rootgen/admin/allnavi/allnavi.ts +++ b/src/rootgen/admin/allnavi/allnavi.ts @@ -28,5 +28,4 @@ export default class Allnavi extends MixinBase { public async mounted() { this.ris = await GlobalStore.actions.GetArrNavi() } - } diff --git a/src/rootgen/admin/listadoninavi/listadoninavi.scss b/src/rootgen/admin/listadoninavi/listadoninavi.scss index 71d4344..b1e262b 100755 --- a/src/rootgen/admin/listadoninavi/listadoninavi.scss +++ b/src/rootgen/admin/listadoninavi/listadoninavi.scss @@ -9,3 +9,24 @@ .DoniConfermati{ color: green; } + +.cont_donatore { + border: solid 2px #4198ef; + padding: 2px 8px; + margin: 2px 4px; + font-size: 1rem; + border-radius: 16px; +} + +.donatore, .mediatore, .sognatore, .title-nave, .intermedio2, .intermedio3 { + padding: 2px 4px; + margin: 2px 4px; + color: white; + font-size: 1rem; + border-radius: 16px; +} + +.donatore { + background-color: red; +} + diff --git a/src/rootgen/admin/listadoninavi/listadoninavi.ts b/src/rootgen/admin/listadoninavi/listadoninavi.ts index 4f4bd68..e1877d3 100755 --- a/src/rootgen/admin/listadoninavi/listadoninavi.ts +++ b/src/rootgen/admin/listadoninavi/listadoninavi.ts @@ -12,6 +12,7 @@ import { CTitle } from '../../../components/CTitle' import { CMyPage } from '../../../components/CMyPage' import MixinBase from '../../../mixins/mixin-base' import { CMyNave } from '../../../components/CMyNave' +import { lists } from '../../../store/Modules/lists' const namespace = 'CalendarModule' @@ -23,15 +24,31 @@ export default class Listadoninavi extends MixinBase { public $t: any public $q public incaricamento: boolean = false - public myloadingload: boolean = false + public loading: boolean = false + public showdonatori: boolean = false + public showmsguser: boolean = false public arrdoninavi = [] - public MyPagination: { - sortBy: string, - descending: boolean, - page: number, - rowsNumber: number, // specifying this determines pagination is server-side - rowsPerPage: number - } = { sortBy: 'index', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 } + public selrec = null + public seluser = null + public seldonatore = null + public msg_tosend: string = '' + public msg_tosend_user: string = '' + public pagination = { + sortBy: 'desc', + descending: false, + page: 2, + rowsPerPage: 10 + // rowsNumber: xx if getting data from a server + } + + public pagination2 = { + sortBy: 'desc', + descending: false, + page: 2, + rowsPerPage: 8 + // rowsNumber: xx if getting data from a server + } + public coldoninavi: any[] = [ { name: 'index', @@ -42,27 +59,162 @@ export default class Listadoninavi extends MixinBase { sortable: true }, { name: 'rigacol', align: 'center', label: 'Nave', field: 'riga', sortable: true }, - { name: 'date_gift_chat_open', align: 'center', label: '⏰ Gift Chat', field: 'date_gift_chat_open', sortable: true }, + { + name: 'date_gift_chat_open', + align: 'center', + label: '⏰ Gift Chat', + field: 'date_gift_chat_open', + sortable: true + }, { name: 'date_start', align: 'center', label: '⏰ Partenza', field: 'date_start', sortable: true }, { name: 'mediatore', align: 'center', label: 'πŸŒ€ Mediatore', field: '', sortable: true }, { name: 'sognatore', align: 'center', label: 'Sognatore', field: '', sortable: true }, + { name: 'donatori', align: 'center', label: 'Donatori', field: '', sortable: true }, { name: 'DoniAttesaDiConferma', align: 'center', label: '🎁 Wait', field: 'DoniAttesaDiConferma', sortable: true }, { name: 'DoniMancanti', align: 'center', label: '🎁 Mancano', field: 'DoniMancanti', sortable: true }, { name: 'DoniConfermati', align: 'center', label: '🎁 OK', field: 'DoniConfermati', sortable: true }, + { name: 'note', align: 'left', label: 'Note', field: 'note', sortable: true }, + { name: 'note_interne', align: 'left', label: 'Note Interne', field: 'note_interne', sortable: true }, + ] + + public coldonatori: any[] = [ + { + name: 'index', + required: true, + label: 'Num', + align: 'left', + field: 'index', + sortable: true + }, + { name: 'rigacol', align: 'center', label: 'Posizione', field: '', sortable: true }, + { name: 'name', align: 'center', label: 'Nome', field: 'name', sortable: true }, + { name: 'num_tess', align: 'center', label: 'Tessitura', field: 'num_tess', sortable: true }, + { name: 'date_made_gift', align: 'center', label: 'Inviato', field: 'date_made_gift', sortable: true }, + { name: 'made_gift', align: 'center', label: 'Dono', field: 'made_gift', sortable: true }, ] public async mounted() { - this.incaricamento = true - this.$q.loading.show({ message: this.$t('otherpages.update') }) + this.loading = true + // this.$q.loading.show({ message: this.$t('otherpages.update') }) const ris = await GlobalStore.actions.GetArrDoniNavi() console.log('ris', ris) this.arrdoninavi = ris.arrnavi - this.$q.loading.hide() + // this.$q.loading.hide() - this.incaricamento = false + this.loading = false } + public deveDonare(rec) { + return (rec.ind_order !== this.selrec.donatore.recmediatore.ind_order && rec.num_tess === 2) + } + + public clickdonatori(rec) { + this.selrec = rec + this.showdonatori = true + } + + public clickseluser(rec) { + this.seluser = rec + this.showmsguser = true + } + + public HoRicevutoIlDono(rec) { + this.seldonatore = rec + const msgtitle = this.$t('dashboard.dono_ricevuto_2') + const msginvia = this.$t('dashboard.confermi_dono_ricevuto', { + donatore: rec.name + ' ' + rec.surname + }) + + tools.askConfirm(this.$q, msgtitle, msginvia + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.DONO_RICEVUTO, 0, { + param1: { + _id: rec._id, + made_gift: true + }, + param2: '', + param3: '' + }) + + } + + public Chiudi() { + this.showdonatori = false + this.seldonatore = null + } + + public ActionAfterYes(action, item, data) { + console.log('ActionAfterYes...') + if (action === lists.MenuAction.DONO_RICEVUTO) { + if (!!this.seldonatore) { + this.seldonatore.made_gift = true + } + } + } + + public async InviaMsgANave(msgobj, navemediatore) { + + const msgtitle = translate('dialog.sendmsg') + + tools.askConfirm(this.$q, msgtitle, msgobj.msgpar1 + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.INVIA_MSG_A_DONATORI, 0, { + param1: msgobj, + param2: navemediatore, + }) + + } + + public async InviaMsgAUserConfirm(msgobj, navemediatore) { + + const msgtitle = translate('dialog.sendmsg') + + tools.askConfirm(this.$q, msgtitle, msgobj.msgpar1 + ' ' + '?', translate('dialog.yes'), translate('dialog.no'), this, '', lists.MenuAction.INVIA_MSG_A_SINGOLO, 0, { + param1: msgobj, + param2: navemediatore, + }) + + } + + public InviaMsgADonatori() { + + if (!this.msg_tosend) + return + + const msgobj = { + tipomsg: tools.TipoMsg.SEND_MSG, + msgpar1: this.msg_tosend, + inviareale: true, + } + + const navemediatore = this.selrec.donatore.recmediatore + + this.InviaMsgANave(msgobj, navemediatore) + } + + public InviaMsgAUser() { + + if (!this.msg_tosend_user) + return + + const msgobj = { + tipomsg: tools.TipoMsg.SEND_MSG_SINGOLO, + msgpar1: this.msg_tosend_user, + username: this.seluser.username, + inviareale: true, + } + + const naveuser = this.seluser + + this.InviaMsgAUserConfirm(msgobj, naveuser) + } + + public SaveField(rec, myfield) { + if (!!rec) { + const mydata = {} + mydata[myfield] = rec[myfield] + console.log('mydata', mydata, 'id', rec.id) + tools.saveFieldToServer(this, 'navi', rec.id, mydata) + } + } + } diff --git a/src/rootgen/admin/listadoninavi/listadoninavi.vue b/src/rootgen/admin/listadoninavi/listadoninavi.vue index 59fc704..ac20aff 100755 --- a/src/rootgen/admin/listadoninavi/listadoninavi.vue +++ b/src/rootgen/admin/listadoninavi/listadoninavi.vue @@ -13,7 +13,8 @@ title="Doni Navi" :data="arrdoninavi" :columns="coldoninavi" - :Pagination.sync="MyPagination" + :loading="loading" + :Pagination.sync="pagination" row-key="index"> + + + + + + {{$t('dashboard.donatori')}} + + + + +
+
+ + + + +
+
Invia un Messaggio a tutti questi Donatori:
+ + + + +
+ + +
+
+
+
+
+
+
+ + + + + {{$t('dashboard.donatori')}} + + + + +
+
+
+
Invia un Messaggio a {{seluser.name }} {{ seluser.surname }}:
+ + + + +
+ + +
+
+
+
+
+
+
+
diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 4cf02dc..35ccc19 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -215,8 +215,9 @@ const msg_it = { 'cambia la "cronologia per i nuovi membri" da nascosta a visibile.' + '
  • Per trovare il link della Chat appena creata: clicca sul nome della chat in alto, clicca sulla Matita -> "Tipo di Gruppo" -> "invita nel gruppo tramite link", clicca su "copia link" e incollalo qui sotto, sulla casella "Link Gift Chat"
  • ' + '
  • Invia il Link della Gift Chat a tutti i Donatori, cliccando sul bottone qui sotto.
  • ', - sonosognatore: '
    1. Quando sei in questa posizione, verrai invitato ad entrare in una Gift Chat (Telegram) e qui troverai anche gli altri 7 Donatori, il Mediatore, il Sognatore e un rappresentante dello Staff.
    2. ' + + sonodonatore: '
      1. Quando sei in questa posizione, verrai invitato ad entrare in una Gift Chat (Telegram) e qui troverai anche gli altri 7 Donatori, il Mediatore, il Sognatore e un rappresentante dello Staff.
      2. ' + '
      3. Effettuerai il tuo dono ESATTAMENTE il giorno indicato e nella modalitΓ  di pagamento che troverai scritto qui.
      ', + sonodonatore_seconda_tessitura: '
      1. Qui tu sei Mediatore e anche Donatore, ma essendo la seconda Tessitura, non avrai bisogno di effettuare nuovamente il tuo dono
      ', link_chat: 'Link della Gift Chat Telegram', donatori:'Donatori', donatore:'Donatore', @@ -244,6 +245,7 @@ const msg_it = { confermi_dono_ricevuto_msg: '{sognatore} conferma di aver ricevuto il Dono di 33€ da parte di {donatore}', msg_bot_conferma: '{donatore} ha confermato di aver inviato il suo Dono di 33€ a {sognatore}', ricevuto_dono_ok: 'Hai confermato che il dono Γ¨ stato Ricevuto', + entra_in_lavagna: 'Entra sulla Tua Lavagna per vedere le Navi in Partenza', }, reg: { registered: 'Registrato', diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 1a68569..7dd3fa0 100755 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -782,14 +782,15 @@ namespace Actions { }) } - async function InviaMsgADonatori(context, { msgobj, navemediatore }) { + async function InviaMsgADonatori(context, { msgobj, navemediatore, tipomsg }) { console.log('InviaMsgADonatori', msgobj) const mydata = { idapp: process.env.APP_ID, - tipomsg: tools.TipoMsg.SEND_LINK_CHAT_DONATORI, msgextra: msgobj.msgextra, msgpar1: msgobj.msgpar1, + username: msgobj.username, + tipomsg, inviareale: msgobj.inviareale, navemediatore } diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index c857b0b..3717283 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -167,6 +167,7 @@ const colnavi = [ AddCol({ name: 'ind_order', label_trans: 'ind_order' }), AddCol({ name: 'parent_id', label_trans: 'parent_id' }), AddCol({ name: 'date_start', label_trans: 'date_start', fieldtype: tools.FieldType.date }), + AddCol({ name: 'date_gift_chat_open', label_trans: 'date_gift_chat_open', fieldtype: tools.FieldType.date }), AddCol({ name: 'link_chat', label_trans: 'reg.link_chat' }), AddCol({ name: 'sent_msg_howto_make_gift', label_trans: 'sent_msg_howto_make_gift', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'made_gift', label_trans: 'reg.made_gift', fieldtype: tools.FieldType.boolean }), @@ -175,6 +176,8 @@ const colnavi = [ AddCol({ name: 'received_gift', label_trans: 'received_gift', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'date_received_gift', label_trans: 'date_received_gift', fieldtype: tools.FieldType.date }), AddCol({ name: 'num_tess', label_trans: 'num_tess', fieldtype: tools.FieldType.number }), + AddCol({ name: 'note', label_trans: 'note', fieldtype: tools.FieldType.string }), + AddCol({ name: 'note_interne', label_trans: 'note_interne', fieldtype: tools.FieldType.string }), AddCol(DeleteRec), AddCol(DuplicateRec) ] diff --git a/src/store/Modules/lists.ts b/src/store/Modules/lists.ts index 1474d47..c2d6514 100755 --- a/src/store/Modules/lists.ts +++ b/src/store/Modules/lists.ts @@ -22,6 +22,7 @@ export const lists = { DELETE_USERLIST: 335, REGALA_INVITATO: 340, INVIA_MSG_A_DONATORI: 350, + INVIA_MSG_A_SINGOLO: 355, DONO_INVIATO: 360, DONO_RICEVUTO: 370, diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 2300719..4b8f3ee 100755 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -60,6 +60,8 @@ export const tools = { TipoMsg: { SEND_LINK_CHAT_DONATORI: 1, + SEND_MSG: 2, + SEND_MSG_SINGOLO: 3 }, listBestColor: [ @@ -1501,7 +1503,11 @@ export const tools = { }) } else if (func === lists.MenuAction.INVIA_MSG_A_DONATORI) { // console.log('param1', par.param1) - GlobalStore.actions.InviaMsgADonatori({ msgobj: par.param1, navemediatore: par.param2 }).then((ris) => { + GlobalStore.actions.InviaMsgADonatori({ + msgobj: par.param1, + navemediatore: par.param2, + tipomsg: par.param1.tipomsg + }).then((ris) => { if (ris) { if (par.param1.inviareale) tools.showPositiveNotif(myself.$q, myself.$t('dashboard.msg_donatori_ok')) @@ -1509,6 +1515,19 @@ export const tools = { } else tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed')) }) + } else if (func === lists.MenuAction.INVIA_MSG_A_SINGOLO) { + // console.log('param1', par.param1) + GlobalStore.actions.InviaMsgADonatori({ + msgobj: par.param1, + navemediatore: par.param2, + tipomsg: par.param1.tipomsg + }) + .then((ris) => { + if (ris) { + tools.showPositiveNotif(myself.$q, myself.$t('cal.sendmsg_sent')) + } else + tools.showNegativeNotif(myself.$q, myself.$t('db.recfailed')) + }) } else if (func === lists.MenuAction.DONO_INVIATO) { const mydatatosave = { id: par.param1._id, @@ -2402,8 +2421,10 @@ export const tools = { return '337' } else if (Screen.width < 600) { return '400' - } else { + } else if (Screen.width < 900) { return '500' + } else { + return '600' } }, diff --git a/src/views/admin/dbop/dbop.vue b/src/views/admin/dbop/dbop.vue index b13f9d7..db0f4ad 100755 --- a/src/views/admin/dbop/dbop.vue +++ b/src/views/admin/dbop/dbop.vue @@ -1,123 +1,149 @@