diff --git a/pages/submit.vue b/pages/submit.vue index 085900a7..f9ba8ae0 100644 --- a/pages/submit.vue +++ b/pages/submit.vue @@ -13,6 +13,7 @@ type="text" class="mb-5 px-3 py-3.5 w-[350px] h-[50px] bg-white rounded-lg border border-zinc-400 text-neutral-600 text-sm font-normal font-['Noto Sans JP']" :placeholder="$t('submitPage.location')" + v-model="submissionStore.location" /> {{ $t('submitPage.spokenLanguage1')}} - + v-model="submissionStore.selectLanguage1" + > + + {{ $t('submitPage.spokenLanguage2')}} - + v-model="submissionStore.selectLanguage2" + > + + {{ $t('submitPage.otherNotes')}}({{ $t('submitPage.optional')}}) - diff --git a/stores/localeStore.ts b/stores/localeStore.ts index 59945ecb..a5aa55bf 100644 --- a/stores/localeStore.ts +++ b/stores/localeStore.ts @@ -1,27 +1,10 @@ -import { defineStore } from 'pinia' +import { defineStore } from "pinia"; -const localeEn:{label: string, code: string} = { - label: 'English', - code: 'en' -} -const localeJa:{label: string, code: string} = { - label: '日本語', - code: 'ja' -} - -export const useLocaleStore = defineStore('locale', { +export const useLocaleStore = defineStore('localeStore', { state: () => ({ - locale: localeEn + locales: [{"en_US": "English"}, {"ja_JP": "Japanese"}] }), - getters: { - currentLocale: state => state.locale - }, + getters: {}, actions: { - changeLocale() { - if (this.currentLocale.code === 'en') - this.locale = localeEn - else - this.locale = localeJa - } } }) diff --git a/stores/submissionStore.ts b/stores/submissionStore.ts new file mode 100644 index 00000000..6f5ceb5a --- /dev/null +++ b/stores/submissionStore.ts @@ -0,0 +1,24 @@ +import { defineStore } from "pinia"; + +export const useSubmissionStore = defineStore('submissionStore', { + state: () => ({ + location: "", + lastName: "", + firstName: "", + selectLanguage1: "", + selectLanguage2: "", + otherNotes : "" + }), + getters: {}, + actions: { + submit(): void { + const submission = { + "googleMapsUrl": this.location, + "healthcareProfessionalName": `${this.firstName} ${this.lastName}`, + "spokenLanguages": [this.selectLanguage1, this.selectLanguage2], + "notes": this.otherNotes + } + console.log('submission =', submission) + } + } +})