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

changes new version + versao no profile

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

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "diarista-cliente-app",
-  "version": "0.0.1",
+  "version": "2.5",
   "description": "Aplicativo para o cliente do Diaria",
   "productName": "Diaria App",
   "author": "zntt <zanattagg@gmail.com>",

+ 5 - 0
quasar.config.js

@@ -14,6 +14,10 @@ const envFiles = {
   prod:    ".env.app.prod",
 };
 
+const appVersion = JSON.parse(
+  readFileSync(resolve(process.cwd(), "package.json"), "utf8"),
+).version;
+
 const loadAppEnv = (ctx) => {
   const appEnv  = process.env.APP_ENV || (ctx.dev ? "dev" : "prod");
   const envFile = envFiles[appEnv];
@@ -26,6 +30,7 @@ const loadAppEnv = (ctx) => {
 
   return {
     APP_ENV:             appEnv,
+    APP_VERSION:         appVersion,
     API_URL:             fileEnv.API_URL,
     PASSWORD:            fileEnv.PASSWORD,
     WEBSOCKET_API:       fileEnv.WEBSOCKET_API,

+ 2 - 2
src-capacitor/android/app/build.gradle

@@ -13,8 +13,8 @@ android {
         applicationId "br.com.diarista.client"
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode 15
-        versionName "2.4"
+        versionCode 16
+        versionName "2.5"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         aaptOptions {
              // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

+ 1 - 1
src-capacitor/package.json

@@ -1,6 +1,6 @@
 {
   "name": "diarista-cliente-app",
-  "version": "0.0.1",
+  "version": "2.5",
   "description": "Aplicativo para o cliente do Diaria",
   "author": "zntt <zanattagg@gmail.com>",
   "private": true,

+ 1 - 5
src/App.vue

@@ -29,12 +29,8 @@ const updateStatusBar = async (isDark) => {
 
   await StatusBar.show();
 
-  await StatusBar.setBackgroundColor({
-    color: isDark ? "#121212" : "#FFFFFF",
-  });
-
   await StatusBar.setStyle({
-    style: isDark ? Style.Light : Style.Dark,
+    style: isDark ? Style.Dark : Style.Light,
   });
 };
 

+ 0 - 29
src/css/app.scss

@@ -1,35 +1,6 @@
 @use "sass:map";
 @use "src/css/quasar.variables.scss";
 
-:root {
-  --system-bar-bg: #757575;
-}
-
-body::before,
-body::after {
-  content: "";
-  position: fixed;
-  left: 0;
-  right: 0;
-  background: var(--system-bar-bg);
-  pointer-events: none;
-  z-index: 10000;
-}
-
-body::before {
-  top: 0;
-  height: env(safe-area-inset-top, 0px);
-}
-
-body::after {
-  bottom: 0;
-  height: env(safe-area-inset-bottom, 0px);
-}
-
-.system-bar-spacer {
-  background: var(--system-bar-bg) !important;
-}
-
 .q-page {
   font-family: "Inter", sans-serif;
 }

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

@@ -578,6 +578,8 @@
     "lang_pt": "PT-br",
     "lang_en": "EN-us",
     "lang_es": "ES-es",
+    "notifications": "Notifications",
+    "push_notifications": "Receive notifications",
     "payments": {
       "title": "Payments",
       "description": "My cards",

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

@@ -575,6 +575,8 @@
     "lang_pt": "PT-br",
     "lang_en": "EN-us",
     "lang_es": "ES-es",
+    "notifications": "Notificaciones",
+    "push_notifications": "Recibir notificaciones",
     "payments": {
       "title": "Pagos",
       "description": "Mis tarjetas",

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

@@ -578,6 +578,8 @@
     "lang_pt": "PT-br",
     "lang_en": "EN-us",
     "lang_es": "ES-es",
+    "notifications": "Notificações",
+    "push_notifications": "Receber notificações",
     "payments": {
       "title": "Pagamentos",
       "description": "Meus cartões",

+ 2 - 2
src/layouts/MainLayout.vue

@@ -5,7 +5,7 @@
   >
     <q-header
       v-if="$q.screen.lt.sm"
-      class="system-bar-spacer"
+      class="bg-surface"
       :style="{ height: `env(safe-area-inset-top)` }"
     >
     </q-header>
@@ -69,7 +69,7 @@
         </router-link>
       </nav>
 
-      <div class="system-bar-spacer provider-bottom-nav-safe-area"></div>
+      <div class="provider-bottom-nav-safe-area"></div>
     </q-footer>
   </q-layout>
 </template>

+ 49 - 1
src/pages/profile/ProfileEditDialog.vue

@@ -205,6 +205,23 @@
                   />
                 </div>
               </div>
+
+              <div>
+                <div class="text-grey-8 q-mb-sm font12 fontbold">
+                  {{ $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 />
@@ -249,7 +266,13 @@ const props = defineProps({
 const { dialogRef, onDialogOK, onDialogCancel } = useDialogPluginComponent();
 
 const { form, getUpdatedFields, hasUpdatedFields, setUpdateFormAsOriginal } =
-  useFormUpdateTracker({ name: "", email: "", phone: "", document: "" });
+  useFormUpdateTracker({
+    name: "",
+    email: "",
+    phone: "",
+    document: "",
+    push_notifications_enabled: false,
+  });
 
 const {
   loading: submitting,
@@ -335,6 +358,7 @@ onMounted(async () => {
     form.email = data.email || "";
     form.phone = data.phone || "";
     form.document = (data.client_document || "").replace(/\D/g, "");
+    form.push_notifications_enabled = data.push_notifications_enabled ?? false;
 
     avatarPreview.value = getProfileMediaUrl(data);
 
@@ -358,4 +382,28 @@ onMounted(async () => {
 .hidden {
   display: none;
 }
+
+.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;
+}
+
+.notification-card :deep(.q-toggle__inner--falsy) {
+  color: rgba(0, 0, 0, 0.62);
+
+  .q-toggle__thumb:after {
+    box-shadow:
+      0 0 0 1px #bdbdbd,
+      0 2px 2px 0 rgba(0, 0, 0, 0.14);
+  }
+}
 </style>

+ 6 - 0
src/pages/profile/ProfilePage.vue

@@ -263,6 +263,10 @@
           size="md"
         />
       </div>
+
+      <div class="text-center text-grey-6 font12 fontregular q-mt-lg q-mb-sm">
+        v{{ appVersion }}
+      </div>
     </div>
   </q-page>
 </template>
@@ -284,6 +288,8 @@ import ProfileHelpDialog from "src/components/profile/ProfileHelpDialog.vue";
 import ProfilePaymentsDialog from "src/components/profile/ProfilePaymentsDialog.vue";
 import ProfilePrivacyDialog from "src/components/profile/ProfilePrivacyDialog.vue";
 
+const appVersion = process.env.APP_VERSION;
+
 const router = useRouter();
 const $q = useQuasar();
 const { logout } = useAuth();