ok, ora sistemare SignUp

This commit is contained in:
paolo
2018-11-06 00:21:22 +01:00
parent 03d57ba50e
commit 7c1d07797e
8 changed files with 90 additions and 72 deletions

View File

@@ -44,15 +44,15 @@
"vuex-module-decorators": "^0.4.3"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@types/dotenv": "^4.0.3",
"@types/jest": "^23.1.4",
"@types/js-cookie": "^2.1.0",
"@types/node": "^10.12.2",
"@types/nprogress": "^0.0.29",
"@types/webpack-env": "^1.13.6",
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@types/jest": "^23.1.4",
"@types/node": "^10.12.2",
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-e2e-cypress": "^3.0.1",
"@vue/cli-plugin-pwa": "^3.0.1",
@@ -63,9 +63,9 @@
"babel-core": "7.0.0-bridge.0",
"babel-loader": "^8.0.4",
"eslint": "^5.5.0",
"jest": "^23.6.0",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.0",
"jest": "^23.6.0",
"json-loader": "^0.5.4",
"node-sass": "^4.9.0",
"quasar-cli": "^0.17.20",
@@ -74,11 +74,12 @@
"ts-jest": "^23.0.0",
"ts-loader": "^5.3.0",
"tslint": "^5.11.0",
"tslint-loader": "^3.4.3",
"tslint-config-standard": "^8.0.1",
"tslint-loader": "^3.4.3",
"typescript": "^3.1.6",
"vue-cli-plugin-element-ui": "^1.1.2",
"vue-template-compiler": "^2.5.17",
"vueify": "^9.4.1",
"webpack": "^2.2.1",
"webpack-dev-middleware": "^1.8.4",
"webpack-hot-middleware": "^2.18.1",

View File

@@ -49,51 +49,63 @@
</div>
</template>
<script lang="ts">
import { Component, Vue, Watch } from 'vue-property-decorator'
<script>
import {openURL} from 'quasar';
import { UserModule } from '../store/modules/user'
import {Quasar} from 'quasar';
import drawer from '../layouts/drawer/drawer.vue'
import messagePopover from '../layouts/toolbar/messagePopover.vue'
@Component({
// import user from '../store/modules/user';
import * as types from '../store/mutation-types'
export default {
components: {
drawer,
messagePopover,
},
})
export default class Header extends Vue {
prova = 'AA'
selectOpLang = [
created() {
//this.$store.dispatch('initStocks');
},
methods: {
openURL,
},
data: function () {
return {
prova: 'AA',
selectOpLang: [
{label: 'Italian', icon: 'fa-facebook', value: 'it'},
{label: 'English (US)', icon: 'fa-flag-us', value: 'en-us'},
{label: 'Spanish', icon: 'fa-flag-es', value: 'es'},
{label: 'German', icon: 'fa-flag-de', value: 'de'}
]
lang = this.$q.i18n.lang
leftDrawerOpen = this.$q.platform.is.desktop
@Watch('lang')
lang(lang: string) {
this.$i18n.locale = snakeToCamel(lang)
console.log("LANG LOCALE = " + this.$i18n.locale)
],
lang: this.$q.i18n.lang,
leftDrawerOpen: this.$q.platform.is.desktop
}
},
watch: {
lang(lang) {
this.$i18n.locale = snakeToCamel(lang);
console.log("LANG LOCALE = " + this.$i18n.locale);
// dynamic import, so loading on demand only
import(`quasar-framework/i18n/${lang}`).then(lang => {
//console.log("lang prima = " + this.$q.i18n.lang);
this.$q.i18n.set(lang.default)
var mylang = this.$q.i18n.lang
console.log("lang = " + this.$q.i18n.lang)
this.$q.i18n.set(lang.default);
var mylang = this.$q.i18n.lang;
console.log("lang = " + this.$q.i18n.lang);
//console.log("lang DOPO = " + this.$q.i18n.lang);
import(`src/i18n`).then(function () {
})
})
});
});
// dynamic import, so loading on demand only
}
}
}
function snakeToCamel(str) {
return str.replace(/(-\w)/g, m => {

View File

@@ -1,10 +1,10 @@
export default {
i18n: {
languages: [
{ code: 'en-us', name: 'English', active: true },
{ code: 'fr', name: 'Français', active: true }
{ code: 'it', name: 'Italiano', active: true },
{ code: 'en-us', name: 'English', active: true }
],
default: 'en-us',
fallbackTo: 'en-us'
default: 'it',
fallbackTo: 'it'
}
}

7
src/i18n/it/index.ts Normal file
View File

@@ -0,0 +1,7 @@
export default {
msg: {
hello: 'Buongiorno',
myAppName: 'FreePlanet',
myDescriz: 'La prima App Libera e per Tutti'
}
}

View File

@@ -69,7 +69,7 @@
set conta(valore) {
GlobModule.setConta(valore)
var my = process.env.LANG_DEFAULT;
var my = this.$q.i18n.lang;
this.showNotification(String(my));
}

View File

@@ -448,7 +448,7 @@ class User extends VuexModule implements IUserState { // Non occorrono i gette
})
}
@Action({ commit: types.USER_AUTOLOGIN })
@Mutation
autologin () {
const token = localStorage.getItem('token')
if (!token) {

View File

@@ -1,24 +1,24 @@
export const SET_VALUE = 'SET_VALUE';
export const SET_DEFFERED_PROMPT = 'defprompt';
export const SET_LOGIN_PAGE = 'setloginpage';
export const SET_LAYOUT_NEEDED = 'setlayneeded';
export const SET_MOBILE_MODE = 'setmobilemode';
export const SET_MENU_COLLAPSED = 'setmenucoll';
export const SET_POSTS = 'setposts';
export const SET_FORM_SIGNUP = 'formsignup';
export const SET_VALUE = 'SET_VALUE'
export const SET_DEFFERED_PROMPT = 'defprompt'
export const SET_LOGIN_PAGE = 'setloginpage'
export const SET_LAYOUT_NEEDED = 'setlayneeded'
export const SET_MOBILE_MODE = 'setmobilemode'
export const SET_MENU_COLLAPSED = 'setmenucoll'
export const SET_POSTS = 'setposts'
export const SET_FORM_SIGNUP = 'formsignup'
// USER:
export const USER_REC = 'user_rec';
export const USER_USERNAME = 'username';
export const USER_EMAIL = 'email';
export const USER_LANG = 'lang';
export const USER_PASSWORD = 'password';
export const USER_DATEOFBIRTH = 'dateofbirth';
export const USER_REC = 'user_rec'
export const USER_USERNAME = 'username'
export const USER_EMAIL = 'email'
export const USER_LANG = 'lang'
export const USER_PASSWORD = 'password'
export const USER_DATEOFBIRTH = 'dateofbirth'
export const USER_SIGNUP = 'signup';
export const USER_SIGNIN = 'signin';
export const USER_AUTOLOGIN = 'autologin';
export const USER_LOGOUT = 'logout';
export const USER_VREG = 'vreg';
export const USER_REQUESTRESETPWD = 'requestpwd';
export const USER_UPDATEPWD = 'resetpwd';
export const USER_SIGNUP = 'signup'
export const USER_SIGNIN = 'signin'
export const USER_AUTOLOGIN = 'autologin'
export const USER_LOGOUT = 'logout'
export const USER_VREG = 'vreg'
export const USER_REQUESTRESETPWD = 'requestpwd'
export const USER_UPDATEPWD = 'resetpwd'

View File

@@ -94,10 +94,9 @@
</template>
<script type="ts">
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { Component, Vue, Prop } from 'vue-property-decorator'
import { UserModule } from '../../store/modules/user'
import { IUserState } from "../../types";
//import { IUserState } from "../../types";
import {ErroriMongoDb} from '../../store/modules/user'
/*
@@ -115,10 +114,9 @@
@Component({})
export default class Signup extends Vue {
accountId: number = 0
duplicate_email: boolean = false
duplicate_username: boolean = false
user: IUserState = {
duplicate_email = false
duplicate_username = false
user = {
email: process.env.TEST_EMAIL,
username: process.env.TEST_USERNAME,
password: process.env.TEST_PASSWORD,