ver 0.5.73:
- corretto invia monete da Conto Collettivo a Utente - Aggiunto Provincia (tutorial).. in corso...
This commit is contained in:
4
src/components/CMyProfileTutorial/CMyProfileTutorial.scss
Executable file
4
src/components/CMyProfileTutorial/CMyProfileTutorial.scss
Executable file
@@ -0,0 +1,4 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
120
src/components/CMyProfileTutorial/CMyProfileTutorial.ts
Executable file
120
src/components/CMyProfileTutorial/CMyProfileTutorial.ts
Executable file
@@ -0,0 +1,120 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch, computed } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { ICircuit, IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { CMySelectCity } from '@/components/CMySelectCity'
|
||||
import { CMySelect } from '@/components/CMySelect'
|
||||
import { CUserInfoAccount } from '@/components/CUserInfoAccount'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyProfileTutorial',
|
||||
components: { CSendCoins, CSaldo, CUserInfoAccount,
|
||||
CMySelectCity, CMyFieldRec, CMySelect },
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
type: Object as PropType<IUserFields | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
myusername: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const showAccountInfo = ref(false)
|
||||
const slide = ref('1')
|
||||
|
||||
const username = ref('')
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const contact = ref(<IUserFields | null>null)
|
||||
const circuit = ref(<ICircuit | null | undefined>null)
|
||||
|
||||
watch(() => props.mycontact, (newval, oldval) => {
|
||||
console.log('watch: mycontact')
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
if (!props.mycontact) {
|
||||
if (props.myusername) {
|
||||
username.value = props.myusername
|
||||
//++Todo: carica contact
|
||||
contact.value = null
|
||||
} else {
|
||||
contact.value = userStore.my
|
||||
}
|
||||
} else {
|
||||
if (props.mycontact) {
|
||||
contact.value = props.mycontact
|
||||
username.value = props.mycontact.username
|
||||
}
|
||||
}
|
||||
|
||||
// circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
}
|
||||
|
||||
function getImgUser(profile: IUserFields) {
|
||||
return userStore.getImgByProfile(profile)
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function setCmd($q: any, cmd: number, myusername: string, value: any, dest: string) {
|
||||
emit('setCmd', $q, cmd, myusername, value, dest)
|
||||
}
|
||||
|
||||
const checkifDisabled = computed(() => {
|
||||
let ret = true
|
||||
if (slide.value === '1') {
|
||||
// Invitante + Email
|
||||
} else if (slide.value === '2') {
|
||||
// Username
|
||||
} else if (slide.value === '3') {
|
||||
// Password
|
||||
}
|
||||
|
||||
return ret
|
||||
})
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
contact,
|
||||
costanti,
|
||||
checkifDisabled,
|
||||
getImgUser,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
tools,
|
||||
showsendCoinTo,
|
||||
circuit,
|
||||
showAccountInfo,
|
||||
slide,
|
||||
}
|
||||
},
|
||||
})
|
||||
104
src/components/CMyProfileTutorial/CMyProfileTutorial.vue
Executable file
104
src/components/CMyProfileTutorial/CMyProfileTutorial.vue
Executable file
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div v-if="contact">
|
||||
<div class="q-gutter-md">
|
||||
<q-carousel
|
||||
v-model="slide"
|
||||
transition-prev="slide-right"
|
||||
transition-next="slide-left"
|
||||
swipeable
|
||||
animated
|
||||
control-color="white"
|
||||
navigation
|
||||
padding
|
||||
arrows
|
||||
height="200px"
|
||||
class="text-white shadow-1 rounded-borders"
|
||||
>
|
||||
<q-carousel-slide name="1" class="column no-wrap flex-center">
|
||||
<q-icon name="house" size="56px" />
|
||||
<div class="q-mt-sm text-center">
|
||||
<CMySelectCity
|
||||
:label="$t('reg.resid_province')"
|
||||
table="users"
|
||||
jointable="provinces"
|
||||
v-model="contact.profile.resid_province"
|
||||
myclass="selectorwide"
|
||||
:db_type="costanti.FieldType.string"
|
||||
db_field="profile"
|
||||
db_subfield="resid_province"
|
||||
:db_id="contact._id"
|
||||
:db_rec="contact"
|
||||
>
|
||||
</CMySelectCity>
|
||||
</div>
|
||||
</q-carousel-slide>
|
||||
<q-carousel-slide name="2" class="column no-wrap flex-center">
|
||||
<q-icon name="live_tv" size="56px" />
|
||||
<div class="q-mt-md text-center"></div>
|
||||
</q-carousel-slide>
|
||||
<q-carousel-slide name="3" class="column no-wrap flex-center">
|
||||
<q-icon name="layers" size="56px" />
|
||||
<div class="q-mt-md text-center"></div>
|
||||
</q-carousel-slide>
|
||||
<q-carousel-slide name="4" class="column no-wrap flex-center">
|
||||
<q-icon name="terrain" size="56px" />
|
||||
<div class="q-mt-md text-center"></div>
|
||||
</q-carousel-slide>
|
||||
<template v-slot:control>
|
||||
<q-carousel-control
|
||||
position="bottom-right"
|
||||
:offset="[18, 18]"
|
||||
class="q-gutter-xs"
|
||||
>
|
||||
<q-btn
|
||||
v-if="slide !== '1'"
|
||||
push
|
||||
text-color="black"
|
||||
icon="arrow_left"
|
||||
:label="$t('dialog.indietro')"
|
||||
@click="$refs.carousel.previous()"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="slide !== '4'"
|
||||
push
|
||||
color="primary"
|
||||
icon="arrow_right"
|
||||
:label="$t('dialog.avanti')"
|
||||
:disabled="checkifDisabled"
|
||||
@click="!checkifDisabled ? $refs.carousel.next() : null"
|
||||
/>
|
||||
</q-carousel-control>
|
||||
</template>
|
||||
</q-carousel>
|
||||
<div class="row justify-center">
|
||||
<q-btn-toggle
|
||||
glossy
|
||||
v-model="slide"
|
||||
:options="[
|
||||
{ label: '1', value: '1' },
|
||||
{ label: 2, value: '2' },
|
||||
{ label: 3, value: '3' },
|
||||
{ label: 4, value: '4' },
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-dialog v-model="showAccountInfo" full-height full-width>
|
||||
<q-card v-if="true">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title class="text-h7">
|
||||
{{ tools.getNomeUtenteByRecUser(contact) }}
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyProfileTutorial.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyProfileTutorial.scss';
|
||||
</style>
|
||||
1
src/components/CMyProfileTutorial/index.ts
Executable file
1
src/components/CMyProfileTutorial/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CMyProfileTutorial } from './CMyProfileTutorial.vue'
|
||||
Reference in New Issue
Block a user