1
1
<template >
2
- <div class =" LoginPage" >
3
- <v-flex >
4
- <div class =" Logo" >
5
- <Logo style =" height : 80vw ; max-height : 350px ; width : 100% ;" />
6
- </div >
7
- <div class =" LoginForm" >
8
- <v-form >
9
- <v-text-field
10
- v-model =" email"
11
- :counter =" 32"
12
- label =" email"
13
- outlined
14
- dark
15
- prepend-icon =" mdi-email"
16
- />
17
- <v-text-field
18
- v-model =" password"
19
- :append-icon =" showPassword ? 'mdi-eye' : 'mdi-eye-off'"
20
- :type =" showPassword ? 'text' : 'password'"
21
- :counter =" 32"
22
- label =" Password"
23
- outlined
24
- dark
25
- prepend-icon =" mdi-lock"
26
- @click:append =" showPassword = !showPassword"
2
+ <div >
3
+ <bottom-sheet-layer
4
+ fullscreen
5
+ title =" ログインしてください"
6
+ title-en =" LOGIN"
7
+ >
8
+ <template v-slot :LayerContents >
9
+ <dl >
10
+ <dt class =" SignIn-ItemTitle" >メールアドレス</dt >
11
+ <dd class =" SignIn-Item" >
12
+ <input-field
13
+ v-model =" email"
14
+
15
+ require
16
+ type =" email"
17
+ />
18
+ </dd >
19
+ <dt class =" SignIn-ItemTitle" >パスワード</dt >
20
+ <dd class =" SignIn-Item" >
21
+ <input-field
22
+ v-model =" password"
23
+ label =" パスワード"
24
+ require
25
+ type =" password"
26
+ />
27
+ </dd >
28
+ </dl >
29
+ </template >
30
+ <template v-slot :LayerFooter >
31
+ <div class =" SignIn-ButtonOuter" >
32
+ <action-button
33
+ :is-disabled =" disableLogin"
34
+ :is-loading =" loading"
35
+ class =" SignIn-Button"
36
+ text =" ログイン"
37
+ theme =" primary"
38
+ @click =" doLogin"
27
39
/>
28
40
<v-btn
29
- block
30
- outlined
31
- color =" white"
32
- height =" 40px"
33
- :loading =" loading"
34
41
:disabled =" loading"
35
- @click =" doLogin"
42
+ block
43
+ class =" button"
44
+ color =" #ffffff"
45
+ height =" 60px"
46
+ text
47
+ to =" /"
36
48
>
37
- LOGIN
49
+ < span >パスワードを忘れた方へ</ span >
38
50
</v-btn >
39
- </v-form >
40
- </div >
41
- </v-flex >
51
+ </div >
52
+ </template >
53
+ </bottom-sheet-layer >
54
+ <v-snackbar :timeout =" 5000" :value =" error" absolute top color =" #C01B61" >
55
+ メールアドレスまたはパスワードが正しくありません
56
+ </v-snackbar >
42
57
</div >
43
58
</template >
44
59
45
60
<script lang="ts">
46
61
import Vue from ' vue'
47
- import { vxm } from ' @/store'
62
+ import BottomSheetLayer from ' @/components/BottomSheetLayer.vue'
63
+ import ActionButton from ' @/components/ActionButton.vue'
64
+ import InputField from ' @/components/InputField.vue'
48
65
import firebase from ' @/plugins/firebase'
49
- import Logo from ' @/assets/svgs/logo.svg'
50
-
51
- export type DataType = {
52
- email: string
53
- password: string
54
- showPassword: boolean
55
- loading: boolean
56
- }
66
+ import { vxm } from ' ~/store'
57
67
58
68
export default Vue .extend ({
59
- components: {
60
- Logo
61
- },
62
- data(): DataType {
69
+ components: { BottomSheetLayer , ActionButton , InputField },
70
+ layout: ' background' ,
71
+ data() {
63
72
return {
64
73
email: ' ' ,
65
74
password: ' ' ,
66
- showPassword: false ,
67
- loading: false
75
+ loading: false ,
76
+ error: false
77
+ }
78
+ },
79
+ computed: {
80
+ disableLogin(): boolean {
81
+ return ! (
82
+ this .email &&
83
+ this .password &&
84
+ this .email .match (/ ^ \w + ([-+. ] \w + )* @\w + ([-. ] \w + )* \. \w + ([-. ] \w + )* $ / )
85
+ )
68
86
}
69
87
},
70
88
methods: {
@@ -77,36 +95,30 @@ export default Vue.extend({
77
95
vxm .user .login ()
78
96
this .$router .push (' /edit' )
79
97
})
80
- .catch (error => {
98
+ .catch (() => {
81
99
this .loading = false
82
- alert ( error )
100
+ this . error = true
83
101
})
84
102
}
85
103
}
86
104
})
87
105
</script >
88
106
89
107
<style lang="scss" scoped>
90
- .LoginPage {
108
+ .SignIn-ItemTitle {
109
+ font-size : 16px ;
110
+ font-weight : bold ;
111
+ color : $color-white ;
91
112
text-align : center ;
92
- .Logo {
93
- text-align : center ;
94
- }
95
- .LoginTitle {
96
- color : #fff ;
97
- font-family : ' Noto Sans JP' , sans-serif ;
98
- font-size : 5em ;
99
- }
100
- .DataBlock {
101
- margin : 0 -12px ;
102
- .studycard {
103
- margin-bottom : 20px ;
104
- }
105
- }
106
- .LoginForm {
107
- width : 90% ;
108
- max-width : 600px ;
109
- margin : 50px auto ;
110
- }
113
+ margin : 4px 0 ;
114
+ }
115
+ .SignIn-Item {
116
+ margin : 20px 0 ;
117
+ }
118
+ .SignIn-ButtonOuter {
119
+ justify-content : space-between ;
120
+ }
121
+ .SignIn-Button {
122
+ flex : 0 1 48% ;
111
123
}
112
124
</style >
0 commit comments