- 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,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user