From ad2d4944818e40dc90482d2d8fee9a942cfcfd8d Mon Sep 17 00:00:00 2001 From: wbuezas Date: Sat, 27 Jul 2024 22:55:40 -0300 Subject: [PATCH 01/14] Create CardList component --- src/components/ui/CardList.vue | 44 +++++++++++++++++++ src/css/app.scss | 10 ++++- src/css/quasar.variables.scss | 2 +- src/pages/Account/AddressList.vue | 66 +++++++++++----------------- src/pages/Ecomerce/PendingOrders.vue | 7 +++ src/router/routes.js | 5 +++ 6 files changed, 91 insertions(+), 43 deletions(-) create mode 100644 src/components/ui/CardList.vue create mode 100644 src/pages/Ecomerce/PendingOrders.vue diff --git a/src/components/ui/CardList.vue b/src/components/ui/CardList.vue new file mode 100644 index 00000000..6846aa3a --- /dev/null +++ b/src/components/ui/CardList.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/css/app.scss b/src/css/app.scss index 90a9aa79..d802cb22 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -1,8 +1,8 @@ // app global css in SCSS form @font-face { - font-family: Poppins; - src: url(./poppins.ttf) format('truetype'); + font-family: Poppins; + src: url(./poppins.ttf) format('truetype'); } @font-face { font-family: 'Open Sans'; @@ -36,3 +36,9 @@ a.link { .q-page-sticky.fixed-bottom-right { margin: 18px; } +.no-border-radius { + border-radius: 0 !important; +} +.no-padding { + padding: 0 !important; +} diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 3707107b..b0df8536 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -15,7 +15,7 @@ $primary: #1a1a1a; $secondary: #26a69a; $accent: #8cc63f; - +$gray-light: #ddd; $dark: #1d1d1d; $dark-page: #121212; diff --git a/src/pages/Account/AddressList.vue b/src/pages/Account/AddressList.vue index 3c56b2aa..6aa920a5 100644 --- a/src/pages/Account/AddressList.vue +++ b/src/pages/Account/AddressList.vue @@ -3,6 +3,8 @@ import { useI18n } from 'vue-i18n'; import { ref, onMounted, inject } from 'vue'; import { useRouter } from 'vue-router'; +import CardList from 'src/components/ui/CardList.vue'; + import useNotify from 'src/composables/useNotify.js'; import { useVnConfirm } from 'src/composables/useVnConfirm.js'; @@ -99,36 +101,33 @@ onMounted(async () => { style="max-width: 544px" separator > - - -
- -
- - {{ address.nickname }} - - {{ address.street }} - - {{ address.postalCode }}, - {{ address.city }} - -
+ + + + - - en-US: addAddress: Add address diff --git a/src/pages/Ecomerce/PendingOrders.vue b/src/pages/Ecomerce/PendingOrders.vue new file mode 100644 index 00000000..32da5694 --- /dev/null +++ b/src/pages/Ecomerce/PendingOrders.vue @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/router/routes.js b/src/router/routes.js index 4be3a3ea..db961d11 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -49,6 +49,11 @@ const routes = [ path: '/ecomerce/invoices', component: () => import('pages/Ecomerce/Invoices.vue') }, + { + name: 'PendingOrders', + path: '/ecomerce/pending', + component: () => import('pages/Ecomerce/PendingOrders.vue') + }, { name: 'catalog', path: '/ecomerce/catalog/:category?/:type?', -- 2.40.1 From 745e9a569c6e3dd8f6794354aa9a74284821af74 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Sun, 28 Jul 2024 18:45:38 -0300 Subject: [PATCH 02/14] Translation files, pending orders, and more changes --- src/components/common/VnForm.vue | 2 +- src/components/ui/CardList.vue | 18 ++-- src/filters/index.js | 3 + src/filters/toCurrency.js | 18 ++++ src/i18n/ca-ES/index.js | 53 +++++++++++ src/i18n/en-US/index.js | 11 ++- src/i18n/es-ES/index.js | 11 ++- src/i18n/fr-FR/index.js | 53 +++++++++++ src/i18n/index.js | 14 ++- src/i18n/pt-PT/index.js | 54 +++++++++++ src/pages/Account/AccountConfig.vue | 2 +- src/pages/Account/AddressDetails.vue | 2 +- src/pages/Account/AddressList.vue | 28 +++--- src/pages/Ecomerce/PendingOrders.vue | 132 ++++++++++++++++++++++++++- src/router/index.js | 27 +++--- src/router/routes.js | 14 +-- 16 files changed, 384 insertions(+), 58 deletions(-) create mode 100644 src/filters/index.js create mode 100644 src/filters/toCurrency.js create mode 100644 src/i18n/ca-ES/index.js create mode 100644 src/i18n/fr-FR/index.js create mode 100644 src/i18n/pt-PT/index.js diff --git a/src/components/common/VnForm.vue b/src/components/common/VnForm.vue index 450f7000..6df7c4da 100644 --- a/src/components/common/VnForm.vue +++ b/src/components/common/VnForm.vue @@ -197,7 +197,7 @@ defineExpose({ :class="{ 'q-mt-md': showBottomActions }" > { - + +en-US: + newOrder: New order + areYouSureDeleteOrder: Are you sure you want to delete the order? +es-ES: + newOrder: Nuevo pedido + areYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido? +ca-ES: + newOrder: Nova comanda + areYouSureDeleteOrder: Segur que vols esborrar la comanda? +fr-FR: + newOrder: Nouvelle commande + areYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande? +pt-PT: + newOrder: Novo pedido + areYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido? + diff --git a/src/router/index.js b/src/router/index.js index 11fc08fc..cbb3e2a3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,12 +1,13 @@ -import { route } from 'quasar/wrappers' -import { appStore } from 'stores/app' +import { route } from 'quasar/wrappers'; +import { appStore } from 'stores/app'; import { createRouter, createMemoryHistory, createWebHistory, createWebHashHistory -} from 'vue-router' -import routes from './routes' +} from 'vue-router'; +import routes from './routes'; +import { i18n } from 'src/boot/i18n'; /* * If not building with SSR mode, you can @@ -22,7 +23,7 @@ export default route(function (/* { store, ssrContext } */) { ? createMemoryHistory : process.env.VUE_ROUTER_MODE === 'history' ? createWebHistory - : createWebHashHistory + : createWebHashHistory; const Router = createRouter({ scrollBehavior: () => ({ left: 0, top: 0 }), @@ -34,18 +35,18 @@ export default route(function (/* { store, ssrContext } */) { history: createHistory( process.env.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE ) - }) + }); Router.afterEach((to, from) => { - if (from.name === to.name) return - const app = appStore() + if (from.name === to.name) return; + const app = appStore(); app.$patch({ - title: window.i18n.t(to.name || 'home'), + title: i18n.global.t(to.name || 'home'), subtitle: null, useRightDrawer: false, rightDrawerOpen: true - }) - }) + }); + }); - return Router -}) + return Router; +}); diff --git a/src/router/routes.js b/src/router/routes.js index db961d11..c2813de0 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -4,7 +4,7 @@ const routes = [ component: () => import('layouts/LoginLayout.vue'), children: [ { - name: 'Login', + name: 'login', path: '/login/:email?', component: () => import('pages/Login/LoginView.vue') }, @@ -35,7 +35,7 @@ const routes = [ component: () => import('src/pages/Cms/HomeView.vue') }, { - name: 'orders', + name: 'confirmedOrders', path: '/ecomerce/orders', component: () => import('pages/Ecomerce/Orders.vue') }, @@ -50,7 +50,7 @@ const routes = [ component: () => import('pages/Ecomerce/Invoices.vue') }, { - name: 'PendingOrders', + name: 'pendingOrders', path: '/ecomerce/pending', component: () => import('pages/Ecomerce/PendingOrders.vue') }, @@ -60,22 +60,22 @@ const routes = [ component: () => import('pages/Ecomerce/Catalog.vue') }, { - name: 'packages', + name: 'agencyPackages', path: '/agencies/packages', component: () => import('src/pages/Agencies/PackagesView.vue') }, { - name: 'Account', + name: 'accountConfig', path: '/account/conf', component: () => import('pages/Account/AccountConfig.vue') }, { - name: 'AddressesList', + name: 'addressesList', path: '/account/address-list', component: () => import('pages/Account/AddressList.vue') }, { - name: 'AddressDetails', + name: 'addressDetails', path: '/account/address/:id?', component: () => import('pages/Account/AddressDetails.vue') } -- 2.40.1 From 67c6f84de37f2440d81f148ba57ea01fa1d15d4d Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 2 Aug 2024 21:56:20 -0300 Subject: [PATCH 03/14] Several changes --- src/App.vue | 10 +- src/boot/app.js | 16 +- src/components/common/VnInput.vue | 10 +- src/components/ui/CardList.vue | 4 +- src/components/ui/TicketDetails.vue | 154 +++++++++++++++ src/components/ui/VnImg.vue | 16 +- src/filters/index.js | 3 - src/filters/toCurrency.js | 18 -- src/i18n/ca-ES/index.js | 5 +- src/i18n/en-US/index.js | 3 + src/i18n/es-ES/index.js | 3 + src/i18n/fr-FR/index.js | 5 +- src/i18n/pt-PT/index.js | 5 +- src/lib/filters.js | 90 +++++---- src/pages/Ecomerce/BasketView.vue | 1 + src/pages/Ecomerce/Catalog.vue | 7 +- src/pages/Ecomerce/CheckoutView.vue | 1 + src/pages/Ecomerce/Invoices.vue | 183 ------------------ src/pages/Ecomerce/InvoicesView.vue | 170 ++++++++++++++++ .../Ecomerce/{Orders.vue => OrdersView.vue} | 155 +++++++-------- src/pages/Ecomerce/PendingOrders.vue | 56 +++--- src/pages/Ecomerce/Ticket.vue | 145 -------------- src/pages/Ecomerce/TicketView.vue | 74 +++++++ src/router/index.js | 4 +- src/router/routes.js | 16 +- src/stores/app.js | 48 ++++- src/stores/index.js | 10 +- 27 files changed, 671 insertions(+), 541 deletions(-) create mode 100644 src/components/ui/TicketDetails.vue delete mode 100644 src/filters/index.js delete mode 100644 src/filters/toCurrency.js create mode 100644 src/pages/Ecomerce/BasketView.vue create mode 100644 src/pages/Ecomerce/CheckoutView.vue delete mode 100644 src/pages/Ecomerce/Invoices.vue create mode 100644 src/pages/Ecomerce/InvoicesView.vue rename src/pages/Ecomerce/{Orders.vue => OrdersView.vue} (63%) delete mode 100644 src/pages/Ecomerce/Ticket.vue create mode 100644 src/pages/Ecomerce/TicketView.vue diff --git a/src/App.vue b/src/App.vue index 69fb8958..54b715a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,10 +2,10 @@ - diff --git a/src/boot/app.js b/src/boot/app.js index 824a26a1..0f2f46e0 100644 --- a/src/boot/app.js +++ b/src/boot/app.js @@ -1,10 +1,10 @@ -import { boot } from 'quasar/wrappers' -import { appStore } from 'stores/app' -import { userStore } from 'stores/user' +import { boot } from 'quasar/wrappers'; +import { useAppStore } from 'stores/app'; +import { userStore } from 'stores/user'; export default boot(({ app }) => { - const props = app.config.globalProperties - props.$app = appStore() - props.$user = userStore() - props.$actions = document.createElement('div') -}) + const props = app.config.globalProperties; + props.$app = useAppStore(); + props.$user = userStore(); + props.$actions = document.createElement('div'); +}); diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 62984159..f8af8001 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -9,7 +9,7 @@ const emit = defineEmits([ 'remove' ]); -const $props = defineProps({ +const props = defineProps({ modelValue: { type: [String, Number], default: null @@ -33,7 +33,7 @@ const requiredFieldRule = val => !!val || t('globals.fieldRequired'); const vnInputRef = ref(null); const value = computed({ get() { - return $props.modelValue; + return props.modelValue; }, set(value) { emit('update:modelValue', value); @@ -41,7 +41,7 @@ const value = computed({ }); const hover = ref(false); const styleAttrs = computed(() => { - return $props.isOutlined + return props.isOutlined ? { dense: true, outlined: true, rounded: true } : {}; }); @@ -88,9 +88,7 @@ const inputRules = [