8080 buttonText}"
8181 v-on:saveInput =" saveInput"
8282 v-if =" slideCurrent === 6" ></Textblock >
83+ <Location
84+ v-bind:slide =" {
85+ key: 'location',
86+ current: slideCurrent,
87+ count: slideCount,
88+ buttonText}"
89+ v-on:nextSlide =" nextSlide"
90+ v-if =" slideCurrent === 7" ></Location >
8391 </div >
8492</template >
8593
@@ -90,6 +98,7 @@ import SingleChoice from '@/components/app/onboarding/SingleChoice.vue';
9098import MultipleChoice from ' @/components/app/onboarding/MultipleChoice.vue' ;
9199import MainAndSecondaryImagesUpload from ' @/components/app/onboarding/MainAndSecondaryImagesUpload.vue' ;
92100import Textblock from ' @/components/app/onboarding/Textblock.vue' ;
101+ import Location from " @/components/app/onboarding/Location" ;
93102
94103export default {
95104 components: {
@@ -98,24 +107,30 @@ export default {
98107 MultipleChoice,
99108 MainAndSecondaryImagesUpload,
100109 Textblock,
110+ Location ,
101111 },
102112 data : () => ({
103113 slideCurrent: 0 ,
104- slideCount: 6 ,
114+ slideCount: 7 ,
105115 userData: {},
106116 }),
107117 methods: {
108118 saveInput (... args ) {
109119 let [key, value] = args;
110120 if (key === ' birthdate' ) {
111121 value = this .formatBirthdate (value);
122+ } else if (key === ' location' ) {
123+ value = this .processLocation (value);
112124 }
113125 this .userData [key] = value;
114126 this .nextSlide ();
115127 },
116- nextSlide () {
128+ async nextSlide () {
117129 if (this .slideCurrent === this .slideCount ) {
118- this .$router .push (' /browse' );
130+ await this .$http .post (' /profile/complete' , this .userData );
131+ await this .$store .dispatch (' profileCompleted' );
132+ console .log (' setting up profile might take a while' );
133+ // await this.$router.push('/browse');
119134 }
120135 if (this .slideCurrent < this .slideCount ) {
121136 this .slideCurrent += 1 ;
@@ -132,6 +147,13 @@ export default {
132147 let birthyear = new Date ().getFullYear () - age;
133148 return ' 01/01/' + birthyear;
134149 },
150+ processLocation (allowAccessToLocation ) {
151+ if (allowAccessToLocation) {
152+ navigator .geolocation .getCurrentPosition (function (position ) {
153+ console .log (position .coords .latitude + position .coords .longitude );
154+ });
155+ }
156+ }
135157 },
136158 computed: {
137159 buttonText () {
0 commit comments