diff --git a/src/lib/services.js b/src/lib/services.js index 270f9cc0..1b4d6842 100644 --- a/src/lib/services.js +++ b/src/lib/services.js @@ -58,6 +58,14 @@ export default { } }); }, + register: ({ username, email, nickname, password }) => { + return axios.post('register.json', { + username, + email, + nickname, + password + }); + }, logout: () => { return axios.get('logout.json'); }, diff --git a/src/locales/en.js b/src/locales/en.js index 0f76d861..98d1f7ee 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -66,12 +66,18 @@ export default { 'Your username or Email': 'Your username or Email', 'Password': 'Password', 'Your password': 'Your password', + 'E-mail': 'E-mail', + 'Your email': 'Your email', + 'Nickname': 'Nickname', + 'Your nickname': 'Your nickname', 'Log In': 'Log In', 'Don\'t have an account?': 'Don\'t have an account?', 'Create an account': 'Create an account', 'Forget Password?': 'Forget Password?', 'Please input username': 'Please input username', 'Please input password': 'Please input password', + 'Please input email': 'Please input email', + 'Please input nickname': 'Please input nickname', 'Unable to login': 'Unable to login', 'Two-Factor Authentication': 'Two-Factor Authentication', 'Passcode': 'Passcode', @@ -82,7 +88,10 @@ export default { 'Unable to verify': 'Unable to verify', 'Use a backup code': 'Use a backup code', 'Use a passcode': 'Use a passcode', + 'Sign Up': 'Sign Up', 'Language': 'Language', + 'You have been successfully registered': 'You have been successfully registered', + 'Unable to sign up': 'Unable to sign up', 'Log Out': 'Log Out', 'Are you sure you want to log out?': 'Are you sure you want to log out?', 'Unable to logout': 'Unable to logout', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 71b4e966..ffabef9c 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -66,12 +66,18 @@ export default { 'Your username or Email': '你的用户名或注册邮箱', 'Password': '密码', 'Your password': '你的密码', + 'E-mail': '电子邮箱', + 'Your email': '你的电子邮箱', + 'Nickname': '昵称', + 'Your nickname': '你的昵称', 'Log In': '登录', 'Don\'t have an account?': '还没有账号?', 'Create an account': '创建新账号', 'Forget Password?': '找回密码?', 'Please input username': '请输入用户名', 'Please input password': '请输入密码', + 'Please input email': '请输入电子邮箱', + 'Please input nickname': '请输入昵称', 'Unable to login': '无法登录', 'Two-Factor Authentication': '两步验证', 'Passcode': '验证码', @@ -82,7 +88,10 @@ export default { 'Unable to verify': '无法验证', 'Use a backup code': '使用备用码', 'Use a passcode': '使用验证码', + 'Sign Up': '注册', 'Language': '语言', + 'You have been successfully registered': '注册成功', + 'Unable to sign up': '无法注册', 'Log Out': '退出登录', 'Are you sure you want to log out?': '您确定是否要退出登录?', 'Unable to logout': '无法退出登录', diff --git a/src/mobile-main.js b/src/mobile-main.js index 84ea4aaf..2715a1cc 100644 --- a/src/mobile-main.js +++ b/src/mobile-main.js @@ -78,6 +78,12 @@ Vue.prototype.$confirm = function (message, confirmCallback, cancelCallback) { ] }).open(); }; +Vue.prototype.$toast = function (message, timeout) { + this.$f7.toast.create({ + text: i18n.t(message), + closeTimeout: timeout || 1500 + }).open(); +}; Vue.prototype.$services = services; Vue.prototype.$user = userstate; diff --git a/src/router/mobile.js b/src/router/mobile.js index 67c66147..656c0a51 100644 --- a/src/router/mobile.js +++ b/src/router/mobile.js @@ -4,6 +4,7 @@ import MainPage from '../views/mobile/Main.vue'; import MainPageHomeTab from '../views/mobile/main/Home.vue'; import LoginPage from '../views/mobile/Login.vue'; +import SignUpPage from '../views/mobile/Signup.vue'; import SettingsPage from '../views/mobile/Settings.vue'; function checkLogin(to, from, resolve, reject) { @@ -49,6 +50,11 @@ const routes = [ component: LoginPage, beforeEnter: checkNotLogin }, + { + path: '/signup', + component: SignUpPage, + beforeEnter: checkNotLogin + }, { path: '/settings', component: SettingsPage, diff --git a/src/views/mobile/Signup.vue b/src/views/mobile/Signup.vue new file mode 100644 index 00000000..9ad8b2af --- /dev/null +++ b/src/views/mobile/Signup.vue @@ -0,0 +1,129 @@ + + +