diff --git a/.env.development b/.env.development index b909d09f..68c3cf88 100755 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ -APP_VERSION="1.0.25" +APP_VERSION="1.0.21" SERVICE_WORKER_FILE="service-worker.js" -APP_ID="13" +APP_ID="17" DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_SERVER="freeplanet_serverside" SERVERDIR_WEBSITE="" @@ -12,7 +12,7 @@ LANG_DEFAULT="it" PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" MONGODB_HOST="https://localhost:3000" -LOGO_REG='riso-logo-full.png' +LOGO_REG='piuchebuono-logo-full.png' TEST_NAME="Paolo" TEST_SURNAME="Arena" TEST_EMAIL="" diff --git a/now.txt b/now.txt index 9bc58f3e..e5f5d4ff 100644 --- a/now.txt +++ b/now.txt @@ -1 +1 @@ -TERMINA DI LAVORARE SU piuchebuono.app: (Sovrascrivo !) +TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !) diff --git a/package.json b/package.json index dd32bf35..91a80122 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "riso", - "version": "0.6.1", - "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", - "productName": "Riso", + "name": "piuchebuono", + "version": "2.0.1", + "description": "PiuCheBuono", + "productName": "PiuCheBuono", "author": "Paolo Arena", "private": true, "keywords": [], @@ -17,109 +17,108 @@ "lintfileNoJS": "eslint --ext .ts,.vue --ignore-path .gitignore ./ > file.out.txt", "fix": "eslint --ext .ts,.vue --ignore-path .gitignore ./ --fix > file.out.txt", "pwa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa", - "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --mode debug", + "spa": "NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev --debug", "test": "echo \"No test specified\" && exit 0", "generate-sw": "workbox generateSW workbox-config.js" }, "dependencies": { - "@cubejs-client/core": "^0.31.0", - "@quasar/extras": "^1.16.9", + "@quasar/extras": "^1.16.7", "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.16", - "@vue-leaflet/vue-leaflet": "^0.10.1", - "@vue/compat": "^3.3.9", - "@vue/compiler-sfc": "^3.3.9", + "@vue-leaflet/vue-leaflet": "^0.9.0", + "@vue/compat": "^3.2.47", + "@vue/compiler-sfc": "^3.2.47", "@vue/eslint-config-standard": "7.0.0", - "@vuelidate/core": "^2.0.3", - "@vuelidate/validators": "^2.0.4", - "acorn": "^8.11.2", + "@vuelidate/core": "^2.0.2", + "@vuelidate/validators": "^2.0.2", + "acorn": "^8.8.2", "animate.css": "^4.1.1", - "autoprefixer": "^10.4.16", - "axios": "^1.6.2", + "autoprefixer": "^10.4.14", + "axios": "^1.3.5", "bcryptjs": "^2.4.3", - "chart.js": "^4.0.0", - "core-js": "^3.33.3", + "chart.js": "3.9.1", + "core-js": "^3.30.0", "crypto": "^1.0.1", - "date-fns": "^2.30.0", - "dotenv": "^16.3.1", + "date-fns": "^2.29.3", + "dotenv": "^16.0.3", "echarts": "5.4.2", "eslint-plugin-quasar": "^1.1.0", - "graphql": "^16.8.1", + "graphql": "^16.6.0", "graphql-tag": "^2.12.6", - "gsap": "^3.12.3", - "jquery": "^3.7.1", - "js-cookie": "^3.0.5", - "leaflet": "^1.9.4", + "gsap": "^3.11.5", + "jquery": "^3.6.4", + "js-cookie": "^3.0.1", "localforage": "^1.10.0", "lodash": "^4.17.21", "normalize.css": "^8.0.1", - "npm": "^10.2.4", + "npm": "^9.6.4", "nprogress": "^0.2.0", - "pinia": "^2.1.7", + "pinia": "^2.0.33", "prerender-spa-plugin": "^3.4.0", "quasar": "^2.12.07", "quasar-extras": "^2.0.9", "register-service-worker": "^1.7.2", "typescript-eslint": "^0.0.1-alpha.0", - "vee-validate": "^4.12.2", - "vue": "^3.3.9", + "vee-validate": "^4.8.4", + "vue": "^3.2.47", + "vue-chart-3": "^3.1.8", "vue-class-component": "^8.0.0-rc.1", "vue-country-code": "^1.1.3", - "vue-echarts": "^6.6.1", - "vue-i18n": "^9.8.0", + "vue-echarts": "^6.5.4", + "vue-i18n": "^9.2.2", "vue-idb": "^0.2.0", - "vue-loader": "^17.3.1", + "vue-loader": "^17.0.1", "vue-property-decorator": "^10.0.0-rc.3", - "vue-router": "^4.2.5", - "vue-scroll-reveal": "^2.1.0", + "vue-router": "^4.1.6", + "vue-scroll-reveal": "^1.0.11", "vue-social-sharing": "^4.0.0-alpha4", "vue-svgicon": "^4.0.0-alpha.3", - "vue-timeago3": "^2.3.2", + "vue-timeago3": "^2.3.0", "vue2-dragula": "^2.5.5", + "vue3-pdf-app": "^1.0.3", "vuex": "^4.1.0", "vuex-router-sync": "^6.0.0-rc.1" }, "devDependencies": { "@quasar/app": "^3.3.3", - "@types/bcryptjs": "^2.4.6", + "@types/bcryptjs": "^2.4.2", "@types/dotenv": "^8.2.0", "@types/googlemaps": "^3.43.3", - "@types/jest": "^29.5.10", - "@types/js-cookie": "^3.0.6", - "@types/node": "18.17.0", - "@types/nprogress": "^0.2.3", - "@types/vue-tel-input": "^2.1.6", - "@types/vuelidate": "^0.7.21", - "@typescript-eslint/eslint-plugin": "^6.13.1", - "@typescript-eslint/parser": "^6.13.1", - "eslint": "^8.54.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-import": "^2.29.0", + "@types/jest": "^29.5.0", + "@types/js-cookie": "^3.0.3", + "@types/node": "18.15.11", + "@types/nprogress": "^0.2.0", + "@types/vue-tel-input": "^2.1.2", + "@types/vuelidate": "^0.7.16", + "@typescript-eslint/eslint-plugin": "^6.7.3", + "@typescript-eslint/parser": "^6.7.2", + "eslint": "^8.37.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-vue": "^9.19.2", + "eslint-plugin-vue": "^9.10.0", "file-loader": "^6.2.0", - "html-webpack-plugin": "^5.5.3", + "html-webpack-plugin": "^5.5.0", "http-proxy-middleware": "^2.0.6", - "jest": "^29.7.0", + "jest": "^29.5.0", "json-loader": "^0.5.7", "node-sass": "^9.0.0", - "npm-check-updates": "^16.14.11", + "npm-check-updates": "^16.10.7", "optimize-css-assets-webpack-plugin": "^6.0.1", - "parcel": "^2.6.2", - "postcss": "^8.4.31", - "postcss-loader": "^7.3.3", - "sass-loader": "^13.3.2", - "strip-ansi": "=7.1.0", - "ts-jest": "^29.1.1", - "ts-loader": "^9.5.1", + "postcss": "^8.4.21", + "postcss-loader": "^7.2.4", + "sass-loader": "^13.2.2", + "strip-ansi": "=7.0.1", + "ts-jest": "^29.1.0", + "ts-loader": "^9.4.2", "tslint": "^6.1.3", "tslint-config-standard": "^9.0.0", "tslint-loader": "^3.5.4", - "typescript": "^5.3.2", + "typescript": "^5.2.2", "vue-cli-plugin-element-ui": "^1.1.4", "vueify": "^9.4.1", - "webpack": "^5.89.0", - "workbox-webpack-plugin": "^7.0.0" + "webpack": "^5.78.0", + "workbox-webpack-plugin": "^6.5.4" }, "browser": { "crypto": false diff --git a/public/images/ferrara.jpg b/public/images/ferrara.jpg deleted file mode 100644 index b4615a3a..00000000 Binary files a/public/images/ferrara.jpg and /dev/null differ diff --git a/public/images/foto1.jpg b/public/images/foto1.jpg new file mode 100644 index 00000000..195e9448 Binary files /dev/null and b/public/images/foto1.jpg differ diff --git a/public/images/foto2.jpg b/public/images/foto2.jpg new file mode 100644 index 00000000..940baa89 Binary files /dev/null and b/public/images/foto2.jpg differ diff --git a/public/images/foto3.jpg b/public/images/foto3.jpg new file mode 100644 index 00000000..effb7a77 Binary files /dev/null and b/public/images/foto3.jpg differ diff --git a/public/images/kolibrilab-logo-full.png b/public/images/kolibrilab-logo-full.png new file mode 100755 index 00000000..6915ebba Binary files /dev/null and b/public/images/kolibrilab-logo-full.png differ diff --git a/public/images/marocco_foto1.png b/public/images/marocco_foto1.png new file mode 100644 index 00000000..7dceb8eb Binary files /dev/null and b/public/images/marocco_foto1.png differ diff --git a/public/images/nuda_e_cruda.jpeg b/public/images/nuda_e_cruda.jpeg new file mode 100644 index 00000000..d7912a1e Binary files /dev/null and b/public/images/nuda_e_cruda.jpeg differ diff --git a/public/images/pcb-android-icon-144x144.png b/public/images/pcb-android-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-android-icon-144x144.png differ diff --git a/public/images/pcb-android-icon-192x192.png b/public/images/pcb-android-icon-192x192.png new file mode 100644 index 00000000..93bb5fb7 Binary files /dev/null and b/public/images/pcb-android-icon-192x192.png differ diff --git a/public/images/pcb-android-icon-36x36.png b/public/images/pcb-android-icon-36x36.png new file mode 100644 index 00000000..f700c0d2 Binary files /dev/null and b/public/images/pcb-android-icon-36x36.png differ diff --git a/public/images/pcb-android-icon-48x48.png b/public/images/pcb-android-icon-48x48.png new file mode 100644 index 00000000..4018b080 Binary files /dev/null and b/public/images/pcb-android-icon-48x48.png differ diff --git a/public/images/pcb-android-icon-72x72.png b/public/images/pcb-android-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-android-icon-72x72.png differ diff --git a/public/images/pcb-android-icon-96x96.png b/public/images/pcb-android-icon-96x96.png new file mode 100644 index 00000000..74ae0a32 Binary files /dev/null and b/public/images/pcb-android-icon-96x96.png differ diff --git a/public/images/pcb-apple-icon-114x114.png b/public/images/pcb-apple-icon-114x114.png new file mode 100644 index 00000000..de67dfff Binary files /dev/null and b/public/images/pcb-apple-icon-114x114.png differ diff --git a/public/images/pcb-apple-icon-120x120.png b/public/images/pcb-apple-icon-120x120.png new file mode 100644 index 00000000..5864c9c8 Binary files /dev/null and b/public/images/pcb-apple-icon-120x120.png differ diff --git a/public/images/pcb-apple-icon-144x144.png b/public/images/pcb-apple-icon-144x144.png new file mode 100644 index 00000000..fdea5eb1 Binary files /dev/null and b/public/images/pcb-apple-icon-144x144.png differ diff --git a/public/images/pcb-apple-icon-152x152.png b/public/images/pcb-apple-icon-152x152.png new file mode 100644 index 00000000..6e92509a Binary files /dev/null and b/public/images/pcb-apple-icon-152x152.png differ diff --git a/public/images/pcb-apple-icon-180x180.png b/public/images/pcb-apple-icon-180x180.png new file mode 100644 index 00000000..4d59cedc Binary files /dev/null and b/public/images/pcb-apple-icon-180x180.png differ diff --git a/public/images/pcb-apple-icon-57x57.png b/public/images/pcb-apple-icon-57x57.png new file mode 100644 index 00000000..fb201a9d Binary files /dev/null and b/public/images/pcb-apple-icon-57x57.png differ diff --git a/public/images/pcb-apple-icon-60x60.png b/public/images/pcb-apple-icon-60x60.png new file mode 100644 index 00000000..3b5f1c33 Binary files /dev/null and b/public/images/pcb-apple-icon-60x60.png differ diff --git a/public/images/pcb-apple-icon-72x72.png b/public/images/pcb-apple-icon-72x72.png new file mode 100644 index 00000000..fdaff445 Binary files /dev/null and b/public/images/pcb-apple-icon-72x72.png differ diff --git a/public/images/pcb-apple-icon-76x76.png b/public/images/pcb-apple-icon-76x76.png new file mode 100644 index 00000000..2882992b Binary files /dev/null and b/public/images/pcb-apple-icon-76x76.png differ diff --git a/public/images/pcb-apple-icon.png b/public/images/pcb-apple-icon.png new file mode 100644 index 00000000..422a8dca Binary files /dev/null and b/public/images/pcb-apple-icon.png differ diff --git a/public/images/piuchebuono-logo-full.png b/public/images/piuchebuono-logo-full.png new file mode 100644 index 00000000..5465d80c Binary files /dev/null and b/public/images/piuchebuono-logo-full.png differ diff --git a/public/images/piuchebuono.jpg b/public/images/piuchebuono.jpg new file mode 100644 index 00000000..88e9bab0 Binary files /dev/null and b/public/images/piuchebuono.jpg differ diff --git a/public/images/riso-android-icon-144x144.png b/public/images/riso-android-icon-144x144.png deleted file mode 100644 index 37dcd661..00000000 Binary files a/public/images/riso-android-icon-144x144.png and /dev/null differ diff --git a/public/images/riso-android-icon-192x192.png b/public/images/riso-android-icon-192x192.png deleted file mode 100644 index 95b960e9..00000000 Binary files a/public/images/riso-android-icon-192x192.png and /dev/null differ diff --git a/public/images/riso-android-icon-36x36.png b/public/images/riso-android-icon-36x36.png deleted file mode 100644 index c78a13a3..00000000 Binary files a/public/images/riso-android-icon-36x36.png and /dev/null differ diff --git a/public/images/riso-android-icon-384x384.png b/public/images/riso-android-icon-384x384.png deleted file mode 100644 index ce1ffc47..00000000 Binary files a/public/images/riso-android-icon-384x384.png and /dev/null differ diff --git a/public/images/riso-android-icon-48x48.png b/public/images/riso-android-icon-48x48.png deleted file mode 100644 index 499e8674..00000000 Binary files a/public/images/riso-android-icon-48x48.png and /dev/null differ diff --git a/public/images/riso-android-icon-512x512.png b/public/images/riso-android-icon-512x512.png deleted file mode 100644 index e1c31acd..00000000 Binary files a/public/images/riso-android-icon-512x512.png and /dev/null differ diff --git a/public/images/riso-android-icon-72x72.png b/public/images/riso-android-icon-72x72.png deleted file mode 100644 index f95f7320..00000000 Binary files a/public/images/riso-android-icon-72x72.png and /dev/null differ diff --git a/public/images/riso-android-icon-96x96.png b/public/images/riso-android-icon-96x96.png deleted file mode 100644 index 98dbf9d9..00000000 Binary files a/public/images/riso-android-icon-96x96.png and /dev/null differ diff --git a/public/images/riso-apple-icon-114x114.png b/public/images/riso-apple-icon-114x114.png deleted file mode 100644 index 882dd21c..00000000 Binary files a/public/images/riso-apple-icon-114x114.png and /dev/null differ diff --git a/public/images/riso-apple-icon-120x120.png b/public/images/riso-apple-icon-120x120.png deleted file mode 100644 index 734b0503..00000000 Binary files a/public/images/riso-apple-icon-120x120.png and /dev/null differ diff --git a/public/images/riso-apple-icon-144x144.png b/public/images/riso-apple-icon-144x144.png deleted file mode 100644 index 923da7be..00000000 Binary files a/public/images/riso-apple-icon-144x144.png and /dev/null differ diff --git a/public/images/riso-apple-icon-152x152.png b/public/images/riso-apple-icon-152x152.png deleted file mode 100644 index 84fd455d..00000000 Binary files a/public/images/riso-apple-icon-152x152.png and /dev/null differ diff --git a/public/images/riso-apple-icon-180x180.png b/public/images/riso-apple-icon-180x180.png deleted file mode 100644 index e457d906..00000000 Binary files a/public/images/riso-apple-icon-180x180.png and /dev/null differ diff --git a/public/images/riso-apple-icon-57x57.png b/public/images/riso-apple-icon-57x57.png deleted file mode 100644 index f5f538db..00000000 Binary files a/public/images/riso-apple-icon-57x57.png and /dev/null differ diff --git a/public/images/riso-apple-icon-60x60.png b/public/images/riso-apple-icon-60x60.png deleted file mode 100644 index 4121f834..00000000 Binary files a/public/images/riso-apple-icon-60x60.png and /dev/null differ diff --git a/public/images/riso-apple-icon-72x72.png b/public/images/riso-apple-icon-72x72.png deleted file mode 100644 index 5efd872d..00000000 Binary files a/public/images/riso-apple-icon-72x72.png and /dev/null differ diff --git a/public/images/riso-apple-icon-76x76.png b/public/images/riso-apple-icon-76x76.png deleted file mode 100644 index 6db4b76f..00000000 Binary files a/public/images/riso-apple-icon-76x76.png and /dev/null differ diff --git a/public/images/riso-apple-icon.png b/public/images/riso-apple-icon.png deleted file mode 100644 index cfaeb3c0..00000000 Binary files a/public/images/riso-apple-icon.png and /dev/null differ diff --git a/public/images/riso-logo-full.png b/public/images/riso-logo-full.png deleted file mode 100644 index 38a9695f..00000000 Binary files a/public/images/riso-logo-full.png and /dev/null differ diff --git a/public/images/riso_home.png b/public/images/riso_home.png deleted file mode 100644 index e2e4c5d1..00000000 Binary files a/public/images/riso_home.png and /dev/null differ diff --git a/public/images/riso_home_dark.png b/public/images/riso_home_dark.png deleted file mode 100644 index f8572648..00000000 Binary files a/public/images/riso_home_dark.png and /dev/null differ diff --git a/public/images/riso_services.png b/public/images/riso_services.png deleted file mode 100644 index 85a940bc..00000000 Binary files a/public/images/riso_services.png and /dev/null differ diff --git a/quasar.conf.js b/quasar.conf.js index 640a0360..20184824 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -94,6 +94,7 @@ module.exports = configure((ctx) => ({ transpileDependencies: [ /quasar-ui-qcalendar[\\/]src/ ], + devtool: 'source-map', chainWebpack(chain, { isServer, isClient }) { chain.resolve.alias @@ -147,9 +148,8 @@ module.exports = configure((ctx) => ({ }, devServer: { https: false, - port: 8084, + port: 8088, open: false, // opens browser window automatically - hot: false, // Disable hot module replacement headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', @@ -306,9 +306,9 @@ module.exports = configure((ctx) => ({ }, manifest: { - name: 'Riso', - short_name: 'Riso', - description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.', + name: 'Più che Buono', + short_name: 'PiuCheBuono', + description: 'PiuCheBuono è un GAS e Bottega', display: 'standalone', orientation: 'portrait', background_color: '#fff', @@ -318,54 +318,54 @@ module.exports = configure((ctx) => ({ start_url: "/?homescreen=1", icons: [ { - src: 'images/riso-android-icon-512x512.png', + src: 'images/pcb-android-icon-512x512.png', sizes: '512x512', type: 'image/png', }, { - src: 'images/riso-android-icon-384x384.png', + src: 'images/pcb-android-icon-384x384.png', sizes: '384x384', type: 'image/png', }, { - src: 'images/riso-android-icon-192x192.png', + src: 'images/pcb-android-icon-192x192.png', sizes: '192x192', type: 'image/png', }, { - src: 'images/riso-android-icon-144x144.png', + src: 'images/pcb-android-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-android-icon-96x96.png', + src: 'images/pcb-android-icon-96x96.png', sizes: '96x96', type: 'image/png', }, { - src: 'images/riso-apple-icon-120x120.png', + src: 'images/pcb-apple-icon-120x120.png', sizes: '120x120', type: 'image/png', }, { - src: 'images/riso-apple-icon-144x144.png', + src: 'images/pcb-apple-icon-144x144.png', sizes: '144x144', type: 'image/png', }, { - src: 'images/riso-apple-icon-152x152.png', + src: 'images/pcb-apple-icon-152x152.png', sizes: '152x152', type: 'image/png', }, { - src: 'images/riso-apple-icon-180x180.png', + src: 'images/pcb-apple-icon-180x180.png', sizes: '180x180', type: 'image/png', }, ], related_applications: [{ "platform": "webapp", - "url": "https://www.riso.app/manifest.json" + "url": "https://www.piuchebuono.app/manifest.json" }] }, }, @@ -400,7 +400,7 @@ module.exports = configure((ctx) => ({ builder: { // https://www.electron.build/configuration/configuration - appId: 'Riso', + appId: 'PiuCheBuono', }, // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain diff --git a/src/components/CSingleCart/CSingleCart.ts b/src/components/CSingleCart/CSingleCart.ts index db0c49ad..19ca444f 100755 --- a/src/components/CSingleCart/CSingleCart.ts +++ b/src/components/CSingleCart/CSingleCart.ts @@ -47,6 +47,8 @@ export default defineComponent({ const $q = useQuasar() const orderQuantity = ref(undefined); + const weight = ref(undefined); + const price = ref(undefined); const orderQuantityPreordered = ref(undefined); const orderTotalPriceProduct = ref(undefined); @@ -64,6 +66,26 @@ export default defineComponent({ enableChangeTotalPrice.value = false }); + watch(weight, (newValue: any) => { + if (order.value.product) { + if (!newValue) + order.value.product.productInfo.weight = 0 + else + order.value.product.productInfo.weight = parseFloat(newValue); + } + enableChangeTotalPrice.value = false + }); + + watch(price, (newValue: any) => { + if (order.value) { + if (!newValue) + order.value.price = 0 + else + order.value.price = parseFloat(newValue); + } + enableChangeTotalPrice.value = false + }); + watch(orderQuantityPreordered, (newValue: any) => { if (!newValue) order.value.quantitypreordered = 0 @@ -137,7 +159,7 @@ export default defineComponent({ function isApplicatoSconto() { const totalipotetico = order.value.product!.price * (order.value.quantity + order.value.quantitypreordered) - if (totalipotetico > order.value.TotalPriceProduct) { + if (totalipotetico.toFixed(2) > order.value.TotalPriceProduct.toFixed(2)) { return true } return false @@ -164,6 +186,8 @@ export default defineComponent({ function mounted() { endload.value = false + weight.value = props.order.product?.productInfo.weight + price.value = props.order.price if (props.order.quantity !== 0) { orderQuantity.value = props.order.quantity enableQty.value = true @@ -195,6 +219,8 @@ export default defineComponent({ t, updateOrder, orderQuantity, + weight, + price, orderQuantityPreordered, enableQty, enableQtyPreordered, diff --git a/src/components/CSingleCart/CSingleCart.vue b/src/components/CSingleCart/CSingleCart.vue index 8c050ce0..ec6a8b98 100755 --- a/src/components/CSingleCart/CSingleCart.vue +++ b/src/components/CSingleCart/CSingleCart.vue @@ -1,10 +1,18 @@ diff --git a/src/views/admin/gestoreordini/gestoreordini.scss b/src/views/admin/gestoreordini/gestoreordini.scss new file mode 100755 index 00000000..03057cb4 --- /dev/null +++ b/src/views/admin/gestoreordini/gestoreordini.scss @@ -0,0 +1,41 @@ +$heightBtn: 100%; + +.card .product-image { + height: 300px; +} + +.mycol{ + color:gray; +} + + +.q-item__label--caption{ + color: blue; +} + +.ordstat{ + text-align: center; + border: 1px solid #8778cb; + border-radius: 10px; + padding: 5px; +} + +.confermato { + font-weight: bold; + color: green; +} + +.note { + font-style: italic; + color:blue; +} +.totali { + font-weight: bold; + color: blue; + font-size: 1rem; +} +.totaliacq { + font-weight: bold; + color: red; + font-size: 1rem; +} diff --git a/src/views/admin/gestoreordini/gestoreordini.ts b/src/views/admin/gestoreordini/gestoreordini.ts new file mode 100755 index 00000000..1a4a14fd --- /dev/null +++ b/src/views/admin/gestoreordini/gestoreordini.ts @@ -0,0 +1,236 @@ +import { defineComponent, onMounted, ref, watch } from 'vue' +import { tools } from '@store/Modules/tools' +import { useUserStore } from '@store/UserStore' +import { useRouter } from 'vue-router' +import { useGlobalStore } from '@store/globalStore' +import { useProducts } from '@store/Products' +import { useI18n } from '@/boot/i18n' +import { toolsext } from '@store/Modules/toolsext' +import { useQuasar } from 'quasar' +import { costanti } from '@costanti' +import { shared_consts } from '@src/common/shared_vuejs' +// import MixinBase from '@src/mixins/mixin-base' +import { serv_constants } from '@store/Modules/serv_constants' +import { fieldsTable } from '@store/Modules/fieldsTable' + +import { CSingleCart } from '../../../components/CSingleCart' +import { CTitleBanner, CMyFieldDb } from '@components' +import { ICart, IOrder, IOrderCart } from '@src/model' + +export default defineComponent({ + name: 'gestoreordini', + components: { CSingleCart, CTitleBanner, CMyFieldDb }, + props: {}, + setup() { + const userStore = useUserStore() + const globalStore = useGlobalStore() + const productStore = useProducts() + const $router = useRouter() + const $q = useQuasar() + const { t } = useI18n() + + const mygestord = ref([]) + const myarrrec = ref({}) + const myoldrec = ref({}) + const templemail = ref('') + + const storeGasordine = ref('') + + const cosa = ref(0) + const arrout = ref([]) + + const initialPagination = ref({ + sortBy: 'desc', + descending: false, + rowsPerPage: 10, + // rowsNumber: xx if getting data from a server + }) + + const conferma_carrello = ref(false) + const conferma_ordine = ref(false) + const endload = ref(false) + + const taborders = ref(shared_consts.OrderStat.IN_CORSO.value) + const columns = ref([ + { + name: 'name', + required: true, + align: 'left', + label: 'Nome Prodotto', + field: 'nameSurname', + sortable: true + }, + { + name: 'weight', + required: true, + label: 'Peso', + field: 'weight', + sortable: true + }, + { + name: 'price_acquistato', + required: true, + label: 'Prezzo (P)', + field: 'price_acquistato', + sortable: true + }, + { + name: 'totalQuantity', + required: true, + label: 'Qty', + field: 'totalQuantity', + sortable: true + }, + { + name: 'totalPrice_acquistato', + required: true, + label: 'Totale (P)', + field: 'totalPrice_acquistato', + sortable: true + }, + { + name: 'totalPrice', + required: true, + label: 'Totale (C)', + field: 'totalPrice', + sortable: true + }, + ]) + + watch(() => cosa.value, (newval, oldval) => { + + }) + watch(() => storeGasordine.value, (newval, oldval) => { + tools.setCookie(tools.COOK_SELGAS, storeGasordine.value) + updateorders() + }) + + function getCols(props: any) { + return props.cols.filter((col: any) => col.name !== 'desc') + } + + async function getGestoreOrd() { + const hasGasordine: any = (cosa.value === shared_consts.PROD.TUTTI) ? undefined : (cosa.value === shared_consts.PROD.GAS) + const ris = await productStore.getGestoreOrdini({ idGasordine: storeGasordine.value }) + + return ris + } + + async function getGestoreOrdWithTotals() { + const orderscart = await getGestoreOrd(); + + if (orderscart) { + // Calculate totals + const totals = { + name: 'TOTALI', + weight: '', + totalQuantity: orderscart.reduce((total: number, rec: any) => total + rec.totalQuantity, 0), + totalPrice_acquistato: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice_acquistato, 0), + totalPrice: orderscart.reduce((total: number, rec: any) => total + rec.totalPrice, 0), + }; + + let rowsWithTotals: any = [...orderscart]; + + if (tools.isManager()) { + // Combine orders and totals + rowsWithTotals.push(totals); + } + + return rowsWithTotals; + } else { + return [] + } + + + } + + async function updateorders() { + mygestord.value = await getGestoreOrd() + if (mygestord.value) { + for (const gestord of mygestord.value) { + myarrrec.value[gestord._id] = Object.keys(gestord) + } + } + + arrout.value = await getGestoreOrdWithTotals() + + } + + async function mounted() { + + storeGasordine.value = tools.getCookie(tools.COOK_SELGAS, '') + + await userStore.newsletterload(false) + await productStore.loadProducts() + + taborders.value = -1 + + await updateorders() + + if (taborders.value === -1) + taborders.value = shared_consts.OrderStat.IN_CORSO.value + + endload.value = true + } + + function CanBeShipped() { + return productStore.cart.items!.filter((rec) => rec.order.product!.canBeShipped).length + } + + function CanBeBuyOnline() { + return productStore.cart.items!.filter((rec) => rec.order.product!.canBeBuyOnline).length + } + + function getnumsteps() { + let numsteps = 1 + + if (CanBeShipped()) + numsteps++ + if (CanBeBuyOnline()) + numsteps++ + + return numsteps + } + + function docheckout() { + + // Può essere spedito? + + if (CanBeShipped()) { + // mostra form di spedizione + } + + if (CanBeBuyOnline()) { + // mostra form di acquisto Online + } + } + + + onMounted(mounted) + + return { + userStore, + costanti, + tools, + toolsext, + shared_consts, + globalStore, + columns, + taborders, + getGestoreOrd, + updateorders, + getCols, + endload, + getGestoreOrdWithTotals, + productStore, + t, + initialPagination, + cosa, + templemail, + fieldsTable, + arrout, + storeGasordine, + } + } +}) + diff --git a/src/views/admin/gestoreordini/gestoreordini.vue b/src/views/admin/gestoreordini/gestoreordini.vue new file mode 100755 index 00000000..9bc1bce3 --- /dev/null +++ b/src/views/admin/gestoreordini/gestoreordini.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/views/admin/gestoreordini/index.ts b/src/views/admin/gestoreordini/index.ts new file mode 100755 index 00000000..8a296c34 --- /dev/null +++ b/src/views/admin/gestoreordini/index.ts @@ -0,0 +1 @@ +export {default as gestoreordini} from './orderInfo.vue' diff --git a/src/views/ecommerce/orderInfo/orderInfo.ts b/src/views/ecommerce/orderInfo/orderInfo.ts index dc6681f1..cb43c29d 100755 --- a/src/views/ecommerce/orderInfo/orderInfo.ts +++ b/src/views/ecommerce/orderInfo/orderInfo.ts @@ -36,6 +36,8 @@ export default defineComponent({ const cosa = ref(0) + const arrout = ref([]) + const initialPagination = ref({ sortBy: 'desc', descending: false, @@ -47,6 +49,8 @@ export default defineComponent({ const conferma_ordine = ref(false) const endload = ref(false) + const storeGasordine = ref('') + const taborders = ref(shared_consts.OrderStat.IN_CORSO.value) const statusnow = ref(0) const arrnumstatus = ref([]) @@ -165,7 +169,16 @@ export default defineComponent({ ]) watch(() => cosa.value, (newval, oldval) => { + updateorders(true) + }) + watch(() => taborders.value, (newval, oldval) => { + updateorders(false) + }) + + watch(() => storeGasordine.value, (newval, oldval) => { + tools.setCookie(tools.COOK_SELGAS, storeGasordine.value) + updateorders(true) }) // const { setValDb, getValDb } = MixinBase() @@ -176,7 +189,7 @@ export default defineComponent({ function getOrdersCart(): IOrderCart[] | undefined { const hasGasordine: any = (cosa.value === shared_consts.PROD.TUTTI) ? undefined : (cosa.value === shared_consts.PROD.GAS) - const ris = productStore.getOrdersCart(taborders.value, hasGasordine) + const ris = productStore.getOrdersCart(taborders.value, hasGasordine, storeGasordine.value) return ris } @@ -184,7 +197,7 @@ export default defineComponent({ function getOrdersCartWithTotals(): any[] { const orderscart = getOrdersCart(); - if (orderscart) { + if (orderscart && taborders.value > 0) { // Calculate totals const totals = { created_at: new Date(), @@ -216,10 +229,12 @@ export default defineComponent({ } function getAllOrdersCart() { - return productStore.getOrdersAllCart() + return productStore.getOrdersAllCart(storeGasordine.value) } - function updateorders() { + function updateorders(updatetab: boolean) { + arrout.value = [] + myorderscart.value = getOrdersCart() if (myorderscart.value) { for (const orderscart of myorderscart.value) { @@ -227,19 +242,22 @@ export default defineComponent({ } } - const allorders = getAllOrdersCart() - for (const status of [15, 2, 3, 4, 5, 6, 7, 8, 10]) { - arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0) + if (updatetab) { + const allorders = getAllOrdersCart() + for (const status of [15, 2, 3, 4, 5, 6, 7, 8, 10]) { + arrnumstatus.value[status] = allorders.filter((rec) => (rec.status === status)).reduce((sum, item) => sum + 1, 0) + } + + selectfirstavailable() } - selectfirstavailable() - - + arrout.value = getOrdersCartWithTotals() } function selectfirstavailable() { + taborders.value = -1 Object.keys(arrnumstatus.value).forEach((stat: any) => { if (arrnumstatus.value[stat] > 0) { if (taborders.value === -1) @@ -250,12 +268,14 @@ export default defineComponent({ async function mounted() { + taborders.value = -1 + storeGasordine.value = tools.getCookie(tools.COOK_SELGAS, '') + await userStore.newsletterload(false) await productStore.loadProducts() - taborders.value = -1 - updateorders() + updateorders(true) if (taborders.value === -1) taborders.value = shared_consts.OrderStat.IN_CORSO.value @@ -328,7 +348,7 @@ export default defineComponent({ if (statusnow.value === status) { order.status = statusnow.value - updateorders() + updateorders(true) tools.showPositiveNotif($q, 'Ordine ' + statusStr) } // change_field('status') @@ -398,6 +418,8 @@ export default defineComponent({ sendMailTest, templemail, fieldsTable, + storeGasordine, + arrout, } } }) diff --git a/src/views/ecommerce/orderInfo/orderInfo.vue b/src/views/ecommerce/orderInfo/orderInfo.vue index de9ad25d..5ebc6ae7 100755 --- a/src/views/ecommerce/orderInfo/orderInfo.vue +++ b/src/views/ecommerce/orderInfo/orderInfo.vue @@ -43,18 +43,41 @@ - +
- + + + +
- +