diff --git a/src/layout/melissa/MelissaPerfil.vue b/src/layout/melissa/MelissaPerfil.vue index 4ffd232..6e8f62f 100644 --- a/src/layout/melissa/MelissaPerfil.vue +++ b/src/layout/melissa/MelissaPerfil.vue @@ -15,7 +15,7 @@ * Logica de load/save espelhada do ProfilePage.vue (mesmas tabelas * profiles + user_settings + auth.user_metadata, mesmo bucket avatars). */ -import { ref, reactive, computed, onMounted, onBeforeUnmount } from 'vue'; +import { ref, reactive, computed, onMounted, onBeforeUnmount, nextTick } from 'vue'; import { useToast } from 'primevue/usetoast'; import { useConfirm } from 'primevue/useconfirm'; import { useRouter } from 'vue-router'; @@ -402,6 +402,34 @@ async function saveAll() { } } +// ── Ancoras: badge/dica leva pra sessao do form ──────────── +const SECTION_BY_FIELD = { + full_name: 'identidade', + nickname: 'identidade', + work_description: 'identidade', + name: 'identidade', + nick: 'identidade', + work: 'identidade', + avatar: 'avatar', + photo: 'avatar', + bio: 'bio', + phone: 'contato', + social: 'redes' +}; + +function scrollToSection(field) { + const sec = SECTION_BY_FIELD[field]; + if (!sec) return; + // Avatar fica na sidebar; em mobile mantem o drawer aberto (e nao scrolla + // o main, pq a sessao nao existe no main). + const isAvatar = sec === 'avatar'; + if (isMobile.value && !isAvatar) drawerOpen.value = false; + nextTick(() => { + const target = document.getElementById('mpr-sec-' + sec); + if (target) target.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }); +} + // ── Sair da conta ────────────────────────────────────────── function confirmSignOut() { confirm.require({ @@ -557,34 +585,38 @@ onBeforeUnmount(() => {
Conquistas
-
{{ badge.icon }} {{ badge.label }} -
+
O que falta
- {{ tip.text }} - +
-
+
Avatar @@ -642,7 +674,7 @@ onBeforeUnmount(() => {