- Invia e Ricevi RIS (grafica aggiornata)
- Visualizzazione Movimenti (ultimi e successivi), per singolo e di tutti
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { computed, defineComponent, PropType, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
|
||||
import { ICalcStat, IOperators } from '../../model'
|
||||
import { useUserStore } from '../../store/UserStore'
|
||||
@@ -13,8 +13,10 @@ import { costanti, IMainCard } from '@store/Modules/costanti'
|
||||
import { CMyUser } from '../CMyUser'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CMyGroup } from '../CMyGroup'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
import { CCopyBtnSmall } from '../CCopyBtnSmall'
|
||||
import { CContactUser } from '../CContactUser'
|
||||
import { CQRCode } from '../CQRCode'
|
||||
import { CFindUsers } from '../CFindUsers'
|
||||
import { CUserInfoAccount } from '../CUserInfoAccount'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
@@ -23,8 +25,8 @@ export default defineComponent({
|
||||
name: 'CSendRISTo',
|
||||
props: {},
|
||||
components: {
|
||||
CMyUser, CMyGroup, CUserInfoAccount, CCopyBtn,
|
||||
CTitleBanner, CContactUser
|
||||
CMyUser, CMyGroup, CUserInfoAccount, CCopyBtnSmall,
|
||||
CTitleBanner, CContactUser, CFindUsers, CQRCode
|
||||
},
|
||||
setup(props) {
|
||||
|
||||
@@ -35,21 +37,48 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
const $router = useRouter()
|
||||
|
||||
const receiveRislist = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislist : [])
|
||||
const receiveRislistgroup = computed(() => globalStore.datastat ? globalStore.datastat.receiveRislistgroup : [])
|
||||
const showSendCoin = ref(false)
|
||||
const showReceiveCoin = ref(false)
|
||||
const receiveType = ref('link')
|
||||
const riscallrec = ref(<string>'')
|
||||
|
||||
const optionsReceive = ref([
|
||||
{
|
||||
label: 'Condividi il tuo Link',
|
||||
value: 'link',
|
||||
},
|
||||
{
|
||||
label: 'Rendi visibile il tuo profilo per 8 ore',
|
||||
value: 'showonlist',
|
||||
},
|
||||
{
|
||||
label: 'Genera il QR Code',
|
||||
value: 'qrcode',
|
||||
},
|
||||
])
|
||||
|
||||
const usersList = ref(<any>{ show: false, title: '', list: [], listgroup: [] })
|
||||
|
||||
const tipoConto = ref(shared_consts.AccountType.USER)
|
||||
const loading = ref(false)
|
||||
const miolink = ref('')
|
||||
const sendRIS = ref(false)
|
||||
const riceviRIS = ref(false)
|
||||
const qtyRIS = ref('')
|
||||
const causal = ref('')
|
||||
const circuitpath = computed(() => {
|
||||
const circ = circuitStore.getCircuitByProvinceAndCard(userStore.my.profile.resid_province, userStore.my.profile.resid_card)
|
||||
return circ && circ.path ? circ.path : ''
|
||||
})
|
||||
|
||||
watch(() => qtyRIS.value, (to: any, from: any) => {
|
||||
limitQuantity()
|
||||
miolink.value = userStore.getLinkProfileAndRIS('', qtyRIS.value, causal.value)
|
||||
})
|
||||
watch(() => causal.value, (to: any, from: any) => {
|
||||
miolink.value = userStore.getLinkProfileAndRIS('', qtyRIS.value, causal.value)
|
||||
})
|
||||
|
||||
const showonreclist = ref(false)
|
||||
|
||||
const contact = computed(() => userStore.my)
|
||||
|
||||
const arrTypesAccounts = ref(<any>[
|
||||
@@ -63,36 +92,29 @@ export default defineComponent({
|
||||
}
|
||||
])
|
||||
|
||||
async function sendCoinsToClick() {
|
||||
await updateUserListRIS()
|
||||
function mounted() {
|
||||
miolink.value = userStore.getLinkProfileAndRIS('', qtyRIS.value)
|
||||
}
|
||||
|
||||
if ((globalStore.datastat!.receiveRislist!.length > 0 || (globalStore.datastat!.receiveRislistgroup!.length > 0))) {
|
||||
usersList.value.show = true;
|
||||
usersList.value.title = 'Lista Utenti Riceventi';
|
||||
usersList.value.list = globalStore.datastat!.receiveRislist
|
||||
usersList.value.listgroup = globalStore.datastat!.receiveRislistgroup
|
||||
} else {
|
||||
$router.push(tools.updateLink('/circuits'))
|
||||
function limitQuantity() {
|
||||
// Converte qtyRIS in stringa per verificare la lunghezza
|
||||
if (qtyRIS.value.length > 5) {
|
||||
qtyRIS.value = qtyRIS.value.substring(0, 5); // Limita a 5 caratteri
|
||||
}
|
||||
|
||||
qtyRIS.value = qtyRIS.value.replace(',', '.')
|
||||
}
|
||||
|
||||
async function clickAddtoRecList() {
|
||||
const risultato = await tools.addToTemporaryReceiverRIS(t)
|
||||
if (risultato) {
|
||||
riscallrec.value = risultato.msg
|
||||
showonreclist.value = risultato.ris
|
||||
}
|
||||
}
|
||||
|
||||
async function updateUserListRIS() {
|
||||
const userStore = useUserStore()
|
||||
|
||||
loading.value = true
|
||||
|
||||
await globalStore.getStatSite()
|
||||
|
||||
usersList.value.list = globalStore.datastat!.receiveRislist
|
||||
usersList.value.listgroup = globalStore.datastat!.receiveRislistgroup
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
function clickRiceviRIS() {
|
||||
miolink.value = 'my/'
|
||||
riceviRIS.value = true
|
||||
}
|
||||
onMounted(mounted)
|
||||
|
||||
|
||||
return {
|
||||
@@ -100,20 +122,24 @@ export default defineComponent({
|
||||
tools,
|
||||
costanti,
|
||||
shared_consts,
|
||||
usersList,
|
||||
receiveRislist,
|
||||
receiveRislistgroup,
|
||||
sendCoinsToClick,
|
||||
arrTypesAccounts,
|
||||
tipoConto,
|
||||
updateUserListRIS,
|
||||
loading,
|
||||
contact,
|
||||
circuitpath,
|
||||
sendRIS,
|
||||
riceviRIS,
|
||||
miolink,
|
||||
clickRiceviRIS,
|
||||
qtyRIS,
|
||||
t,
|
||||
causal,
|
||||
limitQuantity,
|
||||
showSendCoin,
|
||||
optionsReceive,
|
||||
receiveType,
|
||||
showReceiveCoin,
|
||||
showonreclist,
|
||||
riscallrec,
|
||||
clickAddtoRecList,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.sendcoins_toso')"
|
||||
@click="sendCoinsToClick"
|
||||
@click="
|
||||
showSendCoin = !showSendCoin;
|
||||
showSendCoin ? (showReceiveCoin = false) : null;
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
@@ -20,24 +23,117 @@
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.receive_coins')"
|
||||
@click="clickRiceviRIS"
|
||||
@click="
|
||||
showReceiveCoin = !showReceiveCoin;
|
||||
showReceiveCoin ? (showSendCoin = false) : null;
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<CTitleBanner
|
||||
v-if="riceviRIS"
|
||||
:class="`q-pa-xs `"
|
||||
:title="$t('circuit.receive_coins')"
|
||||
bgcolor="white"
|
||||
bgcolor2="lightblue"
|
||||
:clcolor="`text-indigo`"
|
||||
:canopen="true"
|
||||
:small="true"
|
||||
:open="true"
|
||||
>
|
||||
<CCopyBtn :title="$t('reg.click_per_copiare')" :texttocopy="miolink">
|
||||
</CCopyBtn>
|
||||
</CTitleBanner>
|
||||
<q-slide-transition>
|
||||
<CTitleBanner
|
||||
v-show="showReceiveCoin"
|
||||
:class="`q-pa-xs `"
|
||||
:title="$t('circuit.receive_coins')"
|
||||
bgcolor="white"
|
||||
bgcolor2="lightblue"
|
||||
:clcolor="`text-indigo`"
|
||||
:canopen="true"
|
||||
:small="true"
|
||||
:open="true"
|
||||
>
|
||||
<q-option-group
|
||||
class="q-ma-xs"
|
||||
style="text-align: left !important"
|
||||
v-model="receiveType"
|
||||
:options="optionsReceive"
|
||||
color="primary"
|
||||
/>
|
||||
<q-tab-panels
|
||||
v-model="receiveType"
|
||||
animated
|
||||
class="shadow-2 rounded-borders"
|
||||
>
|
||||
<q-tab-panel name="link">
|
||||
<div class="row justify-center">
|
||||
<div
|
||||
class="q-ma-xs q-pa-xs"
|
||||
v-html="t('circuit.compila_il_tuo_link_per_ricevere_ris')"
|
||||
></div>
|
||||
|
||||
<q-input
|
||||
v-model="causal"
|
||||
rounded
|
||||
filled
|
||||
maxlength="80"
|
||||
counter
|
||||
:label="$t('circuit.note_richiedente')"
|
||||
class="q-ma-sm full-width q-px-xs"
|
||||
autogrow
|
||||
dense
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="description" class="q-mr-xs" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-input
|
||||
class="q-mb-sm text-h5"
|
||||
style="width: 180px"
|
||||
outlined
|
||||
dense
|
||||
v-model="qtyRIS"
|
||||
:type="'number'"
|
||||
@input="limitQuantity"
|
||||
:label="t('circuit.quantita')"
|
||||
input-class="text-right"
|
||||
input-style="padding-bottom: 14px !important;"
|
||||
v-on:keyup.enter="$event.target.nextElementSibling.focus()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<div class="text-h6">
|
||||
<em
|
||||
class="q-px-sm text-white rounded-borders"
|
||||
style="background-color: #ff5500"
|
||||
>RIS</em
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<CCopyBtnSmall :texttocopy="miolink" :small="true" :btn="true">
|
||||
</CCopyBtnSmall>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="showonlist">
|
||||
<q-btn
|
||||
v-if="!showonreclist"
|
||||
icon="fas fa-upload"
|
||||
color="positive"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.addtothereceiverlist')"
|
||||
@click="clickAddtoRecList"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-slide-transition>
|
||||
<q-banner
|
||||
v-show="riscallrec"
|
||||
rounded
|
||||
class="bg-blue text-white"
|
||||
style="text-align: center"
|
||||
>
|
||||
{{ riscallrec }}
|
||||
<br />
|
||||
</q-banner>
|
||||
</q-slide-transition>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="qrcode">
|
||||
<CQRCode :read="false" textlink="Link Profilo" :link="userStore.getLinkProfileAndRIS('', '', '')"></CQRCode>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</CTitleBanner>
|
||||
</q-slide-transition>
|
||||
<!--<div class="q-mb-sm"></div>
|
||||
|
||||
|
||||
@@ -49,95 +145,27 @@
|
||||
/>-->
|
||||
</div>
|
||||
</div>
|
||||
<q-dialog v-model="usersList.show">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ usersList.title }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
|
||||
<q-card-section class="inset-shadow">
|
||||
<div>{{ $t('circuit.lista_ricev_title') }}</div>
|
||||
|
||||
<div class="row centeritems justify-evenly items-center">
|
||||
<q-btn
|
||||
icon="fas fa-wifi"
|
||||
rounded
|
||||
glossy
|
||||
color="primary"
|
||||
:label="$t('dialog.update')"
|
||||
:disable="loading"
|
||||
@click="updateUserListRIS()"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<q-spinner-radio v-if="loading" class="q-ma-sm" color="brown" />
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="row centeritems">
|
||||
<q-btn-toggle
|
||||
v-if="arrTypesAccounts.length > 0"
|
||||
v-model="tipoConto"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="arrTypesAccounts"
|
||||
/>
|
||||
|
||||
<div v-if="tipoConto === shared_consts.AccountType.USER">
|
||||
<div v-for="(rec, i) in usersList.list" :key="i">
|
||||
<div class="q-pa-xs q-ma-xs q-border q-rounded my-custom-border">
|
||||
<CMyUser
|
||||
:mycontact="rec"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
@setCmd="tools.setCmd"
|
||||
>
|
||||
</CMyUser>
|
||||
<CContactUser
|
||||
:myuser="rec"
|
||||
:showBtnActivities="false"
|
||||
:sendRIS="tools.isUserOk() ? sendRIS : false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
tipoConto === shared_consts.AccountType.COLLECTIVE_ACCOUNT
|
||||
"
|
||||
>
|
||||
<div v-for="(grp, i) in usersList.listgroup" :key="i">
|
||||
<CMyGroup :mygrp="grp" :visu="costanti.USER_GROUPS" :noaut="true">
|
||||
</CMyGroup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
rounded
|
||||
icon="close"
|
||||
v-close-popup
|
||||
:label="$t('dialog.close')"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
rounded
|
||||
:label="$t('circuit.vaialcircuito')"
|
||||
color="primary"
|
||||
:to="tools.updateLink('/circuits')"
|
||||
<div>
|
||||
<q-slide-transition>
|
||||
<CTitleBanner
|
||||
v-show="showSendCoin"
|
||||
:class="`q-pa-xs `"
|
||||
:title="$t('circuit.sendcoins')"
|
||||
bgcolor="white"
|
||||
bgcolor2="lightblue"
|
||||
:clcolor="`text-indigo`"
|
||||
:canopen="true"
|
||||
:small="true"
|
||||
:open="true"
|
||||
>
|
||||
<CFindUsers
|
||||
:actionType="costanti.ACTIONTYPE.SEND_RIS"
|
||||
:sendRIS="sendRIS"
|
||||
>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</CFindUsers>
|
||||
</CTitleBanner>
|
||||
</q-slide-transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CSendRISTo.ts">
|
||||
|
||||
Reference in New Issue
Block a user