From 9ee623c38f649da2df2def4e37a87eb1ce9d2ace Mon Sep 17 00:00:00 2001 From: Waqar Ul Zafar Date: Mon, 27 Feb 2023 09:54:49 +0500 Subject: [PATCH] ij --- nuxt.config.ts | 2 +- pages/auth/login.vue | 13 +++--- pages/auth/signup.vue | 15 ++++++- pages/letsgo.vue | 19 +++++++-- pages/onboarding/index.vue | 11 ++++- pages/onboarding/onboarding2.vue | 11 ++++- pages/onboarding/onboarding3.vue | 11 ++++- pages/onboarding/onboarding4.vue | 13 +++++- pages/setting/index.vue | 10 ++++- pages/setting/soundscap.vue | 73 +++++++++++++++++++++++++------- plugins/axios.ts | 4 +- 11 files changed, 147 insertions(+), 35 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index e74287b..70b1011 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -62,7 +62,7 @@ export default defineNuxtConfig({ "Headphones Type":"Headphones Type", "In-Ear":"In-Ear", "Over-Ear":"Over-Ear", - "ANC":"ANCr", + "ANC":"ANC", "No":"No", "Yes":"Yes", "About Mindboost":"About Mindboost", diff --git a/pages/auth/login.vue b/pages/auth/login.vue index ad924d1..1bdfce9 100755 --- a/pages/auth/login.vue +++ b/pages/auth/login.vue @@ -25,7 +25,7 @@

Log In

- Welcome back, Morris! + Welcome back,
@@ -42,7 +42,7 @@
- Forgot Password + Forgot Password
@@ -117,9 +117,11 @@ export default { this.login(data.user,data.authorisation.token); - this.toast.success('Login Successfully....'); - this.$router.push('/onboarding'); + this.$toast.success('Login Successfully....'); + this.$router.push(this.localePath('/onboarding')); + }else{ + this.$toast.error(`Email or password is incorrect.`); } }).catch((error)=>{ this.loading=false; @@ -127,7 +129,8 @@ export default { if(error.response.status==401){ this.auth_error=true; - this.toast.error(`Email or password is incorrect.`); + this.$toast.error(`Email or password is incorrect.`); + } if(error.response.status==422){ this.errors = error.response.data.errors; diff --git a/pages/auth/signup.vue b/pages/auth/signup.vue index 1c017c2..addbee8 100755 --- a/pages/auth/signup.vue +++ b/pages/auth/signup.vue @@ -28,7 +28,7 @@

Sign Up

- Helo , Beautiful! + Hello, Beautiful!

Mindboost helps you block out distracting noise with concentration-boosting music, increasing your productivity by up to 35%.

@@ -94,7 +94,15 @@ import backgroundImagePath from '~/assets/image/login4.png' import {useUserStore} from '@/stores/user'; import {mapState,mapActions} from "pinia"; export default { + setup() { + const { t } = useI18n() + const localePath = useLocalePath() + return { + t, + localePath, + } + }, computed:{ ...mapState(useUserStore,['user']) }, @@ -122,12 +130,15 @@ export default { console.log(data); this.loading=false; + this.$toast.success("Signup successfully...."); this.login(data.user,data.authorisation.token) - this.$router.push('/onboarding'); + this.$router.push(this.localePath('/onboarding')); + }).catch((error)=>{ this.loading=false; if(error.response.status==422){ this.errors = error.response.data.errors; + this.$toast.error(error.response.data.message); } }) diff --git a/pages/letsgo.vue b/pages/letsgo.vue index eebcab5..0538457 100755 --- a/pages/letsgo.vue +++ b/pages/letsgo.vue @@ -2,7 +2,7 @@
@@ -132,10 +132,23 @@
- NEXT + NEXT
- \ No newline at end of file + + \ No newline at end of file diff --git a/pages/onboarding/index.vue b/pages/onboarding/index.vue index 1a54422..9978cd7 100644 --- a/pages/onboarding/index.vue +++ b/pages/onboarding/index.vue @@ -52,6 +52,15 @@ import {useCounterStore} from '@/stores/counter'; import {mapState,mapActions} from "pinia"; // const counter=useCounterStore(); export default { + setup() { + const { t } = useI18n() + const localePath = useLocalePath() + + return { + t, + localePath, + } + }, mounted() { this.increment(25); }, @@ -73,7 +82,7 @@ export default { console.log(data); if(data.success){ this.$toast.success(data.message); - this.$router.push('/onboarding/onboarding2'); + this.$router.push(this.localePath('/onboarding/onboarding2')); } }).catch((e)=>{ this.$toast.error("something went wrong while saving..."); diff --git a/pages/onboarding/onboarding2.vue b/pages/onboarding/onboarding2.vue index ecd54cc..9014bff 100644 --- a/pages/onboarding/onboarding2.vue +++ b/pages/onboarding/onboarding2.vue @@ -57,6 +57,15 @@ import {useCounterStore} from '@/stores/counter'; import {mapState,mapActions} from "pinia"; export default { + setup() { + const { t } = useI18n() + const localePath = useLocalePath() + + return { + t, + localePath, + } + }, mounted() { this.increment(50); }, @@ -77,7 +86,7 @@ export default { console.log(data); if(data.success){ this.$toast.success(data.message); - this.$router.push('/onboarding/onboarding3'); + this.$router.push(this.localePath('/onboarding/onboarding3')); } }).catch((e)=>{ this.$toast.error("something went wrong while saving..."); diff --git a/pages/onboarding/onboarding3.vue b/pages/onboarding/onboarding3.vue index a0fa677..e325551 100644 --- a/pages/onboarding/onboarding3.vue +++ b/pages/onboarding/onboarding3.vue @@ -48,6 +48,15 @@ import {useCounterStore} from '@/stores/counter'; import {mapState,mapActions} from "pinia"; export default { + setup() { + const { t } = useI18n() + const localePath = useLocalePath() + + return { + t, + localePath, + } + }, mounted() { this.increment(75); }, @@ -69,7 +78,7 @@ export default { console.log(data); if(data.success){ this.$toast.success(data.message); - this.$router.push('/onboarding/onboarding4'); + this.$router.push(this.localePath('/onboarding/onboarding4')); } }).catch((e)=>{ this.$toast.error("something went wrong while saving..."); diff --git a/pages/onboarding/onboarding4.vue b/pages/onboarding/onboarding4.vue index efa8b0b..9d253e2 100644 --- a/pages/onboarding/onboarding4.vue +++ b/pages/onboarding/onboarding4.vue @@ -19,7 +19,7 @@ - + @@ -35,17 +35,17 @@ @@ -60,17 +60,17 @@ @@ -87,7 +87,7 @@
- +
@@ -108,22 +108,59 @@ export default { }, data(){ return { + adaptiveSounscape:false, form:{ - soundscape:'' + soundscape:'', + headphone_type:"", + anc_type:"", + adaptive_sound_scape:"", } } }, + mounted() { + this.fetchSettings(); + }, + methods:{ + fetchSettings(){ + this.$axios.post('/api/fetch-settings',this.form).then(({data})=>{ + console.log(data); + if(data.success){ + this.form=data.setting; + if (data.adaptive_sound_scape=='yes'){ + this.form.adaptive_sound_scape=true; + }else{ + this.form.adaptive_sound_scape=false; + } + } + }).catch((e)=>{ + this.$toast.error("something went wrong while saving..."); + }) + }, saveSetting(value,type){ + console.log(this.adaptiveSounscape); if(type=='soundscape'){ this.form.soundscape=value; } + if (type=='headphone'){ + + this.form.headphone_type=value; + } + if (type=='anc'){ + + this.form.anc_type=value; + } + if (this.adaptiveSounscape==true){ + this.form.adaptive_sound_scape='yes'; + }else { + this.form.adaptive_sound_scape='no'; + } this.$axios.post('/api/update-setting',this.form).then(({data})=>{ console.log(data); if(data.success){ this.$toast.success(data.message); - this.$router.push('/letsgo'); + this.form=data.setting; } }).catch((e)=>{ this.$toast.error("something went wrong while saving..."); @@ -157,4 +194,10 @@ data(){ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); } +.drop-active{ + color: white !important; + background-color: #e9c046; + border-radius: 10px; + margin-top: 2px; +} \ No newline at end of file diff --git a/plugins/axios.ts b/plugins/axios.ts index f4ce36b..dfb4d60 100644 --- a/plugins/axios.ts +++ b/plugins/axios.ts @@ -2,8 +2,8 @@ import axios, {AxiosInstance, AxiosRequestConfig} from "axios"; import {useUserStore} from '@/stores/user'; import {mapState} from 'pinia'; export default defineNuxtPlugin((nuxtApp) => { - const defaultUrl = "https://admin.mindboost.craveteck.com"; - // const defaultUrl = "http://localhost:8000"; + // const defaultUrl = "https://admin.mindboost.craveteck.com"; + const defaultUrl = "http://localhost:8000"; // Access Pinia state