Version 1.0.1 with RIS Circuit Money Exchange !

This commit is contained in:
Paolo Arena
2022-09-14 17:37:10 +02:00
parent 25a60472ab
commit f86d8cb7d1
31 changed files with 242 additions and 116 deletions

View File

@@ -31,6 +31,11 @@ export default defineComponent({
required: false,
default: '',
},
color_border: {
type: String,
required: false,
default: '',
},
icon: {
type: String,
required: false,
@@ -58,6 +63,7 @@ export default defineComponent({
return {
showingtooltip,
t,
tools,
}
},
})

View File

@@ -1,5 +1,6 @@
<template>
<div v-if="value !== null" class="text-h5 bordo_stondato_stretto full-width">
<div v-if="value !== null" :class="`text-h5 bordo_stondato_stretto full-width`"
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
<div class="text-center text-h7-dense text-italic text-grey-14">
{{ label }}
</div>
@@ -27,7 +28,7 @@
<q-icon v-else name="fas fa-coins" size="sm"/>
</template>
<template v-slot:control>
<div class="align_elem_right">{{ value.toFixed(2) }}
<div class="align_elem_right">{{ tools.roundDec2(value) }}
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{tips}}</q-tooltip>
</div>
</template>

View File

@@ -48,14 +48,14 @@
</div>
<div v-else-if="mycol.name === 'symbol'">
<div class="text-bacheca">
<div class="text-bacheca text-white">
Simbolo:
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
</div>
</div>
<div v-else-if="mycol.name === 'longdescr'">
<div class="text-bacheca">
<div class="text-bacheca text-black">
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
</div>
</div>

View File

@@ -13,7 +13,7 @@
</div>
<div class="col-6" style="text-align: right">
<span v-if="myTotalPrice" class="text-grey q-mr-xs">Totale:</span> <span
class="text-subtitle1 q-mr-sm "> {{ myTotalPrice.toFixed(2) }}</span>
class="text-subtitle1 q-mr-sm "> {{ myTotalPrice ? myTotalPrice.toFixed(2) : 0 }}</span>
</div>
</div>
<q-separator></q-separator>

View File

