Sfoglia il codice sorgente

changes new version + versao no profile

Gustavo Zanatta 1 giorno fa
parent
commit
6adb14f1c6

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "diarista-prestador-app",
-  "version": "0.0.1",
+  "version": "2.2",
   "description": "Aplicativo para o prestador do Diaria",
   "productName": "Diaria Profissional 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");
 
@@ -27,6 +31,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.provider"
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode 12
-        versionName "2.1"
+        versionCode 13
+        versionName "2.2"
         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-prestador-app",
-  "version": "0.0.1",
+  "version": "2.2",
   "description": "Aplicativo para o prestador do Diaria",
   "author": "zntt <zanattagg@gmail.com>",
   "private": true,

+ 15 - 17
src/App.vue

@@ -21,44 +21,42 @@ const $q = useQuasar();
 const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches
   ? "dark"
   : "light";
+  
+const updateStatusBar = async (isDark) => {
+  if (!Capacitor.isNativePlatform()) return;
+
+  await StatusBar.show();
+  await StatusBar.setStyle({
+    style: isDark ? Style.Dark : Style.Light,
+  });
+};
 
 watch(
   () => $q.dark.isActive,
   async (value) => {
-    await Preferences.set({ key: "theme", value: value });
+    await Preferences.set({ key: "theme", value: value ? "dark" : "light" });
+    await updateStatusBar(value);
   },
 );
 
 watch(
   () => locale.value,
   async (value) => {
-    await Preferences.set({ key: "locale", value: value });
+    await Preferences.set({ key: "locale", value });
   },
 );
 
 onBeforeMount(async () => {
-  const isNative = Capacitor.isNativePlatform();
-
   const { value: themePref } = await Preferences.get({ key: "theme" });
   const theme = themePref || systemTheme;
+  const isDark = theme === "dark";
 
-  if (isNative) {
-  await StatusBar.show();
-
-  await StatusBar.setBackgroundColor({
-    color: "#FFFFFF",
-  });
-
-  await StatusBar.setStyle({
-    style: Style.Dark,
-  });
-}
+  $q.dark.set(isDark);
+  await updateStatusBar(isDark);
 
   const { value: localePref } = await Preferences.get({ key: "locale" });
   const userLocale = localePref || window.navigator.language;
 
   console.log(theme, userLocale);
-
-  $q.dark.set(theme === "dark");
 });
 </script>

+ 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;
-}
-
 .flex-grow {
   flex-grow: 1;
   flex-shrink: 1;

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

@@ -529,6 +529,8 @@
     "placeholder_name": "Enter your name",
     "placeholder_email": "Enter your e-mail",
     "placeholder_phone": "Enter your phone",
+    "notifications": "Notifications",
+    "push_notifications": "Receive notifications",
     "bank_data": {
       "title": "Bank data",
       "description": "Accounts to receive your payments",

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

@@ -529,6 +529,8 @@
     "placeholder_name": "Escriba su nombre",
     "placeholder_email": "Escriba su correo electrónico",
     "placeholder_phone": "Escriba su teléfono",
+    "notifications": "Notificaciones",
+    "push_notifications": "Recibir notificaciones",
     "bank_data": {
       "title": "Datos bancarios",
       "description": "Cuentas para recibir tus pagos",

+ 2 - 2
src/layouts/MainLayout.vue

@@ -1,7 +1,7 @@
 <template>
   <q-layout class="main-layout relative" view="hHh lpR fFf">
     <q-header
-      class="system-bar-spacer"
+      class="bg-surface"
       :style="{ height: 'env(safe-area-inset-top)' }"
     >
     </q-header>
@@ -51,7 +51,7 @@
         </component>
       </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>

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

@@ -383,4 +383,14 @@ onMounted(() => {
 
   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

@@ -141,6 +141,10 @@
         <q-space/>
         <q-icon name="mdi-chevron-right" color="primary" 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>
@@ -164,6 +168,8 @@ import { useRouter } from 'vue-router';
 const PRIVACY_POLICY_URL = 'https://politicas.softpar.inf.br/politicas/politicaDiaristaPrestador.html';
 const SUPPORT_PAGE_URL   = 'https://politicas.softpar.inf.br/suportes/suporteDiaristaPrestador.html';
 
+const appVersion = process.env.APP_VERSION;
+
 const $q = useQuasar();
 
 const { logout } = useAuth();