From 5a0c44ff359f76413174f130639b4fead1e59d5d Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Fri, 20 Dec 2024 16:52:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E9=99=86=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gringotts-frontend/pages/login/main.js | 143 +++++++++++++++---------- 1 file changed, 86 insertions(+), 57 deletions(-) diff --git a/gringotts-frontend/pages/login/main.js b/gringotts-frontend/pages/login/main.js index 1f8d5f3..9982ae1 100644 --- a/gringotts-frontend/pages/login/main.js +++ b/gringotts-frontend/pages/login/main.js @@ -4,74 +4,103 @@ import {userRegisterDialog} from '../../components/user/dialog-user-register.js' useAmis(information => { return { type: 'page', - title: information.title, - subTitle: '统一登陆入口', + className: 'h-screen bg-gray-900', + bodyClassName: 'h-full flex items-start mt-20', body: [ { - type: 'grid', - columns: [ + type: 'wrapper', + className: 'relative w-full max-w-md mx-auto', + body: [ { - xs: 0, - sm: 0, - md: 4, - body: [], + type: 'flex', + justify: 'center', + className: 'mb-8', + items: [ + { + type: 'avatar', + src: '/logo.svg', + shape: 'square', + size: 64, + fit: 'contain', + className: 'mr-4 bg-transparent' + }, + { + type: 'flex', + direction: 'column', + justify: 'center', + items: [ + { + type: 'tpl', + tpl: information.title, + className: 'text-2xl font-bold text-white' + }, + { + type: 'tpl', + tpl: '统一登录入口', + className: 'text-lg ml-1 mt-1 text-gray-100' + } + ] + } + ] }, { - xs: 12, - sm: 12, - md: 4, + type: 'form', + className: 'bg-white rounded-xl p-10 shadow-2xl', + api: '${base}/user/login', + redirect: '/pages/index/index.html?token=${token}', + mode: 'normal', + wrapWithPanel: false, body: [ { - type: 'form', - title: '用户登陆', - api: '${base}/user/login', - redirect: '/pages/index/index.html?token=${token}', - mode: 'horizontal', - horizontal: { - left: 2, - }, - actions: [ + type: 'input-email', + name: 'username', + label: false, + placeholder: '请输入邮箱', + required: true, + clearable: true, + className: 'mb-4', + inputClassName: 'rounded-lg', + }, + { + type: 'input-password', + name: 'password', + label: false, + placeholder: '请输入密码', + required: true, + className: 'mb-4', + inputClassName: 'rounded-lg', + }, + { + type: 'flex', + justify: 'space-between', + className: 'mb-4', + items: [ { - type: 'action', - label: '注册', + type: 'button', + label: '注册账号', + className: 'text-blue-600 hover:text-blue-700', + level: 'link', ...userRegisterDialog(), }, { - type: 'action', - actionType: 'submit', - label: '登陆', - level: 'primary', - }, - ], - body: [ - { - type: 'input-email', - name: 'username', - label: '邮箱', - placeholder: '请输入邮箱', - required: true, - clearable: true, - clearValueOnEmpty: true, - }, - { - type: 'input-password', - name: 'password', - label: '密码', - placeholder: '请再次输入密码', - required: true, - }, - ], + type: 'button', + label: '忘记密码?', + level: 'link', + className: 'text-gray-600 hover:text-gray-700' + } + ] }, - ], - }, - { - xs: 0, - sm: 0, - md: 4, - body: [], - }, - ], - }, - ], + { + type: 'submit', + label: '登录', + level: 'primary', + className: 'w-full rounded-lg', + size: 'lg' + } + ] + } + ] + } + ] } })