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

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

parent b6cef56f
......@@ -4,7 +4,7 @@
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.002",
"alpha" : "1.000",
"blue" : "0xD1",
"green" : "0xBD",
"red" : "0x21"
......@@ -22,7 +22,7 @@
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.200",
"alpha" : "1.000",
"blue" : "0xD1",
"green" : "0xBD",
"red" : "0x21"
......
......@@ -4,7 +4,7 @@
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.002",
"alpha" : "1.000",
"blue" : "0xFA",
"green" : "0xFA",
"red" : "0xFA"
......@@ -22,7 +22,7 @@
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.200",
"alpha" : "1.000",
"blue" : "0x3C",
"green" : "0x38",
"red" : "0x38"
......
......@@ -8,7 +8,7 @@
import SwiftUI
struct ContentView: View {
@State var isLogin = true//ContentView.LoginCheck()
@State var isLogin = false//ContentView.LoginCheck()
@EnvironmentObject private var sceneDelegate: SceneDelegate
@StateObject var locationViewModel = LocationViewModel()
var selectedTabModel = SelectedTabModel()
......
......@@ -109,13 +109,14 @@ struct LoginView: View {
}
}
}
.background(ColorSet.LoginBk01.color)
.background(ColorSet.BackgroundPrimary.color)
.fullScreenCover(isPresented: $scannerViewModel.isShowing, onDismiss: {LoginCheckQR()}, content: {
QRReadView(viewMode: .constant(.SelectType), viewModel: scannerViewModel)
})
.onAppear() {
LoginCheck()
}
.preferredColorScheme(.dark)
}
func LoginCheckQR() -> () {
......
......@@ -14,67 +14,53 @@ struct InputIdPassWordView: View {
@State private var isUserNmaeEmpty = 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 {
VStack{
VStack {
HStack{
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 0){
Image("account")
.resizable()
.frame(width: 22, height: 22)
.padding(.horizontal, 8)
.accentColor(.white)
.foregroundColor(.white)
.padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
TextField(
"",
text: $param.shipId,
prompt: Text("Ship ID")
.foregroundColor(.white)
)
.frame(height: textFieldHeight)
.padding(.trailing)
.foregroundColor(.white)
.background(.lineColor01)
.font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color) )
.frame(height: 49)
.padding(.zero)
.autocapitalization(.none)
.modifier(TextFieldModifier(text: $param.shipId, inputType: .UserId))
}
Divider()
.frame(height: 1)
.background(Color(.white))
Spacer()
.frame(height: 16)
HStack{
.background(ColorSet.LineColor03.color)
HStack(spacing: 0){
Image("password")
.padding(.horizontal, 4)
.foregroundColor(.white)
.resizable()
.frame(width: 22, height: 22)
.padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
SecureField(
"",
text: $param.password,
prompt: Text("Password")
.foregroundColor(.white)
.font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
)
.frame(height: textFieldHeight)
.padding(.trailing)
.foregroundColor(.white)
.frame(height: 49)
.padding(.zero)
}
.padding(.top, 16)
Divider()
.frame(height: 1)
.background(Color(.white))
.background(ColorSet.LineColor03.color)
}
Spacer()
.frame(height: 40)
Button(action: {
if param.shipId.isEmpty || param.password.isEmpty {
isIdPassWordEmpty = true
......@@ -83,19 +69,21 @@ struct InputIdPassWordView: View {
}
}, label: {
Text("Sign In")
.font(FontStyle.TitleS.font)
.frame(height: 60)
.frame(maxWidth: .infinity)
.foregroundColor(.buttonText)
.background(.primaryActiveIcon)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.LoginBk01.color)
})
.alert(isPresented: $isIdPassWordEmpty, content: {
Alert(title: Text("error"),
message: Text("Ship Id or Password not entered.")
)
})
.padding(.top, 40)
}
.padding(EdgeInsets(top: 26, leading: 20, bottom: 40, trailing: 20))
.background(ColorSet.BackgroundSecondary.color)
.background(ColorSet.LoginBk02.color)
.padding(.horizontal, 30)
}
}
......
......@@ -17,81 +17,68 @@ struct InputUserNameView: View {
@Binding var alertType: AlertType
@State private var isEmptyAlert = false
@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 {
HStack {
Spacer()
.frame(width: itemHPadding)
VStack{
Spacer()
VStack(alignment: .leading) {
Text("JRC Ship")
.padding(.leading, 4)
.bold()
.foregroundColor(.white)
HStack{
Image("account")
.padding(.horizontal, 4)
.foregroundColor(.white)
TextField(
"",
text: $param.userName,
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.")
VStack{
VStack(alignment: .leading, spacing: 0) {
Text("JRC Ship")
.font(FontStyle.TitleSBold.font)
.padding(.leading, 10)
.foregroundColor(.white)
HStack(spacing: 0){
Image("account")
.resizable()
.frame(width: 22, height: 22)
.padding(EdgeInsets(top: 14, leading: 8, bottom: 13, trailing: 18))
TextField(
"",
text: $param.userName,
prompt: Text("Please set user name.")
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
)
.frame(height: 49)
.padding(.zero)
}
Spacer()
.frame(height: dialogBottomPadding)
}
Spacer()
.frame(width: itemHPadding)
Divider()
.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)
.background(ColorSet.BackgroundSecondary.color)
.padding(EdgeInsets(top: 21, leading: 20, bottom: 32, trailing: 20))
.background(ColorSet.LoginBk02.color)
.padding(.horizontal, 30)
}
func responseLogin(result: Result<Data, APIError>) {
......
......@@ -12,19 +12,18 @@ struct LoginTypeSelectView: View{
@Binding var viewMode: LoginViewMode
var body: some View{
VStack {
HStack {
Button(action: {
isQrRead = true
}, label: {
Text("Read the QR code")
.frame(maxWidth: .infinity)
.frame(height: 50)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
})
}
.padding(.horizontal, 32)
VStack (spacing: 20) {
Button(action: {
isQrRead = true
}, label: {
Text("Read the QR code")
.font(FontStyle.TitleS.font)
.frame(maxWidth: .infinity)
.frame(height: 60)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.LoginBk01.color)
})
Button(action: {
print("change mode")
viewMode = .InputIdPassword
......@@ -32,9 +31,11 @@ struct LoginTypeSelectView: View{
Text("Enter Ship ID / Password")
.underline()
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.ToggleBackGround.color)
.foregroundColor(ColorSet.Body.color)
})
}
.padding(.horizontal, 50)
}
}
#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