From 8dcd07fce0403ce78832078b0ce0f100081f48b0 Mon Sep 17 00:00:00 2001 From: Jonathan Chevalier Date: Fri, 28 Oct 2022 15:03:39 +0200 Subject: [PATCH] WIP MMCM --- src/App.vue | 10 +- src/components/FlexCard.vue | 3 + src/components/HelloWorld.vue | 40 ----- src/components/Home.vue | 28 --- src/components/Wizard.vue | 2 +- src/data/countries.json | 250 -------------------------- src/router/index.js | 2 + src/stores/mmcm.js | 29 +-- src/style.css | 10 ++ src/views/address-check.vue | 2 +- src/views/delivery-option-step-1.vue | 15 +- src/views/delivery-option-step-2.vue | 24 ++- src/views/delivery-option-step-3.vue | 2 +- src/views/delivery-option-summary.vue | 49 ++--- src/views/index.vue | 12 +- 15 files changed, 105 insertions(+), 373 deletions(-) delete mode 100644 src/components/HelloWorld.vue delete mode 100644 src/components/Home.vue delete mode 100644 src/data/countries.json diff --git a/src/App.vue b/src/App.vue index 41f887c..faecc5f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,17 @@ diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 91f9bfc..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/components/Home.vue b/src/components/Home.vue deleted file mode 100644 index b918502..0000000 --- a/src/components/Home.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/src/components/Wizard.vue b/src/components/Wizard.vue index 9533790..782fb31 100644 --- a/src/components/Wizard.vue +++ b/src/components/Wizard.vue @@ -20,7 +20,7 @@ export default { const stepList = [ { class: 'fa-solid fa-location-dot fa-fw', - name: 'Mon adresse', + name: 'Vérifier que vous êtes éligible au service', path: '/address-check', stepNumber: 1 }, diff --git a/src/data/countries.json b/src/data/countries.json deleted file mode 100644 index 209386e..0000000 --- a/src/data/countries.json +++ /dev/null @@ -1,250 +0,0 @@ -[ - {"name": "Albania"}, - {"name": "Åland Islands"}, - {"name": "Algeria"}, - {"name": "American Samoa"}, - {"name": "Andorra"}, - {"name": "Angola"}, - {"name": "Anguilla"}, - {"name": "Antarctica"}, - {"name": "Antigua and Barbuda"}, - {"name": "Argentina"}, - {"name": "Armenia"}, - {"name": "Aruba"}, - {"name": "Australia"}, - {"name": "Austria"}, - {"name": "Azerbaijan"}, - {"name": "Bahamas (the)"}, - {"name": "Bahrain"}, - {"name": "Bangladesh"}, - {"name": "Barbados"}, - {"name": "Belarus"}, - {"name": "Belgium"}, - {"name": "Belize"}, - {"name": "Benin"}, - {"name": "Bermuda"}, - {"name": "Bhutan"}, - {"name": "Bolivia (Plurinational State of)"}, - {"name": "Bonaire, Sint Eustatius and Saba"}, - {"name": "Bosnia and Herzegovina"}, - {"name": "Botswana"}, - {"name": "Bouvet Island"}, - {"name": "Brazil"}, - {"name": "British Indian Ocean Territory (the)"}, - {"name": "Brunei Darussalam"}, - {"name": "Bulgaria"}, - {"name": "Burkina Faso"}, - {"name": "Burundi"}, - {"name": "Cabo Verde"}, - {"name": "Cambodia"}, - {"name": "Cameroon"}, - {"name": "Canada"}, - {"name": "Cayman Islands (the)"}, - {"name": "Central African Republic (the)"}, - {"name": "Chad"}, - {"name": "Chile"}, - {"name": "China"}, - {"name": "Christmas Island"}, - {"name": "Cocos (Keeling) Islands (the)"}, - {"name": "Colombia"}, - {"name": "Comoros (the)"}, - {"name": "Congo (the Democratic Republic of the)"}, - {"name": "Congo (the)"}, - {"name": "Cook Islands (the)"}, - {"name": "Costa Rica"}, - {"name": "Croatia"}, - {"name": "Cuba"}, - {"name": "Curaçao"}, - {"name": "Cyprus"}, - {"name": "Czechia"}, - {"name": "Côte d'Ivoire"}, - {"name": "Denmark"}, - {"name": "Djibouti"}, - {"name": "Dominica"}, - {"name": "Dominican Republic (the)"}, - {"name": "Ecuador"}, - {"name": "Egypt"}, - {"name": "El Salvador"}, - {"name": "Equatorial Guinea"}, - {"name": "Eritrea"}, - {"name": "Estonia"}, - {"name": "Eswatini"}, - {"name": "Ethiopia"}, - {"name": "Falkland Islands (the) [Malvinas]"}, - {"name": "Faroe Islands (the)"}, - {"name": "Fiji"}, - {"name": "Finland"}, - {"name": "France"}, - {"name": "French Guiana"}, - {"name": "French Polynesia"}, - {"name": "French Southern Territories (the)"}, - {"name": "Gabon"}, - {"name": "Gambia (the)"}, - {"name": "Georgia"}, - {"name": "Germany"}, - {"name": "Ghana"}, - {"name": "Gibraltar"}, - {"name": "Greece"}, - {"name": "Greenland"}, - {"name": "Grenada"}, - {"name": "Guadeloupe"}, - {"name": "Guam"}, - {"name": "Guatemala"}, - {"name": "Guernsey"}, - {"name": "Guinea"}, - {"name": "Guinea-Bissau"}, - {"name": "Guyana"}, - {"name": "Haiti"}, - {"name": "Heard Island and McDonald Islands"}, - {"name": "Holy See (the)"}, - {"name": "Honduras"}, - {"name": "Hong Kong"}, - {"name": "Hungary"}, - {"name": "Iceland"}, - {"name": "India"}, - {"name": "Indonesia"}, - {"name": "Iran (Islamic Republic of)"}, - {"name": "Iraq"}, - {"name": "Ireland"}, - {"name": "Isle of Man"}, - {"name": "Israel"}, - {"name": "Italy"}, - {"name": "Jamaica"}, - {"name": "Japan"}, - {"name": "Jersey"}, - {"name": "Jordan"}, - {"name": "Kazakhstan"}, - {"name": "Kenya"}, - {"name": "Kiribati"}, - {"name": "Korea (the Democratic People's Republic of)"}, - {"name": "Korea (the Republic of)"}, - {"name": "Kuwait"}, - {"name": "Kyrgyzstan"}, - {"name": "Lao People's Democratic Republic (the)"}, - {"name": "Latvia"}, - {"name": "Lebanon"}, - {"name": "Lesotho"}, - {"name": "Liberia"}, - {"name": "Libya"}, - {"name": "Liechtenstein"}, - {"name": "Lithuania"}, - {"name": "Luxembourg"}, - {"name": "Macao"}, - {"name": "Madagascar"}, - {"name": "Malawi"}, - {"name": "Malaysia"}, - {"name": "Maldives"}, - {"name": "Mali"}, - {"name": "Malta"}, - {"name": "Marshall Islands (the)"}, - {"name": "Martinique"}, - {"name": "Mauritania"}, - {"name": "Mauritius"}, - {"name": "Mayotte"}, - {"name": "Mexico"}, - {"name": "Micronesia (Federated States of)"}, - {"name": "Moldova (the Republic of)"}, - {"name": "Monaco"}, - {"name": "Mongolia"}, - {"name": "Montenegro"}, - {"name": "Montserrat"}, - {"name": "Morocco"}, - {"name": "Mozambique"}, - {"name": "Myanmar"}, - {"name": "Namibia"}, - {"name": "Nauru"}, - {"name": "Nepal"}, - {"name": "Netherlands (the)"}, - {"name": "New Caledonia"}, - {"name": "New Zealand"}, - {"name": "Nicaragua"}, - {"name": "Niger (the)"}, - {"name": "Nigeria"}, - {"name": "Niue"}, - {"name": "Norfolk Island"}, - {"name": "Northern Mariana Islands (the)"}, - {"name": "Norway"}, - {"name": "Oman"}, - {"name": "Pakistan"}, - {"name": "Palau"}, - {"name": "Palestine, State of"}, - {"name": "Panama"}, - {"name": "Papua New Guinea"}, - {"name": "Paraguay"}, - {"name": "Peru"}, - {"name": "Philippines (the)"}, - {"name": "Pitcairn"}, - {"name": "Poland"}, - {"name": "Portugal"}, - {"name": "Puerto Rico"}, - {"name": "Qatar"}, - {"name": "Republic of North Macedonia"}, - {"name": "Romania"}, - {"name": "Russian Federation (the)"}, - {"name": "Rwanda"}, - {"name": "Réunion"}, - {"name": "Saint Barthélemy"}, - {"name": "Saint Helena, Ascension and Tristan da Cunha"}, - {"name": "Saint Kitts and Nevis"}, - {"name": "Saint Lucia"}, - {"name": "Saint Martin (French part)"}, - {"name": "Saint Pierre and Miquelon"}, - {"name": "Saint Vincent and the Grenadines"}, - {"name": "Samoa"}, - {"name": "San Marino"}, - {"name": "Sao Tome and Principe"}, - {"name": "Saudi Arabia"}, - {"name": "Senegal"}, - {"name": "Serbia"}, - {"name": "Seychelles"}, - {"name": "Sierra Leone"}, - {"name": "Singapore"}, - {"name": "Sint Maarten (Dutch part)"}, - {"name": "Slovakia"}, - {"name": "Slovenia"}, - {"name": "Solomon Islands"}, - {"name": "Somalia"}, - {"name": "South Africa"}, - {"name": "South Georgia and the South Sandwich Islands"}, - {"name": "South Sudan"}, - {"name": "Spain"}, - {"name": "Sri Lanka"}, - {"name": "Sudan (the)"}, - {"name": "Suriname"}, - {"name": "Svalbard and Jan Mayen"}, - {"name": "Sweden"}, - {"name": "Switzerland"}, - {"name": "Syrian Arab Republic"}, - {"name": "Taiwan (Province of China)"}, - {"name": "Tajikistan"}, - {"name": "Tanzania, United Republic of"}, - {"name": "Thailand"}, - {"name": "Timor-Leste"}, - {"name": "Togo"}, - {"name": "Tokelau"}, - {"name": "Tonga"}, - {"name": "Trinidad and Tobago"}, - {"name": "Tunisia"}, - {"name": "Turkey"}, - {"name": "Turkmenistan"}, - {"name": "Turks and Caicos Islands (the)"}, - {"name": "Tuvalu"}, - {"name": "Uganda"}, - {"name": "Ukraine"}, - {"name": "United Arab Emirates (the)"}, - {"name": "United Kingdom of Great Britain and Northern Ireland (the)"}, - {"name": "United States Minor Outlying Islands (the)"}, - {"name": "United States of America (the)"}, - {"name": "Uruguay"}, - {"name": "Uzbekistan"}, - {"name": "Vanuatu"}, - {"name": "Venezuela (Bolivarian Republic of)"}, - {"name": "Viet Nam"}, - {"name": "Virgin Islands (British)"}, - {"name": "Virgin Islands (U.S.)"}, - {"name": "Wallis and Futuna"}, - {"name": "Western Sahara"}, - {"name": "Yemen"}, - {"name": "Zambia"}, - {"name": "Zimbabwe", "code": "ZW"} -] \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 9d5eacb..3433712 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,6 +7,7 @@ const routes = [ path: '/', name: 'home', component: () => import('/src/views/index.vue'), + meta: { transition: 'slide-right' }, }, { path: '/address-check', @@ -57,4 +58,5 @@ router.beforeEach(async (to, from) => { }) + export default router diff --git a/src/stores/mmcm.js b/src/stores/mmcm.js index 685f161..42d951c 100644 --- a/src/stores/mmcm.js +++ b/src/stores/mmcm.js @@ -71,7 +71,7 @@ const timestampConverter = (digit13) => digit13 / 1000 export const useMMCMStore = defineStore('counter', { state: () => ({ - idSession : '', + idSession: '', street: '', zipCode: '', city: '', @@ -92,28 +92,37 @@ export const useMMCMStore = defineStore('counter', { needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription), dateDeliveryTimestampInSecond: (state) => timestampConverter(state.dateDelivery), dateCollectTimestampInSecond: (state) => timestampConverter(state.dateCollect), - msgDelivery : (state) => { + msgDelivery: (state) => { //console.log(formatDistance(date.deliveryExpress, today)) let arr = [] - if(date.deliveryExpress === today){ + if (date.deliveryExpress === today) { arr.push('Dès aujourd\'hui en moins de 2h') - } - else{ - arr.push('A partir de ' + format(date.deliveryExpress, 'EEEE', {locale : fr}) +' en moins de 2h') + } else { + arr.push('A partir de ' + format(date.deliveryExpress, 'EEEE', {locale: fr}) + ' en moins de 2h') } const useFacteurDate = (state.withPrescription) ? date.deliveryFacteur : date.collectFacteur; - if(useFacteurDate === tomorrow){ + if (useFacteurDate === tomorrow) { arr.push('A partir de demain entre 9h et 17h') - } - else{ - arr.push('A partir de ' + format(useFacteurDate, 'EEEE', {locale : fr}) + ' entre 9h et 17h') + } else { + arr.push('A partir de ' + format(useFacteurDate, 'EEEE', {locale: fr}) + ' entre 9h et 17h') } return arr + }, + stepFacteur: (state) => { + + let step = {dayOne: false, dayTwo: false} + + if (state.withPrescription) { + step.dayOne = format(date.collectFacteur, 'dd/MM/yyyy', {locale: fr}) + step.dayTwo = format(date.deliveryFacteur, 'dd/MM/yyyy', {locale: fr}) + } + return step + } }, diff --git a/src/style.css b/src/style.css index d8d1112..87767e5 100644 --- a/src/style.css +++ b/src/style.css @@ -29,3 +29,13 @@ font-family: 'Montserrat',sans-serif; background-color: #fff;; } + +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.3s ease; +} + +.fade-enter-from, +.fade-leave-to { + opacity: 0; +} diff --git a/src/views/address-check.vue b/src/views/address-check.vue index 1859fe4..bae1c61 100644 --- a/src/views/address-check.vue +++ b/src/views/address-check.vue @@ -1,6 +1,6 @@