Commit 4780c488 authored by sugita mamoru's avatar sugita mamoru

ログイン画面デザイン修正

parent b6cef56f
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "0.002", "alpha" : "1.000",
"blue" : "0xD1", "blue" : "0xD1",
"green" : "0xBD", "green" : "0xBD",
"red" : "0x21" "red" : "0x21"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "0.200", "alpha" : "1.000",
"blue" : "0xD1", "blue" : "0xD1",
"green" : "0xBD", "green" : "0xBD",
"red" : "0x21" "red" : "0x21"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "0.002", "alpha" : "1.000",
"blue" : "0xFA", "blue" : "0xFA",
"green" : "0xFA", "green" : "0xFA",
"red" : "0xFA" "red" : "0xFA"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"color" : { "color" : {
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "0.200", "alpha" : "1.000",
"blue" : "0x3C", "blue" : "0x3C",
"green" : "0x38", "green" : "0x38",
"red" : "0x38" "red" : "0x38"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import SwiftUI import SwiftUI
struct ContentView: View { struct ContentView: View {
@State var isLogin = true//ContentView.LoginCheck() @State var isLogin = false//ContentView.LoginCheck()
@EnvironmentObject private var sceneDelegate: SceneDelegate @EnvironmentObject private var sceneDelegate: SceneDelegate
@StateObject var locationViewModel = LocationViewModel() @StateObject var locationViewModel = LocationViewModel()
var selectedTabModel = SelectedTabModel() var selectedTabModel = SelectedTabModel()
......
...@@ -109,13 +109,14 @@ struct LoginView: View { ...@@ -109,13 +109,14 @@ struct LoginView: View {
} }
} }
} }
.background(ColorSet.LoginBk01.color) .background(ColorSet.BackgroundPrimary.color)
.fullScreenCover(isPresented: $scannerViewModel.isShowing, onDismiss: {LoginCheckQR()}, content: { .fullScreenCover(isPresented: $scannerViewModel.isShowing, onDismiss: {LoginCheckQR()}, content: {
QRReadView(viewMode: .constant(.SelectType), viewModel: scannerViewModel) QRReadView(viewMode: .constant(.SelectType), viewModel: scannerViewModel)
}) })
.onAppear() { .onAppear() {
LoginCheck() LoginCheck()
} }
.preferredColorScheme(.dark)
} }
func LoginCheckQR() -> () { func LoginCheckQR() -> () {
......
...@@ -14,67 +14,53 @@ struct InputIdPassWordView: View { ...@@ -14,67 +14,53 @@ struct InputIdPassWordView: View {
@State private var isUserNmaeEmpty = false @State private var isUserNmaeEmpty = false
@State private var isIdPassWordEmpty = false @State private var isIdPassWordEmpty = false
let itemHPadding: Double = 16
let dialogBottomPadding: Double = 32
let textFieldHeight: Double = 49
let inputAreaHeight: Double = 150
let dialogHeight: CGFloat = 250
var body: some View { var body: some View {
VStack{ VStack{
VStack { VStack(alignment: .leading, spacing: 0) {
HStack{ HStack(spacing: 0){
Image("account") Image("account")
.resizable()
.frame(width: 22, height: 22) .frame(width: 22, height: 22)
.padding(.horizontal, 8) .padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
.accentColor(.white)
.foregroundColor(.white)
TextField( TextField(
"", "",
text: $param.shipId, text: $param.shipId,
prompt: Text("Ship ID") prompt: Text("Ship ID")
.foregroundColor(.white) .font(FontStyle.DefaultText.font)
) .foregroundColor(ColorSet.BodyDescriptiion.color) )
.frame(height: textFieldHeight) .frame(height: 49)
.padding(.trailing) .padding(.zero)
.foregroundColor(.white)
.background(.lineColor01)
.autocapitalization(.none) .autocapitalization(.none)
.modifier(TextFieldModifier(text: $param.shipId, inputType: .UserId))
} }
Divider() Divider()
.frame(height: 1) .frame(height: 1)
.background(Color(.white)) .background(ColorSet.LineColor03.color)
Spacer() HStack(spacing: 0){
.frame(height: 16)
HStack{
Image("password") Image("password")
.padding(.horizontal, 4) .resizable()
.foregroundColor(.white) .frame(width: 22, height: 22)
.padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
SecureField( SecureField(
"", "",
text: $param.password, text: $param.password,
prompt: Text("Password") prompt: Text("Password")
.foregroundColor(.white) .font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
) )
.frame(height: textFieldHeight) .frame(height: 49)
.padding(.trailing) .padding(.zero)
.foregroundColor(.white)
} }
.padding(.top, 16)
Divider() Divider()
.frame(height: 1) .frame(height: 1)
.background(Color(.white)) .background(ColorSet.LineColor03.color)
} }
Spacer()
.frame(height: 40)
Button(action: { Button(action: {
if param.shipId.isEmpty || param.password.isEmpty { if param.shipId.isEmpty || param.password.isEmpty {
isIdPassWordEmpty = true isIdPassWordEmpty = true
...@@ -83,19 +69,21 @@ struct InputIdPassWordView: View { ...@@ -83,19 +69,21 @@ struct InputIdPassWordView: View {
} }
}, label: { }, label: {
Text("Sign In") Text("Sign In")
.font(FontStyle.TitleS.font)
.frame(height: 60) .frame(height: 60)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.foregroundColor(.buttonText) .foregroundColor(ColorSet.ButtonText.color)
.background(.primaryActiveIcon) .background(ColorSet.LoginBk01.color)
}) })
.alert(isPresented: $isIdPassWordEmpty, content: { .alert(isPresented: $isIdPassWordEmpty, content: {
Alert(title: Text("error"), Alert(title: Text("error"),
message: Text("Ship Id or Password not entered.") message: Text("Ship Id or Password not entered.")
) )
}) })
.padding(.top, 40)
} }
.padding(EdgeInsets(top: 26, leading: 20, bottom: 40, trailing: 20)) .padding(EdgeInsets(top: 26, leading: 20, bottom: 40, trailing: 20))
.background(ColorSet.BackgroundSecondary.color) .background(ColorSet.LoginBk02.color)
.padding(.horizontal, 30) .padding(.horizontal, 30)
} }
} }
......
...@@ -17,81 +17,68 @@ struct InputUserNameView: View { ...@@ -17,81 +17,68 @@ struct InputUserNameView: View {
@Binding var alertType: AlertType @Binding var alertType: AlertType
@State private var isEmptyAlert = false @State private var isEmptyAlert = false
@State var timer :Timer? @State var timer :Timer?
let itemHPadding: Double = 16
let dialogBottomPadding: Double = 32
let textFieldHeight: Double = 40
let inputAreaHeight: Double = 150
let dialogHeight: CGFloat = 250
let dialogWidth = UIScreen.main.bounds.width - 32
var body: some View { var body: some View {
HStack { VStack{
Spacer() VStack(alignment: .leading, spacing: 0) {
.frame(width: itemHPadding) Text("JRC Ship")
VStack{ .font(FontStyle.TitleSBold.font)
Spacer() .padding(.leading, 10)
.foregroundColor(.white)
VStack(alignment: .leading) {
Text("JRC Ship") HStack(spacing: 0){
.padding(.leading, 4) Image("account")
.bold() .resizable()
.foregroundColor(.white) .frame(width: 22, height: 22)
.padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
HStack{
Image("account") TextField(
.padding(.horizontal, 4) "",
.foregroundColor(.white) text: $param.userName,
TextField( prompt: Text("Please set user name.")
"", .font(FontStyle.SupplementText.font)
text: $param.userName, .foregroundColor(ColorSet.BodyDescriptiion.color)
prompt: Text("Please set user name")
.foregroundColor(.white)
)
.frame(height: textFieldHeight)
.padding(.trailing)
.foregroundColor(.white)
}
Divider()
.frame(height: 2)
.background(Color(.white))
}
.frame(height: inputAreaHeight)
Spacer()
Button(action: {
if param.userName.isEmpty {
isEmptyAlert = true
} else {
print(debug: "signin: id(\(param.shipId)), pass(\(param.password)), name(\(param.userName))")
isAlert = false
isProgressView = true
let login = ReqLogin(Id: param.shipId, Password: param.password)
sessionLogin.RequestLogin(login, completion: responseLogin)
Preferences.UserName = param.userName
}
}, label: {
Text("Sign In")
.frame(height: 50)
.frame(maxWidth: .infinity)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
})
.alert(isPresented: $isEmptyAlert) {
return Alert(title: Text("error"),
message: Text("User Nmae not entered.")
) )
.frame(height: 49)
.padding(.zero)
} }
Spacer()
.frame(height: dialogBottomPadding)
}
Spacer() Divider()
.frame(width: itemHPadding) .frame(height: 1)
.background(ColorSet.LineColor03.color)
}
.frame(height: 88)
Button(action: {
if param.userName.isEmpty {
isEmptyAlert = true
} else {
print(debug: "signin: id(\(param.shipId)), pass(\(param.password)), name(\(param.userName))")
isAlert = false
isProgressView = true
let login = ReqLogin(Id: param.shipId, Password: param.password)
sessionLogin.RequestLogin(login, completion: responseLogin)
Preferences.UserName = param.userName
}
}, label: {
Text("Sign In")
.font(FontStyle.TitleS.font)
.frame(height: 60)
.frame(maxWidth: .infinity)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.LoginBk01.color)
})
.alert(isPresented: $isEmptyAlert) {
return Alert(title: Text("error"),
message: Text("User Nmae not entered.")
)
}
.padding(.top, 40)
} }
.frame(width: dialogWidth, height: dialogHeight) .padding(EdgeInsets(top: 21, leading: 20, bottom: 32, trailing: 20))
.background(ColorSet.BackgroundSecondary.color) .background(ColorSet.LoginBk02.color)
.padding(.horizontal, 30)
} }
func responseLogin(result: Result<Data, APIError>) { func responseLogin(result: Result<Data, APIError>) {
......
...@@ -12,19 +12,18 @@ struct LoginTypeSelectView: View{ ...@@ -12,19 +12,18 @@ struct LoginTypeSelectView: View{
@Binding var viewMode: LoginViewMode @Binding var viewMode: LoginViewMode
var body: some View{ var body: some View{
VStack { VStack (spacing: 20) {
HStack { Button(action: {
Button(action: { isQrRead = true
isQrRead = true }, label: {
}, label: { Text("Read the QR code")
Text("Read the QR code") .font(FontStyle.TitleS.font)
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.frame(height: 50) .frame(height: 60)
.foregroundColor(ColorSet.ButtonText.color) .foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color) .background(ColorSet.LoginBk01.color)
}) })
}
.padding(.horizontal, 32)
Button(action: { Button(action: {
print("change mode") print("change mode")
viewMode = .InputIdPassword viewMode = .InputIdPassword
...@@ -32,9 +31,11 @@ struct LoginTypeSelectView: View{ ...@@ -32,9 +31,11 @@ struct LoginTypeSelectView: View{
Text("Enter Ship ID / Password") Text("Enter Ship ID / Password")
.underline() .underline()
.font(FontStyle.SupplementText.font) .font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.ToggleBackGround.color) .foregroundColor(ColorSet.Body.color)
}) })
} }
.padding(.horizontal, 50)
} }
} }
#Preview { #Preview {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment