Переглянути джерело

Merge branch 'feature/diaria-gus-4leva' into development

Gustavo Zanatta 2 тижнів тому
батько
коміт
5f4d43e8a5

+ 12 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "diarista-cliente-app",
-  "version": "0.0.1",
+  "version": "2.5",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "diarista-cliente-app",
-      "version": "0.0.1",
+      "version": "2.5",
       "dependencies": {
         "@bufbuild/protobuf": "^2.5.1",
         "@capacitor/browser": "^7.0.5",
@@ -16,6 +16,7 @@
         "@capacitor/geolocation": "^7.1.8",
         "@capacitor/google-maps": "^7.2.2",
         "@capacitor/push-notifications": "^7.0.7",
+        "@capacitor/share": "^7.0.4",
         "@quasar/cli": "^2.5.0",
         "@quasar/extras": "^1.17.0",
         "axios": "^1.9.0",
@@ -509,6 +510,15 @@
         "@capacitor/core": ">=7.0.0"
       }
     },
+    "node_modules/@capacitor/share": {
+      "version": "7.0.4",
+      "resolved": "https://registry.npmjs.org/@capacitor/share/-/share-7.0.4.tgz",
+      "integrity": "sha512-wNXxmXUcChrtbZ5jQv8scFIbIGKo3rk6B7qpWySxfUhYJP5NANgAqQ9Z69m0k/zYsucdh66SBU7XW1ykd9aUug==",
+      "license": "MIT",
+      "peerDependencies": {
+        "@capacitor/core": ">=7.0.0"
+      }
+    },
     "node_modules/@capacitor/status-bar": {
       "version": "7.0.1",
       "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-7.0.1.tgz",

+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "@capacitor/geolocation": "^7.1.8",
     "@capacitor/google-maps": "^7.2.2",
     "@capacitor/push-notifications": "^7.0.7",
+    "@capacitor/share": "^7.0.4",
     "@quasar/cli": "^2.5.0",
     "@quasar/extras": "^1.17.0",
     "axios": "^1.9.0",

+ 14 - 6
src/components/profile/ProfileFavoritesDialog.vue

@@ -343,6 +343,7 @@ import diarinho from "src/assets/diarinho_perfil_cliente_favoritos.svg";
 
 import { avatarColorsWithPurple as avatarColors } from "src/helpers/avatarColors";
 
+import { Share } from "@capacitor/share";
 import { computed, onMounted, ref } from "vue";
 
 import {
@@ -437,18 +438,25 @@ const nextSelectedHours = () => {
   }
 };
 
-const openIndicateDialog = (item) => {
+const openIndicateDialog = async (item) => {
   const message = t("profile.favorites.indicate_whatsapp_message", {
     city: item?.city_name ?? "",
     name: item?.provider_name ?? "",
   });
 
-  console.log("[Indicar diarista - WhatsApp]", message);
+  try {
+    await Share.share({
+      title: t("profile.favorites.indicate_title"),
+      text: message,
+      dialogTitle: t("profile.favorites.indicate_btn"),
+    });
+  } catch (error) {
+    if (error?.name === "AbortError") {
+      return;
+    }
 
-  $q.notify({
-    message: t("profile.favorites.indicate_coming_soon"),
-    type: "info",
-  });
+    console.error("Erro ao indicar diarista:", error);
+  }
 };
 
 const prevHighlight = () => {

+ 0 - 1
src/i18n/locales/en.json

@@ -627,7 +627,6 @@
       "indicate_title": "Refer a cleaner to a friend.",
       "indicate_btn": "Refer",
       "indicate_whatsapp_message": "Hi! I use the Diária app to hire cleaners, and I want to recommend a professional: {name} ({city}). You can download the Diária app and view their profile here 👇",
-      "indicate_coming_soon": "Soon you will be able to refer cleaners",
       "providers_title": "Cleaners",
       "until": "Until",
       "schedule_btn": "book",

+ 0 - 1
src/i18n/locales/es.json

@@ -624,7 +624,6 @@
       "indicate_title": "Recomienda un limpiador a un amigo.",
       "indicate_btn": "Recomendar",
       "indicate_whatsapp_message": "¡Hola! Uso la app Diária para contratar limpiadores y quiero recomendarte un profesional: {name} ({city}). Puedes descargar la app Diária y ver su perfil aquí 👇",
-      "indicate_coming_soon": "Pronto podrás recomendar limpiadores",
       "providers_title": "Limpiadores",
       "until": "hasta",
       "schedule_btn": "reservar",

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

@@ -627,7 +627,6 @@
       "indicate_title": "Indique um diarista para um amigo.",
       "indicate_btn": "Indicar",
       "indicate_whatsapp_message": "Oi! Eu uso o aplicativo Diária pra contratar diaristas, e quero te indicar um profissional: {name} ({city}). Você pode baixar o app Diária e ver o perfil dela por aqui 👇",
-      "indicate_coming_soon": "Em breve você poderá indicar diaristas",
       "providers_title": "Diaristas",
       "until": "até",
       "schedule_btn": "agendar",