Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CpjJwWHV
Sailassist
Commits
40585846
Commit
40585846
authored
Oct 27, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
実機で動かなかったのを修正
parent
cc2e8395
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
112 deletions
+99
-112
ChatView.swift
Seilassist/Sailassist/Chat/ChatView.swift
+8
-1
ContentView.swift
Seilassist/Sailassist/ContentView.swift
+0
-1
LoginView.swift
Seilassist/Sailassist/Login/LoginView.swift
+17
-21
InputIdPassWordView.swift
Seilassist/Sailassist/Login/View/InputIdPassWordView.swift
+62
-64
InputUserNameView.swift
Seilassist/Sailassist/Login/View/InputUserNameView.swift
+5
-6
LoginTypeSelectView.swift
Seilassist/Sailassist/Login/View/LoginTypeSelectView.swift
+6
-13
MainTabView.swift
Seilassist/Sailassist/Tab/MainTabView.swift
+1
-6
No files found.
Seilassist/Sailassist/Chat/ChatView.swift
View file @
40585846
...
@@ -14,9 +14,16 @@ struct ChatView: View {
...
@@ -14,9 +14,16 @@ struct ChatView: View {
VStack
{
VStack
{
if
isEmargency
{
if
isEmargency
{
LinearGradient
(
gradient
:
Gradient
(
colors
:
[
.
red
,
.
black
]),
startPoint
:
.
top
,
endPoint
:
.
bottom
)
LinearGradient
(
gradient
:
Gradient
(
colors
:
[
.
red
,
.
black
]),
startPoint
:
.
top
,
endPoint
:
.
bottom
)
.
ignoresSafeArea
()
}
}
VStack
{
Text
(
"Chat"
)
Button
(
"Change Emargency"
){
isEmargency
.
toggle
()
}
}
}
}
Text
(
"Chat"
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/ContentView.swift
View file @
40585846
...
@@ -24,7 +24,6 @@ struct ContentView: View {
...
@@ -24,7 +24,6 @@ struct ContentView: View {
selectedTabModel
.
activeTab
=
.
task
selectedTabModel
.
activeTab
=
.
task
},
content
:
{
},
content
:
{
LoginView
(
isLogin
:
$
isLogin
)
LoginView
(
isLogin
:
$
isLogin
)
.
environmentObject
(
LoginViewParam
())
})
})
}
}
...
...
Seilassist/Sailassist/Login/LoginView.swift
View file @
40585846
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
SwiftUI
import
SwiftUI
enum
LoginViewMode
{
enum
LoginViewMode
:
String
{
///QRを読み込むor ID/PW入力か選択する画面
///QRを読み込むor ID/PW入力か選択する画面
case
SelectType
case
SelectType
/// ID/PW入力
/// ID/PW入力
...
@@ -17,7 +17,6 @@ enum LoginViewMode{
...
@@ -17,7 +17,6 @@ enum LoginViewMode{
}
}
class
LoginViewParam
:
ObservableObject
{
class
LoginViewParam
:
ObservableObject
{
@Published
var
viewMode
:
LoginViewMode
=
.
SelectType
@Published
var
shipId
:
String
=
""
@Published
var
shipId
:
String
=
""
@Published
var
password
:
String
=
""
@Published
var
password
:
String
=
""
@Published
var
userName
:
String
=
""
@Published
var
userName
:
String
=
""
...
@@ -25,9 +24,10 @@ class LoginViewParam: ObservableObject{
...
@@ -25,9 +24,10 @@ class LoginViewParam: ObservableObject{
struct
LoginView
:
View
{
struct
LoginView
:
View
{
@State
var
isQrRead
:
Bool
=
false
@State
var
isQrRead
:
Bool
=
false
@State
var
viewMode
:
LoginViewMode
=
.
SelectType
@Binding
var
isLogin
:
Bool
@Binding
var
isLogin
:
Bool
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
@
EnvironmentObject
var
loginViewParam
:
LoginViewParam
@
State
var
loginViewParam
=
LoginViewParam
()
var
body
:
some
View
{
var
body
:
some
View
{
ZStack
{
ZStack
{
...
@@ -35,31 +35,27 @@ struct LoginView: View {
...
@@ -35,31 +35,27 @@ struct LoginView: View {
.
fill
(
Color
.
red
)
.
fill
(
Color
.
red
)
.
ignoresSafeArea
()
.
ignoresSafeArea
()
VStack
{
VStack
{
Spacer
()
.
frame
(
height
:
64
)
//ロゴ
//ロゴ
Image
(
"logo_signin"
)
VStack
(
spacing
:
20
){
.
resizable
(
)
Image
(
"logo_signin"
)
.
scaledToFit
()
.
resizable
()
.
frame
(
width
:
135
,
height
:
66.85
)
.
scaledToFit
(
)
.
frame
(
width
:
135
,
height
:
66.85
)
Spacer
()
.
frame
(
height
:
20
)
Image
(
"h1_signin"
)
.
frame
(
width
:
250
,
height
:
21.94
)
Image
(
"h1_signin"
)
}
.
frame
(
width
:
250
,
height
:
21.9
4
)
.
padding
(
.
top
,
6
4
)
Spacer
()
Spacer
()
// .frame(height: 60)
switch
loginViewParam
.
viewMode
{
switch
viewMode
{
case
.
SelectType
:
case
.
SelectType
:
LoginTypeSelectView
(
isQrRead
:
$
isQrRead
)
LoginTypeSelectView
(
isQrRead
:
$
isQrRead
,
viewMode
:
$
viewMode
)
case
.
InputIdPassword
:
case
.
InputIdPassword
:
InputIdPassWordView
()
InputIdPassWordView
(
viewMode
:
$
viewMode
,
param
:
$
loginViewParam
)
case
.
InputUserName
:
case
.
InputUserName
:
InputUserNameView
(
isLogin
:
$
isLogin
)
InputUserNameView
(
isLogin
:
$
isLogin
,
param
:
$
loginViewParam
)
}
}
Spacer
()
Spacer
()
...
...
Seilassist/Sailassist/Login/View/InputIdPassWordView.swift
View file @
40585846
...
@@ -9,89 +9,87 @@ import SwiftUI
...
@@ -9,89 +9,87 @@ import SwiftUI
import
Combine
import
Combine
struct
InputIdPassWordView
:
View
{
struct
InputIdPassWordView
:
View
{
@EnvironmentObject
var
loginViewParam
:
LoginViewParam
@Binding
var
viewMode
:
LoginViewMode
@Binding
var
param
:
LoginViewParam
// @EnvironmentObject var loginViewParam = LoginViewParam()
let
itemHPadding
:
Double
=
16
let
itemHPadding
:
Double
=
16
let
dialogBottomPadding
:
Double
=
32
let
dialogBottomPadding
:
Double
=
32
let
textFieldHeight
:
Double
=
49
let
textFieldHeight
:
Double
=
49
let
inputAreaHeight
:
Double
=
150
let
inputAreaHeight
:
Double
=
150
let
dialogHeight
:
CGFloat
=
250
let
dialogHeight
:
CGFloat
=
250
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
HStack
{
VStack
{
HStack
{
VStack
{
Image
(
"account"
)
HStack
{
.
frame
(
width
:
22
,
height
:
22
)
Image
(
"account"
)
.
padding
(
.
horizontal
,
8
)
.
frame
(
width
:
22
,
height
:
22
)
.
accentColor
(
.
white
)
.
padding
(
.
horizontal
,
8
)
.
accentColor
(
.
white
)
.
foregroundColor
(
.
white
)
TextField
(
""
,
text
:
$
loginViewParam
.
shipId
,
prompt
:
Text
(
"Ship ID"
)
.
foregroundColor
(
.
white
)
)
.
frame
(
height
:
textFieldHeight
)
.
padding
(
.
trailing
)
.
foregroundColor
(
.
white
)
.
foregroundColor
(
.
white
)
.
background
(
.
lineColor01
)
.
modifier
(
TextFieldModifier
(
text
:
$
loginViewParam
.
shipId
,
inputType
:
.
UserId
))
}
Divider
()
.
frame
(
height
:
1
)
.
background
(
Color
(
.
white
))
Spacer
()
TextField
(
.
frame
(
height
:
16
)
""
,
text
:
$
param
.
shipId
,
HStack
{
prompt
:
Text
(
"Ship ID"
)
Image
(
"password"
)
.
padding
(
.
horizontal
,
4
)
.
foregroundColor
(
.
white
)
SecureField
(
""
,
text
:
$
loginViewParam
.
password
,
prompt
:
Text
(
"Password"
)
.
foregroundColor
(
.
white
)
)
.
frame
(
height
:
textFieldHeight
)
.
padding
(
.
trailing
)
.
foregroundColor
(
.
white
)
.
foregroundColor
(
.
white
)
}
)
.
frame
(
height
:
textFieldHeight
)
.
padding
(
.
trailing
)
.
foregroundColor
(
.
white
)
.
background
(
.
lineColor01
)
.
modifier
(
TextFieldModifier
(
text
:
$
param
.
shipId
,
inputType
:
.
UserId
))
Divider
()
.
frame
(
height
:
1
)
.
background
(
Color
(
.
white
))
}
}
Divider
()
.
frame
(
height
:
1
)
.
background
(
Color
(
.
white
))
Spacer
()
Spacer
()
.
frame
(
height
:
40
)
.
frame
(
height
:
16
)
Button
(
action
:
{
HStack
{
loginViewParam
.
viewMode
=
.
InputUserName
Image
(
"password"
)
},
label
:
{
.
padding
(
.
horizontal
,
4
)
Text
(
"Sign In"
)
.
foregroundColor
(
.
white
)
.
frame
(
height
:
60
)
SecureField
(
.
frame
(
maxWidth
:
.
infinity
)
""
,
.
foregroundColor
(
.
buttonText
)
text
:
$
param
.
password
,
.
background
(
.
primaryActiveIcon
)
prompt
:
Text
(
"Password"
)
})
.
foregroundColor
(
.
white
)
)
.
frame
(
height
:
textFieldHeight
)
.
padding
(
.
trailing
)
.
foregroundColor
(
.
white
)
}
Divider
()
.
frame
(
height
:
1
)
.
background
(
Color
(
.
white
))
}
}
.
padding
(
EdgeInsets
(
top
:
26
,
leading
:
20
,
bottom
:
40
,
trailing
:
20
))
Spacer
()
.
frame
(
height
:
40
)
Button
(
action
:
{
viewMode
=
.
InputUserName
},
label
:
{
Text
(
"Sign In"
)
.
frame
(
height
:
60
)
.
frame
(
maxWidth
:
.
infinity
)
.
foregroundColor
(
.
buttonText
)
.
background
(
.
primaryActiveIcon
)
})
}
}
.
padding
(
EdgeInsets
(
top
:
26
,
leading
:
20
,
bottom
:
40
,
trailing
:
20
))
.
background
(
ColorSet
.
BackgroundSecondary
.
color
)
.
background
(
ColorSet
.
BackgroundSecondary
.
color
)
.
padding
(
.
horizontal
,
30
)
.
padding
(
.
horizontal
,
30
)
}
}
}
}
#Preview {
#Preview {
InputIdPassWordView
()
InputIdPassWordView
(
viewMode
:
.
constant
(
.
InputIdPassword
),
param
:
.
constant
(
LoginViewParam
()))
.
environmentObject
(
LoginViewParam
())
}
}
Seilassist/Sailassist/Login/View/InputUserNameView.swift
View file @
40585846
...
@@ -9,7 +9,7 @@ import SwiftUI
...
@@ -9,7 +9,7 @@ import SwiftUI
struct
InputUserNameView
:
View
{
struct
InputUserNameView
:
View
{
@Binding
var
isLogin
:
Bool
@Binding
var
isLogin
:
Bool
@
EnvironmentObject
var
loginViewP
aram
:
LoginViewParam
@
Binding
var
p
aram
:
LoginViewParam
let
itemHPadding
:
Double
=
16
let
itemHPadding
:
Double
=
16
let
dialogBottomPadding
:
Double
=
32
let
dialogBottomPadding
:
Double
=
32
let
textFieldHeight
:
Double
=
40
let
textFieldHeight
:
Double
=
40
...
@@ -37,7 +37,7 @@ struct InputUserNameView: View {
...
@@ -37,7 +37,7 @@ struct InputUserNameView: View {
.
foregroundColor
(
.
white
)
.
foregroundColor
(
.
white
)
TextField
(
TextField
(
""
,
""
,
text
:
$
loginViewP
aram
.
userName
,
text
:
$
p
aram
.
userName
,
prompt
:
Text
(
"Please set user name"
)
prompt
:
Text
(
"Please set user name"
)
.
foregroundColor
(
.
white
)
.
foregroundColor
(
.
white
)
)
)
...
@@ -58,10 +58,9 @@ struct InputUserNameView: View {
...
@@ -58,10 +58,9 @@ struct InputUserNameView: View {
Button
(
action
:
{
Button
(
action
:
{
// TODO: API通信 ログイン認証処理
// TODO: API通信 ログイン認証処理
print
(
"signin: id(
\(
param
.
shipId
)
), pass(
\(
param
.
password
)
), name(
\(
param
.
userName
)
)"
)
isLogin
=
true
isLogin
=
true
Preferences
.
lastLoginDate_Int64
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
Preferences
.
lastLoginDate_Int64
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
},
label
:
{
},
label
:
{
Text
(
"Sign In"
)
Text
(
"Sign In"
)
.
frame
(
height
:
50
)
.
frame
(
height
:
50
)
...
@@ -83,7 +82,7 @@ struct InputUserNameView: View {
...
@@ -83,7 +82,7 @@ struct InputUserNameView: View {
}
}
#Preview {
#Preview {
InputUserNameView
(
isLogin
:
.
constant
(
false
))
InputUserNameView
(
isLogin
:
.
constant
(
false
)
,
param
:
.
constant
(
LoginViewParam
())
)
.
environmentObject
(
LoginViewParam
())
}
}
Seilassist/Sailassist/Login/View/LoginTypeSelectView.swift
View file @
40585846
...
@@ -9,15 +9,12 @@ import SwiftUI
...
@@ -9,15 +9,12 @@ import SwiftUI
struct
LoginTypeSelectView
:
View
{
struct
LoginTypeSelectView
:
View
{
@Binding
var
isQrRead
:
Bool
@Binding
var
isQrRead
:
Bool
@EnvironmentObject
var
loginViewParam
:
LoginViewParam
@Binding
var
viewMode
:
LoginViewMode
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
HStack
{
HStack
{
Spacer
()
.
frame
(
width
:
32
)
Button
(
action
:
{
Button
(
action
:
{
loginViewParam
.
viewMode
=
.
SelectType
isQrRead
=
true
isQrRead
=
true
},
label
:
{
},
label
:
{
Text
(
"QRを読み込む"
)
Text
(
"QRを読み込む"
)
...
@@ -26,14 +23,11 @@ struct LoginTypeSelectView: View{
...
@@ -26,14 +23,11 @@ struct LoginTypeSelectView: View{
.
foregroundColor
(
ColorSet
.
ButtonText
.
color
)
.
foregroundColor
(
ColorSet
.
ButtonText
.
color
)
.
background
(
ColorSet
.
PrimaryActiveIcon
.
color
)
.
background
(
ColorSet
.
PrimaryActiveIcon
.
color
)
})
})
Spacer
()
.
frame
(
width
:
32
)
}
}
.
padding
(
.
horizontal
,
32
)
Button
(
action
:
{
Button
(
action
:
{
loginViewParam
.
viewMode
=
.
InputIdPassword
print
(
"change mode"
)
viewMode
=
.
InputIdPassword
},
label
:
{
},
label
:
{
Text
(
"Ship ID/Passwordを入力"
)
Text
(
"Ship ID/Passwordを入力"
)
.
underline
()
.
underline
()
...
@@ -44,6 +38,5 @@ struct LoginTypeSelectView: View{
...
@@ -44,6 +38,5 @@ struct LoginTypeSelectView: View{
}
}
}
}
#Preview {
#Preview {
LoginTypeSelectView
(
isQrRead
:
.
constant
(
false
))
LoginTypeSelectView
(
isQrRead
:
.
constant
(
false
),
viewMode
:
.
constant
(
.
SelectType
))
.
environmentObject
(
LoginViewParam
())
}
}
Seilassist/Sailassist/Tab/MainTabView.swift
View file @
40585846
...
@@ -38,29 +38,24 @@ struct MainTabView: View {
...
@@ -38,29 +38,24 @@ struct MainTabView: View {
ChatView
()
ChatView
()
}
}
.
tag
(
Tab
.
chat
)
.
tag
(
Tab
.
chat
)
.
hidden
()
.
hideNativeTabBar
()
NavigationStack
{
NavigationStack
{
MapRepresentable
()
MapRepresentable
()
}
}
.
tag
(
Tab
.
task
)
.
tag
(
Tab
.
task
)
.
hideNativeTabBar
()
NavigationStack
{
NavigationStack
{
NotificationView
()
NotificationView
()
}
}
.
tag
(
Tab
.
alert
)
.
tag
(
Tab
.
alert
)
.
hideNativeTabBar
()
NavigationStack
{
NavigationStack
{
MenuView
()
MenuView
()
}
}
.
tag
(
Tab
.
menu
)
.
tag
(
Tab
.
menu
)
.
hideNativeTabBar
()
}
}
.
hideNativeTabBar
()
.
sheet
(
isPresented
:
.
constant
(
isTaskSel
&&
isTabShow
),
content
:
{
.
sheet
(
isPresented
:
.
constant
(
isTaskSel
&&
isTabShow
),
content
:
{
NavigationStack
{
NavigationStack
{
MapTaskView
()
MapTaskView
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment