- versione: 1.2.77
- aggiustamenti e miglioramenti estetici
This commit is contained in:
@@ -1,46 +1,53 @@
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue';
|
||||
|
||||
import { ICalcStat, IOperators } from '../../model'
|
||||
import { useUserStore } from '../../store/UserStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useGlobalStore } from '../../store/globalStore'
|
||||
import { useCircuitStore } from '../../store/CircuitStore'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ICalcStat, IOperators } from '../../model';
|
||||
import { useUserStore } from '../../store/UserStore';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useGlobalStore } from '../../store/globalStore';
|
||||
import { useCircuitStore } from '../../store/CircuitStore';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { costanti, IMainCard } from '@store/Modules/costanti'
|
||||
import { shared_consts } from '@src/common/shared_vuejs';
|
||||
import { costanti, IMainCard } from '@store/Modules/costanti';
|
||||
|
||||
import { CMyUser } from '../CMyUser'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CMyGroup } from '../CMyGroup'
|
||||
import { CCopyBtnSmall } from '../CCopyBtnSmall'
|
||||
import { CContactUser } from '../CContactUser'
|
||||
import { CQRCode } from '../CQRCode'
|
||||
import { CFindUsers } from '../CFindUsers'
|
||||
import { CUserInfoAccount } from '../CUserInfoAccount'
|
||||
import { tools } from '@tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CMyUser } from '../CMyUser';
|
||||
import { CTitleBanner } from '../CTitleBanner';
|
||||
import { CMyGroup } from '../CMyGroup';
|
||||
import { CCopyBtnSmall } from '../CCopyBtnSmall';
|
||||
import { CContactUser } from '../CContactUser';
|
||||
import { CQRCode } from '../CQRCode';
|
||||
import { CFindUsers } from '../CFindUsers';
|
||||
import { CUserInfoAccount } from '../CUserInfoAccount';
|
||||
import { tools } from '@tools';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSendRISTo',
|
||||
props: {},
|
||||
components: {
|
||||
CMyUser, CMyGroup, CUserInfoAccount, CCopyBtnSmall,
|
||||
CTitleBanner, CContactUser, CFindUsers, CQRCode
|
||||
CMyUser,
|
||||
CMyGroup,
|
||||
CUserInfoAccount,
|
||||
CCopyBtnSmall,
|
||||
CTitleBanner,
|
||||
CContactUser,
|
||||
CFindUsers,
|
||||
CQRCode,
|
||||
},
|
||||
setup(props) {
|
||||
const userStore = useUserStore();
|
||||
const globalStore = useGlobalStore();
|
||||
const circuitStore = useCircuitStore();
|
||||
const { t } = useI18n();
|
||||
const $q = useQuasar();
|
||||
const $router = useRouter();
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
const $router = useRouter()
|
||||
const showSendCoin = ref(false);
|
||||
const showReceiveCoin = ref(false);
|
||||
const receiveType = ref('link');
|
||||
const riscallrec = ref(<string>'');
|
||||
|
||||
const showSendCoin = ref(false)
|
||||
const showReceiveCoin = ref(false)
|
||||
const receiveType = ref('link')
|
||||
const riscallrec = ref(<string>'')
|
||||
const btnInviaRIS = ref(null);
|
||||
|
||||
const optionsReceive = ref([
|
||||
{
|
||||
@@ -55,31 +62,39 @@ export default defineComponent({
|
||||
label: 'Genera il QR Code',
|
||||
value: 'qrcode',
|
||||
},
|
||||
])
|
||||
]);
|
||||
|
||||
|
||||
const tipoConto = ref(shared_consts.AccountType.USER)
|
||||
const loading = ref(false)
|
||||
const miolink = ref('')
|
||||
const sendRIS = ref('')
|
||||
const qtyRIS = ref('')
|
||||
const causal = ref('')
|
||||
const tipoConto = ref(shared_consts.AccountType.USER);
|
||||
const loading = ref(false);
|
||||
const miolink = ref('');
|
||||
const sendRIS = ref('');
|
||||
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 : ''
|
||||
})
|
||||
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)
|
||||
})
|
||||
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 showonreclist = ref(false);
|
||||
|
||||
const contact = computed(() => userStore.my)
|
||||
const contact = computed(() => userStore.my);
|
||||
|
||||
const arrTypesAccounts = ref(<any>[
|
||||
{
|
||||
@@ -89,11 +104,11 @@ export default defineComponent({
|
||||
{
|
||||
label: t('circuit.conticollettivi'),
|
||||
value: shared_consts.AccountType.CONTO_DI_GRUPPO,
|
||||
}
|
||||
])
|
||||
},
|
||||
]);
|
||||
|
||||
function mounted() {
|
||||
miolink.value = userStore.getLinkProfileAndRIS('', qtyRIS.value)
|
||||
miolink.value = userStore.getLinkProfileAndRIS('', qtyRIS.value);
|
||||
}
|
||||
|
||||
function limitQuantity() {
|
||||
@@ -102,35 +117,42 @@ export default defineComponent({
|
||||
qtyRIS.value = qtyRIS.value.substring(0, 5); // Limita a 5 caratteri
|
||||
}
|
||||
|
||||
qtyRIS.value = qtyRIS.value.replace(',', '.')
|
||||
qtyRIS.value = qtyRIS.value.replace(',', '.');
|
||||
}
|
||||
|
||||
function clickInviaRIS() {
|
||||
showSendCoin.value = !showSendCoin.value
|
||||
if (showSendCoin.value)
|
||||
showReceiveCoin.value = !showSendCoin.value
|
||||
}
|
||||
|
||||
async function clickriceviRIS() {
|
||||
|
||||
showReceiveCoin.value = !showReceiveCoin.value;
|
||||
if (showReceiveCoin.value)
|
||||
showSendCoin.value = !showReceiveCoin.value
|
||||
if (showReceiveCoin.value)
|
||||
clickAddtoRecList();
|
||||
}
|
||||
|
||||
async function clickAddtoRecList() {
|
||||
const risultato = await tools.addToTemporaryReceiverRIS(t)
|
||||
if (risultato) {
|
||||
riscallrec.value = risultato.msg
|
||||
showonreclist.value = risultato.ris
|
||||
function scrollaBottone() {
|
||||
const btnInviaRIS = document.getElementById('btnInviaRIS');
|
||||
if (btnInviaRIS) {
|
||||
const offset = 30; // spazio desiderato in pixel sopra il bottone
|
||||
const y = btnInviaRIS.getBoundingClientRect().top + window.scrollY - offset;
|
||||
window.scrollTo({ top: y, behavior: 'smooth' });
|
||||
}
|
||||
}
|
||||
|
||||
function clickInviaRIS() {
|
||||
scrollaBottone();
|
||||
|
||||
onMounted(mounted)
|
||||
showSendCoin.value = !showSendCoin.value;
|
||||
if (showSendCoin.value) showReceiveCoin.value = !showSendCoin.value;
|
||||
}
|
||||
|
||||
async function clickriceviRIS() {
|
||||
scrollaBottone();
|
||||
|
||||
showReceiveCoin.value = !showReceiveCoin.value;
|
||||
if (showReceiveCoin.value) showSendCoin.value = !showReceiveCoin.value;
|
||||
if (showReceiveCoin.value) clickAddtoRecList();
|
||||
}
|
||||
|
||||
async function clickAddtoRecList() {
|
||||
const risultato = await tools.addToTemporaryReceiverRIS(t);
|
||||
if (risultato) {
|
||||
riscallrec.value = risultato.msg;
|
||||
showonreclist.value = risultato.ris;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted);
|
||||
|
||||
return {
|
||||
userStore,
|
||||
@@ -157,6 +179,7 @@ export default defineComponent({
|
||||
clickAddtoRecList,
|
||||
clickInviaRIS,
|
||||
clickriceviRIS,
|
||||
}
|
||||
btnInviaRIS,
|
||||
};
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
>
|
||||
<div class="q-mb-sm">
|
||||
<q-btn
|
||||
id="btnInviaRIS"
|
||||
icon="fas fa-upload"
|
||||
color="positive"
|
||||
size="md"
|
||||
|
||||
Reference in New Issue
Block a user