diff --git a/quasar.config.js b/quasar.config.js index 0c26af27..378b6e6d 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -14,243 +14,243 @@ const path = require('path'); const { configure } = require('quasar/wrappers'); module.exports = configure(function (ctx) { - return { - // https://v2.quasar.dev/quasar-cli-webpack/supporting-ts - supportTS: false, + return { + // https://v2.quasar.dev/quasar-cli-webpack/supporting-ts + supportTS: false, - // https://v2.quasar.dev/quasar-cli-webpack/prefetch-feature - // preFetch: true, + // https://v2.quasar.dev/quasar-cli-webpack/prefetch-feature + // preFetch: true, - // app boot file (/src/boot) - // --> boot files are part of "main.js" - // https://v2.quasar.dev/quasar-cli-webpack/boot-files - boot: ['i18n', 'axios', 'error-handler', 'app'], + // app boot file (/src/boot) + // --> boot files are part of "main.js" + // https://v2.quasar.dev/quasar-cli-webpack/boot-files + boot: ['i18n', 'axios', 'vnDate', 'error-handler', 'app'], - // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css - css: ['app.scss', 'width.scss', 'responsive.scss'], + // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-css + css: ['app.scss', 'width.scss', 'responsive.scss'], - // https://github.com/quasarframework/quasar/tree/dev/extras - extras: [ - // 'ionicons-v4', - // 'mdi-v5', - // 'fontawesome-v6', - // 'eva-icons', - // 'themify', - // 'line-awesome', - // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both! + // https://github.com/quasarframework/quasar/tree/dev/extras + extras: [ + // 'ionicons-v4', + // 'mdi-v5', + // 'fontawesome-v6', + // 'eva-icons', + // 'themify', + // 'line-awesome', + // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both! - 'roboto-font', // optional, you are not bound to it - 'material-icons' // optional, you are not bound to it - ], + 'roboto-font', // optional, you are not bound to it + 'material-icons' // optional, you are not bound to it + ], - // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-build - build: { - vueRouterMode: 'hash', // available values: 'hash', 'history' + // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-build + build: { + vueRouterMode: 'hash', // available values: 'hash', 'history' - // transpile: false, - // publicPath: '/', + // transpile: false, + // publicPath: '/', - // Add dependencies for transpiling with Babel (Array of string/regex) - // (from node_modules, which are by default not transpiled). - // Applies only if "transpile" is set to true. - // transpileDependencies: [], + // Add dependencies for transpiling with Babel (Array of string/regex) + // (from node_modules, which are by default not transpiled). + // Applies only if "transpile" is set to true. + // transpileDependencies: [], - // rtl: true, // https://quasar.dev/options/rtl-support - // preloadChunks: true, - // showProgress: false, - // gzip: true, - // analyze: true, + // rtl: true, // https://quasar.dev/options/rtl-support + // preloadChunks: true, + // showProgress: false, + // gzip: true, + // analyze: true, - // Options below are automatically set depending on the env, set them if you want to override - // extractCSS: false, + // Options below are automatically set depending on the env, set them if you want to override + // extractCSS: false, - // https://v2.quasar.dev/quasar-cli-webpack/handling-webpack - // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain + // https://v2.quasar.dev/quasar-cli-webpack/handling-webpack + // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain - chainWebpack(chain) { - chain - .plugin('eslint-webpack-plugin') - .use(ESLintPlugin, [{ extensions: ['js', 'vue'] }]); + chainWebpack (chain) { + chain + .plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js', 'vue'] }]); - chain.module - .rule('i18n-resource') - .test(/\.(json5?|ya?ml)$/) - .include.add(path.resolve(__dirname, './src/i18n')) - .end() - .type('javascript/auto') - .use('i18n-resource') - .loader('@intlify/vue-i18n-loader'); - chain.module - .rule('i18n') - .resourceQuery(/blockType=i18n/) - .type('javascript/auto') - .use('i18n') - .loader('@intlify/vue-i18n-loader'); - } - }, + chain.module + .rule('i18n-resource') + .test(/\.(json5?|ya?ml)$/) + .include.add(path.resolve(__dirname, './src/i18n')) + .end() + .type('javascript/auto') + .use('i18n-resource') + .loader('@intlify/vue-i18n-loader'); + chain.module + .rule('i18n') + .resourceQuery(/blockType=i18n/) + .type('javascript/auto') + .use('i18n') + .loader('@intlify/vue-i18n-loader'); + } + }, - // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-devServer - devServer: { - server: { - type: 'http' - }, - port: 8080, - open: false, - // static: __dirname, - headers: { 'Access-Control-Allow-Origin': '*' }, - // stats: { chunks: false }, - proxy: { - '/api': 'http://localhost:3000', - '/': { - target: 'http://localhost:3002', - bypass: req => (req.path !== '/' ? req.path : null) - } - } - }, - - // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-framework - framework: { - config: {}, - autoImportComponentCase: 'pascal', - // iconSet: 'material-icons', // Quasar icon set - // lang: 'en-US', // Quasar language pack - - // For special cases outside of where the auto-import strategy can have an impact - // (like functional components as one of the examples), - // you can manually specify Quasar components/directives to be available everywhere: - // - // components: [], - // directives: [], - - // Quasar plugins - plugins: ['Notify', 'Dialog'] - }, - - // animations: 'all', // --- includes all animations - // https://quasar.dev/options/animations - animations: [], - - // https://v2.quasar.dev/quasar-cli-webpack/developing-ssr/configuring-ssr - ssr: { - pwa: false, - - // manualStoreHydration: true, - // manualPostHydrationTrigger: true, - - prodPort: 3000, // The default port that the production server should use - // (gets superseded if process.env.PORT is specified at runtime) - - maxAge: 1000 * 60 * 60 * 24 * 30, - // Tell browser when a file from the server should expire from cache (in ms) - - chainWebpackWebserver(chain) { - chain - .plugin('eslint-webpack-plugin') - .use(ESLintPlugin, [{ extensions: ['js'] }]); - }, - - middlewares: [ - ctx.prod ? 'compression' : '', - 'render' // keep this as last one - ] - }, - - // https://v2.quasar.dev/quasar-cli-webpack/developing-pwa/configuring-pwa - pwa: { - workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest' - workboxOptions: {}, // only for GenerateSW - - // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts]) - // if using workbox in InjectManifest mode - - chainWebpackCustomSW(chain) { - chain - .plugin('eslint-webpack-plugin') - .use(ESLintPlugin, [{ extensions: ['js'] }]); - }, - - manifest: { - name: 'Hedera', - short_name: 'Hedera', - description: "Verdnatura's webshop", - display: 'standalone', - orientation: 'portrait', - background_color: '#ffffff', - theme_color: '#027be3', - icons: [ - { - src: 'icons/icon-128x128.png', - sizes: '128x128', - type: 'image/png' - }, - { - src: 'icons/icon-192x192.png', - sizes: '192x192', - type: 'image/png' - }, - { - src: 'icons/icon-256x256.png', - sizes: '256x256', - type: 'image/png' - }, - { - src: 'icons/icon-384x384.png', - sizes: '384x384', - type: 'image/png' - }, - { - src: 'icons/icon-512x512.png', - sizes: '512x512', - type: 'image/png' - } - ] - } - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-cordova-apps/configuring-cordova - cordova: { - // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-capacitor-apps/configuring-capacitor - capacitor: { - hideSplashscreen: true - }, - - // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-electron-apps/configuring-electron - electron: { - bundler: 'packager', // 'packager' or 'builder' - - packager: { - // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options - // OS X / Mac App Store - // appBundleId: '', - // appCategoryType: '', - // osxSign: '', - // protocol: 'myapp://path', - // Windows only - // win32metadata: { ... } - }, - - builder: { - // https://www.electron.build/configuration/configuration - - appId: 'hedera-web' - }, - - // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain - - chainWebpackMain(chain) { - chain - .plugin('eslint-webpack-plugin') - .use(ESLintPlugin, [{ extensions: ['js'] }]); - }, - - chainWebpackPreload(chain) { - chain - .plugin('eslint-webpack-plugin') - .use(ESLintPlugin, [{ extensions: ['js'] }]); - } + // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-devServer + devServer: { + server: { + type: 'http' + }, + port: 8080, + open: false, + // static: __dirname, + headers: { 'Access-Control-Allow-Origin': '*' }, + // stats: { chunks: false }, + proxy: { + '/api': 'http://localhost:3000', + '/': { + target: 'http://localhost:3002', + bypass: req => (req.path !== '/' ? req.path : null) } - }; + } + }, + + // https://v2.quasar.dev/quasar-cli-webpack/quasar-config-js#Property%3A-framework + framework: { + config: {}, + autoImportComponentCase: 'pascal', + // iconSet: 'material-icons', // Quasar icon set + // lang: 'en-US', // Quasar language pack + + // For special cases outside of where the auto-import strategy can have an impact + // (like functional components as one of the examples), + // you can manually specify Quasar components/directives to be available everywhere: + // + // components: [], + // directives: [], + + // Quasar plugins + plugins: ['Notify', 'Dialog'] + }, + + // animations: 'all', // --- includes all animations + // https://quasar.dev/options/animations + animations: [], + + // https://v2.quasar.dev/quasar-cli-webpack/developing-ssr/configuring-ssr + ssr: { + pwa: false, + + // manualStoreHydration: true, + // manualPostHydrationTrigger: true, + + prodPort: 3000, // The default port that the production server should use + // (gets superseded if process.env.PORT is specified at runtime) + + maxAge: 1000 * 60 * 60 * 24 * 30, + // Tell browser when a file from the server should expire from cache (in ms) + + chainWebpackWebserver (chain) { + chain + .plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js'] }]); + }, + + middlewares: [ + ctx.prod ? 'compression' : '', + 'render' // keep this as last one + ] + }, + + // https://v2.quasar.dev/quasar-cli-webpack/developing-pwa/configuring-pwa + pwa: { + workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest' + workboxOptions: {}, // only for GenerateSW + + // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts]) + // if using workbox in InjectManifest mode + + chainWebpackCustomSW (chain) { + chain + .plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js'] }]); + }, + + manifest: { + name: 'Hedera', + short_name: 'Hedera', + description: "Verdnatura's webshop", + display: 'standalone', + orientation: 'portrait', + background_color: '#ffffff', + theme_color: '#027be3', + icons: [ + { + src: 'icons/icon-128x128.png', + sizes: '128x128', + type: 'image/png' + }, + { + src: 'icons/icon-192x192.png', + sizes: '192x192', + type: 'image/png' + }, + { + src: 'icons/icon-256x256.png', + sizes: '256x256', + type: 'image/png' + }, + { + src: 'icons/icon-384x384.png', + sizes: '384x384', + type: 'image/png' + }, + { + src: 'icons/icon-512x512.png', + sizes: '512x512', + type: 'image/png' + } + ] + } + }, + + // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-cordova-apps/configuring-cordova + cordova: { + // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing + }, + + // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-capacitor-apps/configuring-capacitor + capacitor: { + hideSplashscreen: true + }, + + // Full list of options: https://v2.quasar.dev/quasar-cli-webpack/developing-electron-apps/configuring-electron + electron: { + bundler: 'packager', // 'packager' or 'builder' + + packager: { + // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options + // OS X / Mac App Store + // appBundleId: '', + // appCategoryType: '', + // osxSign: '', + // protocol: 'myapp://path', + // Windows only + // win32metadata: { ... } + }, + + builder: { + // https://www.electron.build/configuration/configuration + + appId: 'hedera-web' + }, + + // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain + + chainWebpackMain (chain) { + chain + .plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js'] }]); + }, + + chainWebpackPreload (chain) { + chain + .plugin('eslint-webpack-plugin') + .use(ESLintPlugin, [{ extensions: ['js'] }]); + } + } + }; }); diff --git a/src/App.vue b/src/App.vue index 69fb8958..8b15cff2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,11 +1,11 @@ + + - - 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/boot/vnDate.js b/src/boot/vnDate.js new file mode 100644 index 00000000..cbd92e62 --- /dev/null +++ b/src/boot/vnDate.js @@ -0,0 +1,20 @@ +import { boot } from 'quasar/wrappers'; + +export default boot(() => { + Date.vnUTC = () => { + const env = process.env.NODE_ENV; + if (!env || env === 'development') { + return new Date(Date.UTC(2001, 0, 1, 11)); + } + + return new Date(); + }; + + Date.vnNew = () => { + return new Date(Date.vnUTC()); + }; + + Date.vnNow = () => { + return new Date(Date.vnUTC()).getTime(); + }; +}); diff --git a/src/components/common/VnForm.vue b/src/components/common/VnForm.vue index 450f7000..418b8022 100644 --- a/src/components/common/VnForm.vue +++ b/src/components/common/VnForm.vue @@ -184,7 +184,6 @@ defineExpose({ v-if="!loading" ref="addressFormRef" class="column full-width q-gutter-y-xs" - @submit="submit()" > {{ title }} @@ -197,7 +196,7 @@ defineExpose({ :class="{ 'q-mt-md': showBottomActions }" > 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 = [ + + diff --git a/src/components/ui/TicketDetails.vue b/src/components/ui/TicketDetails.vue new file mode 100644 index 00000000..37af51ab --- /dev/null +++ b/src/components/ui/TicketDetails.vue @@ -0,0 +1,152 @@ + + + + + +en-US: + shippingInformation: Shipping Information + preparation: Preparation + delivery: Delivery + agency: Agency + warehouse: Store + deliveryAddress: Delivery address + total: Total + totalTax: Total + IVA +es-ES: + shippingInformation: Datos de envío + preparation: Preparación + delivery: Entrega + agency: Agencia + warehouse: Almacén + deliveryAddress: Dirección de entrega + total: Total + totalTax: Total + IVA +ca-ES: + shippingInformation: Dades d'enviament + preparation: Preparació + delivery: Lliurament + agency: Agència + warehouse: Magatzem + deliveryAddress: Adreça de lliurament + total: Total + totalTax: Total + IVA +fr-FR: + shippingInformation: Informations sur la livraison + preparation: Préparation + delivery: Livraison + warehouse: Entrepôt + deliveryAddress: Adresse de livraison + total: Total + totalTax: Total + IVA +pt-PT: + shippingInformation: Dados de envio + preparation: Preparação + delivery: Entrega + agency: Agência + warehouse: Armazém + deliveryAddress: Endereço de entrega + total: Total + totalTax: Total + IVA + diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index f4e8a36c..31197336 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -1,8 +1,8 @@ - - en-US: addAddress: Add address diff --git a/src/pages/Agencies/PackagesView.vue b/src/pages/Agencies/PackagesView.vue index d9af6e7f..2ef44424 100644 --- a/src/pages/Agencies/PackagesView.vue +++ b/src/pages/Agencies/PackagesView.vue @@ -2,6 +2,8 @@ import { ref, inject, onMounted, computed } from 'vue'; import { useI18n } from 'vue-i18n'; +import VnTable from 'src/components/ui/VnTable.vue'; + const jApi = inject('jApi'); const { t } = useI18n(); @@ -53,32 +55,15 @@ onMounted(() => getPackages()); - - en-US: agency: Agency diff --git a/src/pages/Ecomerce/BasketView.vue b/src/pages/Ecomerce/BasketView.vue new file mode 100644 index 00000000..baac12d6 --- /dev/null +++ b/src/pages/Ecomerce/BasketView.vue @@ -0,0 +1 @@ + diff --git a/src/pages/Ecomerce/Catalog.vue b/src/pages/Ecomerce/Catalog.vue index 0b7220e8..6543cc05 100644 --- a/src/pages/Ecomerce/Catalog.vue +++ b/src/pages/Ecomerce/Catalog.vue @@ -343,19 +343,23 @@ - - -en-US: - noInvoicesFound: No invoices found - serial: Serial - issued: Date - amount: Import - downloadInvoicePdf: Download invoice PDF - notDownloadable: Not available for download, request the invoice to your salesperson -es-ES: - noInvoicesFound: No se han encontrado facturas - serial: Serie - issued: Fecha - amount: Importe - downloadInvoicePdf: Descargar factura en PDF - notDownloadable: No disponible para descarga, solicita la factura a tu comercial -ca-ES: - noInvoicesFound: No s'han trobat factures - serial: Sèrie - issued: Data - amount: Import - downloadInvoicePdf: Descarregar PDF - notDownloadable: No disponible per cescarrega, sol·licita la factura al teu comercial -fr-FR: - noInvoicesFound: Aucune facture trouvée - serial: Série - issued: Date - amount: Montant - downloadInvoicePdf: Télécharger le PDF - notDownloadable: Non disponible en téléchargement, demander la facture à votre commercial -pt-PT: - noInvoicesFound: Nenhuma fatura encontrada - serial: Serie - issued: Data - amount: Importe - downloadInvoicePdf: Baixar PDF - notDownloadable: Não disponível para download, solicite a fatura ao seu comercial - diff --git a/src/pages/Ecomerce/InvoicesView.vue b/src/pages/Ecomerce/InvoicesView.vue new file mode 100644 index 00000000..c21ac9ce --- /dev/null +++ b/src/pages/Ecomerce/InvoicesView.vue @@ -0,0 +1,159 @@ + + + + + +en-US: + noInvoicesFound: No invoices found + invoice: Invoice + issued: Date + amount: Import + downloadInvoicePdf: Download invoice PDF + notDownloadable: Not available for download, request the invoice to your salesperson + requestTheInvoiceToComercial: Request the invoice to your salesperson +es-ES: + noInvoicesFound: No se han encontrado facturas + invoice: Factura + issued: Fecha + amount: Importe + downloadInvoicePdf: Descargar factura en PDF + notDownloadable: No disponible para descarga, solicita la factura a tu comercial + requestTheInvoiceToComercial: Solicita la factura a tu comercial +ca-ES: + noInvoicesFound: No s'han trobat factures + invoice: Factura + issued: Data + amount: Import + downloadInvoicePdf: Descarregar PDF + notDownloadable: No disponible per cescarrega, sol·licita la factura al teu comercial + requestTheInvoiceToComercial: Sol·licita la factura al teu comercial +fr-FR: + noInvoicesFound: Aucune facture trouvée + invoice: Facture + issued: Date + amount: Montant + downloadInvoicePdf: Télécharger le PDF + notDownloadable: Non disponible en téléchargement, demander la facture à votre commercial + requestTheInvoiceToComercial: Demander la facture à votre commercial +pt-PT: + noInvoicesFound: Nenhuma fatura encontrada + invoice: Fatura + issued: Data + amount: Importe + downloadInvoicePdf: Baixar PDF + notDownloadable: Não disponível para download, solicite a fatura ao seu comercial + requestTheInvoiceToComercial: Solicite a fatura ao seu comercial + diff --git a/src/pages/Ecomerce/Orders.vue b/src/pages/Ecomerce/OrdersView.vue similarity index 54% rename from src/pages/Ecomerce/Orders.vue rename to src/pages/Ecomerce/OrdersView.vue index db78e700..75eb6003 100644 --- a/src/pages/Ecomerce/Orders.vue +++ b/src/pages/Ecomerce/OrdersView.vue @@ -1,70 +1,135 @@ + + - - en-US: startOrder: Start order @@ -148,6 +169,7 @@ en-US: disregards future orders. For get your order shipped, this amount must be equal to or greater than 0. If you want to make a down payment, click the payment button, delete the suggested amount and enter the amount you want. + amountToPay: 'Amount to pay (€):' es-ES: startOrder: Empezar pedido noOrdersFound: No se encontrado pedidos @@ -160,6 +182,7 @@ es-ES: esta cantidad debe ser igual o mayor que 0. Si quieres realizar una entrega a cuenta, pulsa el botón de pago, borra la cantidad sugerida e introduce la cantidad que desees. + amountToPay: 'Cantidad a pagar (€):' ca-ES: startOrder: Començar encàrrec noOrdersFound: No s'han trobat comandes @@ -172,6 +195,7 @@ ca-ES: enviat, aquesta quantitat ha de ser igual o més gran que 0. Si vols fer un lliurament a compte, prem el botó de pagament, esborra la quantitat suggerida e introdueix la quantitat que vulguis. + amountToPay: 'Quantitat a pagar (€):' fr-FR: startOrder: Acheter noOrdersFound: Aucune commande trouvée @@ -184,6 +208,7 @@ fr-FR: commande est expédiée, ce montant doit être égal ou supérieur à 0. Si vous voulez faire un versement, le montant suggéré effacé et entrez le montant que vous souhaitez. + amountToPay: 'Montant à payer (€):' pt-PT: startOrder: Iniciar encomenda noOrdersFound: Nenhum pedido encontrado @@ -196,4 +221,5 @@ pt-PT: quantidade deve ser igual ou superior a 0. Se queres realizar um depósito à conta, clique no botão de pagamento, apague a quantidade sugerida e introduza a quantidade que deseje. + amountToPay: 'Valor a pagar (€):' diff --git a/src/pages/Ecomerce/PendingOrders.vue b/src/pages/Ecomerce/PendingOrders.vue new file mode 100644 index 00000000..1309e543 --- /dev/null +++ b/src/pages/Ecomerce/PendingOrders.vue @@ -0,0 +1,135 @@ + + + + + + + +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/pages/Ecomerce/Ticket.vue b/src/pages/Ecomerce/Ticket.vue deleted file mode 100644 index d226fe2a..00000000 --- a/src/pages/Ecomerce/Ticket.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - - - diff --git a/src/pages/Ecomerce/TicketView.vue b/src/pages/Ecomerce/TicketView.vue new file mode 100644 index 00000000..5aecfa35 --- /dev/null +++ b/src/pages/Ecomerce/TicketView.vue @@ -0,0 +1,74 @@ + + + + + +en-US: + printDeliveryNote: Print delivery note +es-ES: + printDeliveryNote: Imprimir albarán +ca-ES: + printDeliveryNote: Imprimir albarà +fr-FR: + printDeliveryNote: Imprimer bulletin de livraison +pt-PT: + printDeliveryNote: Imprimir nota de entrega + diff --git a/src/router/index.js b/src/router/index.js index 11fc08fc..cb8a7ea0 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 { useAppStore } 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 = useAppStore(); 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 4be3a3ea..d8a523ac 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,19 +35,24 @@ const routes = [ component: () => import('src/pages/Cms/HomeView.vue') }, { - name: 'orders', + name: 'confirmedOrders', path: '/ecomerce/orders', - component: () => import('pages/Ecomerce/Orders.vue') + component: () => import('pages/Ecomerce/OrdersView.vue') }, { name: 'ticket', path: '/ecomerce/ticket/:id', - component: () => import('pages/Ecomerce/Ticket.vue') + component: () => import('pages/Ecomerce/TicketView.vue') }, { name: 'invoices', path: '/ecomerce/invoices', - component: () => import('pages/Ecomerce/Invoices.vue') + component: () => import('pages/Ecomerce/InvoicesView.vue') + }, + { + name: 'pendingOrders', + path: '/ecomerce/pending', + component: () => import('pages/Ecomerce/PendingOrders.vue') }, { name: 'catalog', @@ -55,22 +60,32 @@ const routes = [ component: () => import('pages/Ecomerce/Catalog.vue') }, { - name: 'packages', + name: 'basket', + path: '/ecomerce/basket/:id?', + component: () => import('pages/Ecomerce/BasketView.vue') + }, + { + name: 'checkout', + path: '/ecomerce/checkout', + component: () => import('pages/Ecomerce/CheckoutView.vue') + }, + { + 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') } diff --git a/src/stores/app.js b/src/stores/app.js index 95aa70a7..60af8c8e 100644 --- a/src/stores/app.js +++ b/src/stores/app.js @@ -1,19 +1,52 @@ -import { defineStore } from 'pinia' -import { jApi } from 'boot/axios' +import { defineStore } from 'pinia'; +import { jApi } from 'boot/axios'; +import useNotify from 'src/composables/useNotify.js'; -export const appStore = defineStore('hedera', { +const { notify } = useNotify(); + +export const useAppStore = defineStore('hedera', { state: () => ({ title: null, subtitle: null, imageUrl: '', useRightDrawer: false, - rightDrawerOpen: false + rightDrawerOpen: false, + basketOrderId: null, + isHeaderMounted: false }), actions: { - async loadConfig () { - const imageUrl = await jApi.getValue('SELECT url FROM imageConfig') - this.$patch({ imageUrl }) + async init() { + this.getBasketOrderId(); + }, + + getBasketOrderId() { + this.basketOrderId = localStorage.getItem('hederaBasket'); + }, + + async loadConfig() { + const imageUrl = await jApi.getValue('SELECT url FROM imageConfig'); + this.$patch({ imageUrl }); + }, + + async checkOrder(orderId) { + try { + const resultSet = await jApi.execQuery( + 'CALL myOrder_checkConfig(#id)', + { id: orderId } + ); + resultSet.fetchValue(); + } catch (err) { + console.error('Error checking order', err); + } + }, + + loadIntoBasket(orderId) { + if (this.basketOrderId !== orderId) { + localStorage.setItem('hederaBasket', orderId); + this.basketOrderId = orderId; + notify('orderLoadedIntoBasket', 'positive'); + } } } -}) +}); diff --git a/src/stores/index.js b/src/stores/index.js index 94cce71e..d718b663 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -1,5 +1,5 @@ -import { store } from 'quasar/wrappers' -import { createPinia } from 'pinia' +import { store } from 'quasar/wrappers'; +import { createPinia } from 'pinia'; /* * If not building with SSR mode, you can @@ -11,10 +11,10 @@ import { createPinia } from 'pinia' */ export default store((/* { ssrContext } */) => { - const pinia = createPinia() + const pinia = createPinia(); // You can add Pinia plugins here // pinia.use(SomePiniaPlugin) - return pinia -}) + return pinia; +});