Просмотр исходного кода

feat: :sparkles: feat(notificação chamativa) Foi adicionado no frontend a opção de ativa as notificações do diaria

Foi adicionado no perfil do prestador a opção de ativa as notificações, oprem falta validar no backend para que funcione

fase:dev | origin:escopo
kayo henrique 6 дней назад
Родитель
Сommit
f8a67e3e0e
2 измененных файлов с 37 добавлено и 0 удалено
  1. 2 0
      src/i18n/locales/pt.json
  2. 35 0
      src/pages/profile/ProfileEditDialog.vue

+ 2 - 0
src/i18n/locales/pt.json

@@ -520,6 +520,8 @@
     "placeholder_name": "Digite seu nome",
     "placeholder_email": "Digite seu e-mail",
     "placeholder_phone": "Digite seu telefone",
+    "notifications": "Notificações",
+    "push_notifications": "Receber notificações",
     "bank_data": {
       "title": "Dados bancários",
       "description": "Pix, agência e conta",

+ 35 - 0
src/pages/profile/ProfileEditDialog.vue

@@ -134,6 +134,24 @@
                 :options="translatedGenderOptions"
               />
             </div>
+
+            <!-- NOVA SEÇÃO -->
+            <div>
+              <div class="font12 fontbold q-mb-sm text-grey-8">
+                {{ $t("profile.notifications") }}
+              </div>
+
+              <div class="notification-card">
+                <span class="font14 text-text">
+                  {{ $t("profile.push_notifications") }}
+                </span>
+
+                <q-toggle
+                  v-model="form.push_notifications_enabled"
+                  color="primary"
+                />
+              </div>
+            </div>
           </div>
 
           <q-space />
@@ -194,6 +212,7 @@ const { form, getUpdatedFields, hasUpdatedFields, setUpdateFormAsOriginal } =
     gender: "",
     name: "",
     phone: "",
+    push_notifications_enabled: false,
   });
 
 const capturingPhoto = ref(false);
@@ -328,6 +347,8 @@ onMounted(() => {
   form.gender = data.gender || "";
   form.name = data.name || "";
   form.phone = data.phone || "";
+  form.push_notifications_enabled = data.push_notifications_enabled ??4
+   false;
   profilePhoto.value = data.profile_photo || null;
   providerId.value = data.provider_id || data.provider?.id || null;
   userId.value = data.id;
@@ -348,4 +369,18 @@ onMounted(() => {
 .gender-options :deep(.q-radio__inner--falsy) {
   color: rgba(0, 0, 0, 0.62);
 }
+
+.notification-card {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+
+  min-height: 56px;
+  padding: 0 16px;
+
+  border: 1px solid #e0e0e0;
+  border-radius: 8px;
+
+  background: #fff;
+}
 </style>