@@ -52,22 +52,8 @@ export default defineComponent({
const filtroutente = ref(<any[]>[])
const listcircuitsfiltered = computed(() => {
let arr: any[] = []
try {
if (props.modelValue === costanti.CIRCUITS) {
arr = circuitStore.listcircuits
} else if (props.modelValue === costanti.MY_CIRCUITS ) {
arr = circuitStore.listcircuits.filter((circ: any) => userStore.my.profile.mycircuits.findIndex((rec: any) => circ.name === rec.circuitname) >= 0)
} else if (props.modelValue === costanti.MANAGE_CIRCUITS) {
// arr = userStore.my.profile.manage_mycircuits
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
arr = userStore.my.profile.asked_circuits
}
} catch (e) {
arr = []
}
return arr
console.log('list modif')
return updateListCircuit()
})
const myoptions = computed(() => {
@@ -105,10 +91,29 @@ export default defineComponent({
}
}
function updateListCircuit() {
let arr: any[] = []
try {
if (props.modelValue === costanti.CIRCUITS) {
arr = circuitStore.listcircuits
} else if (props.modelValue === costanti.MY_CIRCUITS ) {
arr = circuitStore.listcircuits.filter((circ: any) => userStore.my.profile.mycircuits.findIndex((rec: any) => circ.name === rec.circuitname) >= 0)
} else if (props.modelValue === costanti.MANAGE_CIRCUITS) {
// arr = userStore.my.profile.manage_mycircuits
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
arr = userStore.my.profile.asked_circuits
}
} catch (e) {
arr = []
}
return arr
}
function mounted() {
username.value = userStore.my.username
loadCircuits()
}
function updateValue(val: number) {
@@ -126,6 +131,7 @@ export default defineComponent({
updateValue,
myoptions,
userStore,
circuitStore,
}
}
})

View File

@@ -20,6 +20,12 @@
<slot></slot>
</div>
<div v-else>
<!--
mycircuits: {{userStore.my.profile.mycircuits}}<br><br>
listcircuitsfiltered: {{listcircuitsfiltered}}
<q-btn label="test" @click="userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, {circuitname: 'prova'}]; circuitStore.listcircuits = [...circuitStore.listcircuits, {name: 'prova', path: 'prova'}]"></q-btn>
-->
<q-list>
<span v-for="(circuit, index) in listcircuitsfiltered" :key="index" class="q-my-sm" clickable>
<CMyCircuit

View File

@@ -10,7 +10,7 @@
<div v-if="col.fieldtype === costanti.FieldType.boolean">
<div v-if="isInModif">
<q-toggle
:disable="!isInModif"
:disable="!isInModif || col.disable"
dark color="green" v-model="myvalue" :label="col.title ? col.title : col.label"
@update:model-value="changevalRec"></q-toggle>
</div>

View File

@@ -43,7 +43,7 @@
<div class="row q-mb-sm no-wrap items-center centeritems">
<div class="text-price no-wrap">
<span v-if="!!myproduct.price"> {{ myproduct.price.toFixed(2) }}</span>
<span v-if="!!myproduct.price"> {{ myproduct.price ? myproduct.price.toFixed(2) : 0 }}</span>
<span v-if="!!myproduct.after_price">{{ myproduct.after_price }}</span>
</div>
</div>

View File

@@ -2,10 +2,10 @@
<CCurrencyValue
:symbol="symbol"
:tips="t('account.saldo_tips')"
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
:color="color"
:value="saldo"
:label="t('account.saldo') + ` (max ` + qtarem + `)`">
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`">
</CCurrencyValue>
</template>

View File

@@ -107,6 +107,9 @@ export default defineComponent({
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
circuitsel.value = bothcircuits.value[0]
}
aggiorna()

View File

@@ -14,6 +14,7 @@
</q-select>
<CSaldo
v-if="circuitloaded"
:symbol="circuitloaded.symbol"
:color="circuitloaded.color"
:saldo="accountloaded ? accountloaded.saldo : 0"
@@ -32,7 +33,7 @@
>
</CMyUser>
<div>
<div v-if="circuitloaded">
<q-input
mask="#.##"
reverse-fill-mask
@@ -40,7 +41,7 @@
class="q-py-sm text-h5"
outlined v-model="qty" type="text"
:rules="[ val => val <= circuitStore.getRemainingCoinsToSend(accountloaded) || t('circuit.qta_remaining_to_send', { maxqta: circuitStore.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]"
:label="t('movement.amount_to_send', {qtamax: circuitStore.getRemainingCoinsToSend(accountloaded).toFixed(2) + ` ` + circuitloaded.symbol})"
:label="t('movement.amount_to_send', {qtamax: circuitStore.getRemainingCoinsToSend(accountloaded) ? circuitStore.getRemainingCoinsToSend(accountloaded).toFixed(2) : 0 + ` ` + circuitloaded.symbol})"
>
<!--val => val > circuitStore.getMaxCoinsToSend(accountloaded) || t('circuit.qta_max_to_send', { maxqta: tools.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]" -->
<template v-slot:append>
@@ -66,7 +67,7 @@
switch-marker-labels-side
:inner-max="remainingCoins"
:min="0"
:max="Number(maxsendable.toFixed(2))"
:max="Number(maxsendable ? maxsendable.toFixed(2) : 0)"
/>
</div>
@@ -76,6 +77,7 @@
</q-card-section>
<q-card-actions align="center">
<q-btn
v-if="circuitloaded"
:disable="qtyRef ? qtyRef.hasError : false"
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="positive"
@click="sendCoin()"></q-btn>

View File

@@ -29,7 +29,7 @@
</div>
</div>
<div class="col-2 no-wrap text-subtitle3 q-mr-sm">
&nbsp;{{ (order.price * order.quantity).toFixed(2) }}
&nbsp;{{ (order.price * order.quantity) ? (order.price * order.quantity).toFixed(2) : 0 }}
</div>
<div class="col-1">
<q-btn v-if="!nomodif" icon="fas fa-times" color="negative" round size="xs" @click="removeFromCard">