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
- {{ errorMessages }}
8
- <div class =" LoginForm" >
9
- <v-form ref =" form" v-model =" valid" >
10
- <v-text-field
11
- v-model =" classId"
12
- :counter =" 6"
13
- label =" クラスID"
14
- :rules =" nameRules"
15
- outlined
16
- dark
17
- required
2
+ <v-layout justify-center =" true" align-center =" true" >
3
+ <v-flex class =" indexFlex" >
4
+ <v-row justify =" center" class =" mb-3" >
5
+ <v-icon color =" white" size =" 60px" >mdi-library</v-icon >
6
+ </v-row >
7
+ <v-row justify =" center" >
8
+ <span class =" description mb-3" >授業をうける生徒・児童の方</span >
9
+ </v-row >
10
+ <v-row class =" loginFieldRow" justify =" center" >
11
+ <input-field
12
+ v-model =" classId"
13
+ class =" classIdField"
14
+ type =" classId"
15
+ label =" クラスID"
16
+ />
17
+ <v-btn
18
+ class =" classLoginButton ml-3"
19
+ color =" #FFDB6C"
20
+ width =" 56px"
21
+ height =" 56px"
22
+ :disabled =" !/^[あ-ん]{6}$/.test(classId)"
23
+ :loading =" loading"
24
+ @click =" loginToClass"
25
+ >
26
+ <v-icon color =" black" >mdi-arrow-right-bold</v-icon >
27
+ </v-btn >
28
+ </v-row >
29
+ <v-flex fill-width justify =" center" class =" forTeachers" >
30
+ <v-row class =" mt-10 mb-3" justify =" center" >
31
+ <v-icon color =" white" size =" 60px" >mdi-account-circle</v-icon >
32
+ </v-row >
33
+ <v-row justify =" center" >
34
+ <span class =" description mb-3" >時間割をつくる先生方</span >
35
+ </v-row >
36
+ <div style =" margin : 0 10px ;" >
37
+ <action-button
38
+ text =" ユーザー登録する"
39
+ class =" registerButton"
40
+ @click =" $router.push('/terms')"
18
41
/>
19
- <v-btn
20
- block
21
- outlined
22
- color =" white"
23
- height =" 40px"
24
- :loading =" loading"
25
- :disabled =" loading || !valid"
26
- @click =" loginToClass"
27
- >
28
- LOGIN
29
- </v-btn >
30
- </v-form >
31
- </div >
42
+
43
+ <action-button
44
+ text =" ログインする"
45
+ class =" loginButton"
46
+ theme =" secondary"
47
+ @click =" $router.push('/account/login')"
48
+ />
49
+ <v-footer color =" #004170" padless >
50
+ <v-row justify =" center" no-gutters >
51
+ <v-col class =" white--text text-center footerText" cols =" 12" >
52
+ <a class =" white--text" href =" #" > - おうちで時間割について </a >
53
+ </v-col >
54
+ <v-col class =" white--text text-center footerText" cols =" 12" >
55
+ <a class =" white--text" href =" #" > - お問い合わせ </a >
56
+ </v-col >
57
+ <v-col class =" white--text text-center footerText" cols =" 12" >
58
+ <nuxt-link class =" white--text" to =" policy" >
59
+ - 利用規約
60
+ </nuxt-link >
61
+ </v-col >
62
+ </v-row >
63
+ </v-footer >
64
+ </div >
65
+ </v-flex >
32
66
</v-flex >
33
- </div >
67
+ <v-snackbar :timeout =" 5000" :value =" error" absolute top color =" #C01B61" >
68
+ クラスIDが正しくありません
69
+ </v-snackbar >
70
+ </v-layout >
34
71
</template >
35
72
36
73
<script lang="ts">
37
74
import Vue from ' vue'
38
75
import { vxm } from ' @/store'
39
- import Logo from ' @/assets/svgs/logo.svg'
76
+ import InputField from ' @/components/InputField.vue'
77
+ import ActionButton from ' @/components/ActionButton.vue'
40
78
41
79
type DataType = {
42
80
classId: string
43
81
loading: boolean
44
82
error: boolean
45
- errorMessages: string
46
83
valid: boolean
47
- nameRules: ((v : string ) => boolean | string )[]
48
84
}
49
85
50
86
export default Vue .extend ({
51
- components: { Logo },
87
+ components: {
88
+ ActionButton ,
89
+ InputField
90
+ },
52
91
data(): DataType {
53
92
return {
54
93
classId: ' ' ,
55
94
loading: false ,
56
95
error: false ,
57
- errorMessages: ' ' ,
58
- valid: true ,
59
- nameRules: [
60
- v => !! v || ' クラスIDは必須です' ,
61
- v => (v && v .length === 6 ) || ' クラスIDは6文字のひらがなです'
62
- ]
96
+ valid: true
63
97
}
64
98
},
65
99
methods: {
@@ -70,26 +104,50 @@ export default Vue.extend({
70
104
.then (() => {
71
105
this .$router .push (' /classes' )
72
106
})
73
- .catch ((e : Error ) => {
107
+ .catch (() => {
74
108
this .loading = false
75
109
this .error = true
76
- this .errorMessages = e .message
77
110
})
78
111
}
79
112
}
80
113
})
81
114
</script >
82
115
83
116
<style lang="scss" scoped>
84
- .MainPage {
85
- .Logo {
86
- text-align : center ;
87
- }
88
- .DataBlock {
89
- margin : 0 -12px ;
90
- .studycard {
91
- margin-bottom : 20px ;
92
- }
93
- }
117
+ .classLoginButton {
118
+ border-radius : 14px ;
119
+ min-width : 48px !important ;
120
+ }
121
+ .description {
122
+ color : white ;
123
+ font-weight : bold ;
124
+ font-family : ' Noto Sans JP' , sans-serif ;
125
+ }
126
+ .forTeachers {
127
+ background-color : $color-base-color-07 ;
128
+ border-radius : 24px 24px 24px 24px ;
129
+ padding-top : 4px ;
130
+ padding-bottom : 24px ;
131
+ }
132
+ .indexFlex {
133
+ max-width : 640px !important ;
134
+ }
135
+ .loginFieldRow {
136
+ margin-left : auto !important ;
137
+ margin-right : auto !important ;
138
+ }
139
+ .loginButton {
140
+ font-size : 16px ;
141
+ font-weight : bold ;
142
+ margin-top : 10px ;
143
+ margin-bottom : 15px ;
144
+ }
145
+ .registerButton {
146
+ font-size : 16px ;
147
+ font-weight : bold ;
148
+ }
149
+ .footerText {
150
+ margin-top : 15px ;
151
+ font-size : 12px ;
94
152
}
95
153
</style >
0 commit comments