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
ec125999
Commit
ec125999
authored
Jul 22, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
チャットワーニングモード対応
チャット・通知 既読マーク
parent
d074fcd0
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
155 additions
and
67 deletions
+155
-67
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+3
-3
NotificationView.swift
Seilassist/Sailassist/Alert/NotificationView.swift
+9
-0
NotificationContentView.swift
...ssist/Sailassist/Alert/View/NotificationContentView.swift
+0
-3
ChatView.swift
Seilassist/Sailassist/Chat/ChatView.swift
+37
-3
ChatMemberView.swift
Seilassist/Sailassist/Chat/View/ChatMemberView.swift
+3
-1
ChatTitleView.swift
Seilassist/Sailassist/Chat/View/ChatTitleView.swift
+3
-1
ChatUrlImageView.swift
Seilassist/Sailassist/Chat/View/ChatUrlImageView.swift
+5
-2
ChatUrlRawImageView.swift
Seilassist/Sailassist/Chat/View/ChatUrlRawImageView.swift
+1
-0
MyChatContentView.swift
Seilassist/Sailassist/Chat/View/MyChatContentView.swift
+16
-6
OtherChatContentView.swift
Seilassist/Sailassist/Chat/View/OtherChatContentView.swift
+16
-29
ReqMessage.swift
Seilassist/Sailassist/Json/ReqMessage.swift
+1
-0
ResChatMessage.swift
Seilassist/Sailassist/Json/ResChatMessage.swift
+1
-0
ResGetMessages.swift
Seilassist/Sailassist/Json/ResGetMessages.swift
+7
-5
MapRepresentable.swift
Seilassist/Sailassist/Map/MapRepresentable.swift
+4
-0
EcaSettingView.swift
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
+1
-0
FuelSwitchingView.swift
Seilassist/Sailassist/Map/Task/View/FuelSwitchingView.swift
+2
-2
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+9
-4
MainTabView.swift
Seilassist/Sailassist/Tab/MainTabView.swift
+37
-8
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
ec125999
...
@@ -1307,7 +1307,7 @@
...
@@ -1307,7 +1307,7 @@
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
39
;
CURRENT_PROJECT_VERSION
=
40
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
@@ -1353,7 +1353,7 @@
...
@@ -1353,7 +1353,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
39
;
CURRENT_PROJECT_VERSION
=
40
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
@@ -1536,7 +1536,7 @@
...
@@ -1536,7 +1536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
39
;
CURRENT_PROJECT_VERSION
=
40
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
...
Seilassist/Sailassist/Alert/NotificationView.swift
View file @
ec125999
...
@@ -35,6 +35,15 @@ struct NotificationView: View {
...
@@ -35,6 +35,15 @@ struct NotificationView: View {
Spacer
()
Spacer
()
}
}
.
background
(
ColorSet
.
BackgroundPrimary
.
color
)
.
background
(
ColorSet
.
BackgroundPrimary
.
color
)
.
onAppear
{
let
pushCount
=
pushHist
.
viewCnt
print
(
debug
:
"
\(
pushCount
)
"
)
pushHist
.
viewCnt
=
0
}
// .onChange(of: pushHist.pushHistoryData.count) { newValue in
// let pushCount = pushHist.viewCnt
// print(debug: "\(pushCount)")
// }
}
}
struct
TitleView
:
View
{
struct
TitleView
:
View
{
...
...
Seilassist/Sailassist/Alert/View/NotificationContentView.swift
View file @
ec125999
...
@@ -47,9 +47,6 @@ struct NotificationContentView: View {
...
@@ -47,9 +47,6 @@ struct NotificationContentView: View {
.
font
(
FontStyle
.
SupplementText2
.
font
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
}
}
.
padding
(
EdgeInsets
(
top
:
17
,
leading
:
30
,
bottom
:
17
,
trailing
:
30
))
.
padding
(
EdgeInsets
(
top
:
17
,
leading
:
30
,
bottom
:
17
,
trailing
:
30
))
.
onAppear
{
SharingData
.
pushHistory
.
viewCnt
=
0
}
}
}
}
}
...
...
Seilassist/Sailassist/Chat/ChatView.swift
View file @
ec125999
...
@@ -31,6 +31,7 @@ struct ChatView: View {
...
@@ -31,6 +31,7 @@ struct ChatView: View {
.
frame
(
height
:
20
)
.
frame
(
height
:
20
)
ForEach
(
message
.
messages
,
id
:
\
.
messageId
)
{
msg
in
ForEach
(
message
.
messages
,
id
:
\
.
messageId
)
{
msg
in
if
msg
.
message
!=
nil
{
if
msg
.
from
==
Preferences
.
UserName
{
if
msg
.
from
==
Preferences
.
UserName
{
//自分のメッセージ
//自分のメッセージ
MyChatContentView
(
message
:
msg
)
MyChatContentView
(
message
:
msg
)
...
@@ -40,19 +41,23 @@ struct ChatView: View {
...
@@ -40,19 +41,23 @@ struct ChatView: View {
OtherChatContentView
(
message
:
msg
)
OtherChatContentView
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
.
padding
(
.
bottom
,
24
)
}
}
}
else
{
AlertChatMessage
(
message
:
msg
)
.
padding
(
.
bottom
,
24
)
}
}
}
}
}
.
onAppear
{
.
onAppear
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onAppear"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
message
.
viewCnt
=
0
}
}
}
}
.
onChange
(
of
:
message
.
messages
.
count
)
{
newValue
in
.
onChange
(
of
:
message
.
messages
.
count
)
{
newValue
in
withAnimation
{
withAnimation
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onChange"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
message
.
viewCnt
=
0
}
}
}
}
}
}
...
@@ -60,8 +65,8 @@ struct ChatView: View {
...
@@ -60,8 +65,8 @@ struct ChatView: View {
withAnimation
{
withAnimation
{
guard
!
value
.
isEmpty
else
{
return
}
guard
!
value
.
isEmpty
else
{
return
}
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onReceive"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
message
.
viewCnt
=
0
}
}
}
}
}
}
...
@@ -97,6 +102,35 @@ struct ChatView: View {
...
@@ -97,6 +102,35 @@ struct ChatView: View {
}
}
}
}
struct
AlertChatMessage
:
View
{
@Environment(\ .colorScheme)
var
colorScheme
var
message
:
ChatMessage
var
body
:
some
View
{
if
message
.
mode
==
1
{
Rectangle
()
.
fill
(
colorScheme
==
.
light
?
.
black
:
.
white
)
.
frame
(
width
:
300
,
height
:
1
)
.
overlay
(
Text
(
" Warrning mode start "
+
DateTextLib
.
ISO86012FormatText
(
message
.
time
,
format
:
"yyyy/MM/dd HH:mm "
,
errFormat
:
""
))
.
font
(
FontStyle
.
DateText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
background
(
ColorSet
.
BackgroundPrimary
.
color
)
)
}
else
{
Rectangle
()
.
fill
(
colorScheme
==
.
light
?
.
black
:
.
white
)
.
frame
(
width
:
300
,
height
:
1
)
.
overlay
(
Text
(
" Warrning mode end "
+
DateTextLib
.
ISO86012FormatText
(
message
.
time
,
format
:
"yyyy/MM/dd HH:mm "
,
errFormat
:
""
))
.
font
(
FontStyle
.
DateText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
background
(
ColorSet
.
BackgroundPrimary
.
color
)
)
}
}
}
#Preview {
#Preview {
ChatView
()
ChatView
()
}
}
...
...
Seilassist/Sailassist/Chat/View/ChatMemberView.swift
View file @
ec125999
...
@@ -26,11 +26,13 @@ struct ChatMemberView: View {
...
@@ -26,11 +26,13 @@ struct ChatMemberView: View {
.
frame
(
width
:
12
,
height
:
12
)
.
frame
(
width
:
12
,
height
:
12
)
}
}
Text
(
user
.
name
)
if
let
name
=
user
.
name
{
Text
(
name
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
font
(
FontStyle
.
SupplementText
.
font
)
.
font
(
FontStyle
.
SupplementText
.
font
)
}
}
}
}
}
.
listRowBackground
(
ColorSet
.
ModalWindowFront
.
color
)
.
listRowBackground
(
ColorSet
.
ModalWindowFront
.
color
)
.
listRowSeparatorTint
(
ColorSet
.
LineModal
.
color
)
.
listRowSeparatorTint
(
ColorSet
.
LineModal
.
color
)
}
}
...
...
Seilassist/Sailassist/Chat/View/ChatTitleView.swift
View file @
ec125999
...
@@ -75,9 +75,11 @@ struct ChatTitleView: View {
...
@@ -75,9 +75,11 @@ struct ChatTitleView: View {
func
userName
()
->
String
{
func
userName
()
->
String
{
var
usersName
=
""
var
usersName
=
""
for
user
in
message
.
users
{
for
user
in
message
.
users
{
usersName
+=
user
.
name
if
let
name
=
user
.
name
{
usersName
+=
name
usersName
+=
","
usersName
+=
","
}
}
}
return
usersName
return
usersName
}
}
...
...
Seilassist/Sailassist/Chat/View/ChatUrlImageView.swift
View file @
ec125999
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
import
SwiftUI
import
SwiftUI
struct
ChatUrlImageView
:
View
{
struct
ChatUrlImageView
:
View
{
var
imageUrl
:
String
var
imageUrl
=
""
init
(
message
:
ChatMessage
)
{
init
(
message
:
ChatMessage
)
{
self
.
imageUrl
=
message
.
message
if
let
url
=
message
.
message
{
self
.
imageUrl
=
url
}
}
}
var
body
:
some
View
{
var
body
:
some
View
{
...
@@ -43,6 +45,7 @@ struct ChatUrlImageView: View {
...
@@ -43,6 +45,7 @@ struct ChatUrlImageView: View {
location
:
1
,
location
:
1
,
from
:
"はだだ"
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
fromId
:
"487420489"
,
mode
:
0
,
message
:
"999"
,
message
:
"999"
,
stampId
:
0
,
stampId
:
0
,
viewer
:
[
viewer
:
[
...
...
Seilassist/Sailassist/Chat/View/ChatUrlRawImageView.swift
View file @
ec125999
...
@@ -51,6 +51,7 @@ struct ChatUrlRawImageView: View {
...
@@ -51,6 +51,7 @@ struct ChatUrlRawImageView: View {
location
:
1
,
location
:
1
,
from
:
"はだだ"
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
fromId
:
"487420489"
,
mode
:
0
,
message
:
"999"
,
message
:
"999"
,
stampId
:
0
,
stampId
:
0
,
viewer
:
[
viewer
:
[
...
...
Seilassist/Sailassist/Chat/View/MyChatContentView.swift
View file @
ec125999
...
@@ -11,18 +11,28 @@ struct MyChatContentView: View {
...
@@ -11,18 +11,28 @@ struct MyChatContentView: View {
var
message
:
ChatMessage
var
message
:
ChatMessage
var
body
:
some
View
{
var
body
:
some
View
{
HStack
{
HStack
{
Spacer
()
Spacer
()
VStack
(
alignment
:
.
trailing
,
spacing
:
6
)
{
VStack
(
alignment
:
.
trailing
,
spacing
:
6
)
{
Group
{
Group
{
if
message
.
message
.
contains
(
"https://"
)
{
//TODO: stampIdが0
if
let
msg
=
message
.
message
{
if
msg
.
contains
(
"https://"
)
{
ChatUrlImageView
(
message
:
message
)
ChatUrlImageView
(
message
:
message
)
}
else
{
}
else
{
Text
(
message
.
message
)
Text
(
msg
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
padding
(
15
)
.
padding
(
15
)
.
background
(
ColorSet
.
ChatBaloon
.
color
)
.
background
(
ColorSet
.
ChatBaloon
.
color
)
.
cornerRadius
(
10
,
corners
:
[
.
tl
,
.
tr
,
.
br
])
.
border
(
Color
.
red
.
gradient
.
opacity
(
0.6
),
width
:
(
message
.
mode
==
1
?
6
:
0
))
.
clipShape
(
.
rect
(
topLeadingRadius
:
10
,
bottomLeadingRadius
:
0
,
bottomTrailingRadius
:
10
,
topTrailingRadius
:
10
))
}
}
}
}
}
...
@@ -39,7 +49,7 @@ struct MyChatContentView: View {
...
@@ -39,7 +49,7 @@ struct MyChatContentView: View {
.
frame
(
width
:
12
,
height
:
12
)
.
frame
(
width
:
12
,
height
:
12
)
.
padding
(
.
trailing
,
4
)
.
padding
(
.
trailing
,
4
)
Text
(
String
(
viewerCnt
.
0
))
Text
(
String
(
viewerCnt
.
1
))
Image
(
"chat_ship"
)
Image
(
"chat_ship"
)
.
resizable
()
.
resizable
()
...
@@ -47,14 +57,13 @@ struct MyChatContentView: View {
...
@@ -47,14 +57,13 @@ struct MyChatContentView: View {
.
frame
(
width
:
12
,
height
:
12
)
.
frame
(
width
:
12
,
height
:
12
)
.
padding
(
.
trailing
,
4
)
.
padding
(
.
trailing
,
4
)
Text
(
String
(
viewerCnt
.
1
))
Text
(
String
(
viewerCnt
.
0
))
}
}
.
font
(
FontStyle
.
DateText
.
font
)
.
font
(
FontStyle
.
DateText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
.
foregroundColor
(
ColorSet
.
BodyDescriptiion
.
color
)
}
}
.
padding
(
.
trailing
,
20
)
.
padding
(
.
trailing
,
20
)
}
}
.
padding
(
.
leading
,
80
)
}
}
func
viewerCnt
()
->
(
Int
,
Int
)
{
func
viewerCnt
()
->
(
Int
,
Int
)
{
...
@@ -80,6 +89,7 @@ struct MyChatContentView: View {
...
@@ -80,6 +89,7 @@ struct MyChatContentView: View {
location
:
1
,
location
:
1
,
from
:
"はだだ"
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
fromId
:
"487420489"
,
mode
:
0
,
message
:
"999"
,
message
:
"999"
,
stampId
:
0
,
stampId
:
0
,
viewer
:
[
viewer
:
[
...
...
Seilassist/Sailassist/Chat/View/OtherChatContentView.swift
View file @
ec125999
...
@@ -12,20 +12,31 @@ struct OtherChatContentView: View {
...
@@ -12,20 +12,31 @@ struct OtherChatContentView: View {
var
body
:
some
View
{
var
body
:
some
View
{
HStack
{
HStack
{
VStack
(
alignment
:
.
leading
,
spacing
:
4
)
{
VStack
(
alignment
:
.
leading
,
spacing
:
4
)
{
Text
(
message
.
from
)
if
let
from
=
message
.
from
{
Text
(
from
)
.
font
(
FontStyle
.
EmphasisText
.
font
)
.
font
(
FontStyle
.
EmphasisText
.
font
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
}
VStack
(
alignment
:
.
leading
,
spacing
:
10
)
{
VStack
(
alignment
:
.
leading
,
spacing
:
10
)
{
Group
{
Group
{
if
message
.
message
.
contains
(
"https://"
)
{
//TODO: stampIdが0
if
let
msg
=
message
.
message
{
if
msg
.
contains
(
"https://"
)
{
ChatUrlImageView
(
message
:
message
)
ChatUrlImageView
(
message
:
message
)
}
else
{
}
else
{
Text
(
message
.
message
)
Text
(
msg
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
padding
(
15
)
.
padding
(
15
)
.
background
(
ColorSet
.
ChatBaloon
.
color
)
.
background
(
ColorSet
.
ChatBaloon
.
color
)
.
cornerRadius
(
10
,
corners
:
[
.
tl
,
.
tr
,
.
br
])
.
border
(
Color
.
red
.
gradient
.
opacity
(
0.6
),
width
:
(
message
.
mode
==
1
?
6
:
0
))
.
clipShape
(
.
rect
(
topLeadingRadius
:
10
,
bottomLeadingRadius
:
10
,
bottomTrailingRadius
:
0
,
topTrailingRadius
:
10
))
}
}
}
}
}
...
@@ -39,31 +50,6 @@ struct OtherChatContentView: View {
...
@@ -39,31 +50,6 @@ struct OtherChatContentView: View {
.
padding
(
.
leading
,
20
)
.
padding
(
.
leading
,
20
)
Spacer
()
Spacer
()
}
}
.
padding
(
.
trailing
,
80
)
}
}
struct
AlertChatMessage
:
View
{
var
message
:
ChatMessage
var
body
:
some
View
{
HStack
{
Image
(
systemName
:
"exclamationmark.triangle.fill"
)
.
foregroundColor
(
.
red
)
.
frame
(
width
:
48
,
height
:
48
)
Text
(
alertStr
())
.
font
(
FontStyle
.
DefaultText
.
font
)
.
foregroundColor
(
ColorSet
.
BodyChat
.
color
)
.
padding
(
15
)
.
background
(
ColorSet
.
ChatBaloon
.
color
)
.
cornerRadius
(
10
,
corners
:
[
.
tl
,
.
tr
,
.
br
])
}
}
func
alertStr
()
->
String
{
var
msg
=
message
.
message
msg
.
removeFirst
()
return
msg
}
}
}
}
...
@@ -76,6 +62,7 @@ struct AlertChatMessage: View {
...
@@ -76,6 +62,7 @@ struct AlertChatMessage: View {
location
:
1
,
location
:
1
,
from
:
"はだだ"
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
fromId
:
"487420489"
,
mode
:
0
,
message
:
"999"
,
message
:
"999"
,
stampId
:
0
,
stampId
:
0
,
viewer
:
[
viewer
:
[
...
...
Seilassist/Sailassist/Json/ReqMessage.swift
View file @
ec125999
...
@@ -15,6 +15,7 @@ struct ReqMessage : Codable {
...
@@ -15,6 +15,7 @@ struct ReqMessage : Codable {
var
location
:
Int
=
0
//1:Shore / 2:Ship
var
location
:
Int
=
0
//1:Shore / 2:Ship
var
from
:
String
=
""
//投稿者名
var
from
:
String
=
""
//投稿者名
var
fromId
:
String
=
""
//ユーザーID
var
fromId
:
String
=
""
//ユーザーID
var
mode
:
Int
=
0
var
message
:
String
=
""
//テキスト
var
message
:
String
=
""
//テキスト
var
stampId
:
Int
=
0
//スタンプ番号 0:Fire〜
var
stampId
:
Int
=
0
//スタンプ番号 0:Fire〜
...
...
Seilassist/Sailassist/Json/ResChatMessage.swift
View file @
ec125999
...
@@ -15,6 +15,7 @@ struct ResChatMessage: Codable {
...
@@ -15,6 +15,7 @@ struct ResChatMessage: Codable {
var
location
:
Int
//1:Shore、2:Ship
var
location
:
Int
//1:Shore、2:Ship
var
from
:
String
//投稿者名
var
from
:
String
//投稿者名
var
fromId
:
String
//ユーザーID
var
fromId
:
String
//ユーザーID
var
mode
:
Int
var
message
:
String
//テキスト
var
message
:
String
//テキスト
var
stampId
:
Int
//スタンプ番号
var
stampId
:
Int
//スタンプ番号
}
}
Seilassist/Sailassist/Json/ResGetMessages.swift
View file @
ec125999
...
@@ -19,9 +19,10 @@ struct ChatMessage: Codable {
...
@@ -19,9 +19,10 @@ struct ChatMessage: Codable {
var
type
:
Int
//0:テキスト , 1:スタンプ , 2:画像
var
type
:
Int
//0:テキスト , 1:スタンプ , 2:画像
var
time
:
String
//投稿日時
var
time
:
String
//投稿日時
var
location
:
Int
//1:Shore , 2:Ship
var
location
:
Int
//1:Shore , 2:Ship
var
from
:
String
//投稿者名
var
from
:
String
?
//投稿者名
var
fromId
:
String
?
//ユーザーID
var
fromId
:
String
?
//ユーザーID
var
message
:
String
//テキスト時:テキスト , 画像時:サムネイルのUri
var
mode
:
Int
// 0:通常 , 1:Warning中
var
message
:
String
?
//テキスト時:テキスト , 画像時:サムネイルのUri
var
stampId
:
Int
//スタンプ番号 0:Fire~
var
stampId
:
Int
//スタンプ番号 0:Fire~
var
viewer
:
[
Viewer
]
=
[]
//閲覧者情報
var
viewer
:
[
Viewer
]
=
[]
//閲覧者情報
}
}
...
@@ -29,12 +30,13 @@ struct ChatMessage: Codable {
...
@@ -29,12 +30,13 @@ struct ChatMessage: Codable {
struct
Viewer
:
Codable
{
struct
Viewer
:
Codable
{
var
time
:
String
//確認日時
var
time
:
String
//確認日時
var
location
:
Int
//1:Shore , 2:Ship
var
location
:
Int
//1:Shore , 2:Ship
var
id
:
String
//ユーザーID
var
id
:
String
?
//ユーザーID
var
name
:
String
?
//ユーザー名
}
}
struct
ChatUser
:
Codable
{
struct
ChatUser
:
Codable
{
var
time
:
String
//最終アクセス日時
var
time
:
String
//最終アクセス日時
var
location
:
Int
//1:Shore , 2:Ship
var
location
:
Int
//1:Shore , 2:Ship
var
id
:
String
//ログイン時のデバイスID
var
id
:
String
?
//ログイン時のデバイスID
var
name
:
String
//ユーザー名
var
name
:
String
?
//ユーザー名
}
}
Seilassist/Sailassist/Map/MapRepresentable.swift
View file @
ec125999
...
@@ -1145,12 +1145,16 @@ class MapViewController : UIViewController {
...
@@ -1145,12 +1145,16 @@ class MapViewController : UIViewController {
guard
let
Id
=
jsonData
?
.
rawValue
else
{
return
}
guard
let
Id
=
jsonData
?
.
rawValue
else
{
return
}
if
SharingData
.
nga
.
editNga
?
.
isLock
==
false
{
if
SharingData
.
nga
.
editNga
?
.
isLock
==
false
{
if
let
editNga
=
SharingData
.
nga
.
editNga
{
if
editNga
.
points
.
count
<
ngaAreaPointMax
{
if
let
noStr
=
Id
as?
String
{
if
let
noStr
=
Id
as?
String
{
if
let
no
=
Int
(
noStr
)
{
if
let
no
=
Int
(
noStr
)
{
SharingData
.
nga
.
editNga
?
.
points
.
insert
(
coordinate
,
at
:
no
)
SharingData
.
nga
.
editNga
?
.
points
.
insert
(
coordinate
,
at
:
no
)
}
}
}
}
}
}
}
}
default
:
default
:
if
SharingData
.
nga
.
editType
==
EditNgaType
.
addPoint
{
if
SharingData
.
nga
.
editType
==
EditNgaType
.
addPoint
{
if
let
editNga
=
SharingData
.
nga
.
editNga
{
if
let
editNga
=
SharingData
.
nga
.
editNga
{
...
...
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
View file @
ec125999
...
@@ -39,6 +39,7 @@ struct EcaSettingView: View {
...
@@ -39,6 +39,7 @@ struct EcaSettingView: View {
var
ecaData
=
edittingEca
var
ecaData
=
edittingEca
ecaData
.
isEnable
=
true
ecaData
.
isEnable
=
true
SharingData
.
eca
.
editEcaArea
(
key
:
edittingEca
.
areaId
,
value
:
ecaData
,
type
:
EcaOperation
.
Change
)
SharingData
.
eca
.
editEcaArea
(
key
:
edittingEca
.
areaId
,
value
:
ecaData
,
type
:
EcaOperation
.
Change
)
taskViewModel
.
viewMode
=
.
FuelSwitching
},
label
:
{
},
label
:
{
Text
(
"Register"
)
Text
(
"Register"
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
font
(
FontStyle
.
DefaultText
.
font
)
...
...
Seilassist/Sailassist/Map/Task/View/FuelSwitchingView.swift
View file @
ec125999
...
@@ -55,8 +55,8 @@ struct FuelSwitchingView: View {
...
@@ -55,8 +55,8 @@ struct FuelSwitchingView: View {
if
let
ecaArea
=
taskViewModel
.
edittingEcaArea
{
if
let
ecaArea
=
taskViewModel
.
edittingEcaArea
{
var
newData
=
ecaArea
var
newData
=
ecaArea
newData
.
isRunning
=
false
newData
.
isRunning
=
false
newData
.
status
=
EcaState
.
end
newData
.
status
=
EcaState
.
cancel
ecaData
.
editEcaArea
(
key
:
ecaArea
.
areaId
,
value
:
newData
,
type
:
EcaOperation
.
End
)
ecaData
.
editEcaArea
(
key
:
ecaArea
.
areaId
,
value
:
newData
,
type
:
EcaOperation
.
Cancel
)
}
}
taskViewModel
.
edittingEcaArea
=
nil
taskViewModel
.
edittingEcaArea
=
nil
}
}
...
...
Seilassist/Sailassist/SailassistApp.swift
View file @
ec125999
...
@@ -179,7 +179,7 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
...
@@ -179,7 +179,7 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
}
}
private
func
handleChatMessage
(
message
:
ResChatMessage
)
{
private
func
handleChatMessage
(
message
:
ResChatMessage
)
{
let
ownMsg
=
ChatMessage
(
shipId
:
message
.
shipId
,
messageId
:
message
.
messageId
,
type
:
message
.
type
,
time
:
message
.
time
,
location
:
message
.
location
,
from
:
message
.
from
,
fromId
:
message
.
fromId
,
message
:
message
.
message
,
stampId
:
message
.
stampId
,
viewer
:
[])
let
ownMsg
=
ChatMessage
(
shipId
:
message
.
shipId
,
messageId
:
message
.
messageId
,
type
:
message
.
type
,
time
:
message
.
time
,
location
:
message
.
location
,
from
:
message
.
from
,
fromId
:
message
.
fromId
,
m
ode
:
message
.
mode
,
m
essage
:
message
.
message
,
stampId
:
message
.
stampId
,
viewer
:
[])
self
.
msg
.
messages
.
append
(
ownMsg
)
self
.
msg
.
messages
.
append
(
ownMsg
)
}
}
...
@@ -244,11 +244,12 @@ class SignalR: NSObject {
...
@@ -244,11 +244,12 @@ class SignalR: NSObject {
request
.
location
=
2
//1:Shore , 2:Ship
request
.
location
=
2
//1:Shore , 2:Ship
request
.
from
=
Preferences
.
UserName
//投稿者名
request
.
from
=
Preferences
.
UserName
//投稿者名
request
.
fromId
=
String
(
SharingData
.
my
.
id
)
//ユーザーID
request
.
fromId
=
String
(
SharingData
.
my
.
id
)
//ユーザーID
if
msg
.
mode
{
if
SharingData
.
message
.
mode
{
request
.
m
essage
=
"⚠️
\n
"
+
message
request
.
m
ode
=
1
}
else
{
}
else
{
request
.
m
essage
=
message
request
.
m
ode
=
0
}
}
request
.
message
=
message
request
.
stampId
=
0
//スタンプ番号 0:Fire~
request
.
stampId
=
0
//スタンプ番号 0:Fire~
if
message
!=
""
{
if
message
!=
""
{
...
@@ -354,18 +355,22 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
...
@@ -354,18 +355,22 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
}
}
case
"sailassist"
:
case
"sailassist"
:
print
(
debug
:
"sailassist"
)
print
(
debug
:
"sailassist"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"bam"
:
case
"bam"
:
print
(
debug
:
"bam"
)
print
(
debug
:
"bam"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"route"
:
case
"route"
:
print
(
debug
:
"route"
)
print
(
debug
:
"route"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"emergency"
:
case
"emergency"
:
print
(
debug
:
"emergency"
)
print
(
debug
:
"emergency"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
default
:
default
:
...
...
Seilassist/Sailassist/Tab/MainTabView.swift
View file @
ec125999
...
@@ -145,20 +145,49 @@ struct CustomTabBar: View {
...
@@ -145,20 +145,49 @@ struct CustomTabBar: View {
//チャットTab上の既読マーク
//チャットTab上の既読マーク
if
tab
==
Tab
.
chat
{
if
tab
==
Tab
.
chat
{
if
message
.
viewCnt
!=
0
{
if
message
.
viewCnt
!=
0
{
Rectangle
()
if
message
.
viewCnt
<
10
{
.
foregroundColor
(
.
red
)
Ellipse
()
.
fill
(
Color
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
frame
(
width
:
12
,
height
:
12
)
.
cornerRadius
(
60
)
.
overlay
(
Text
(
String
(
message
.
viewCnt
))
.
font
(
FontStyle
.
VersionText
.
font
)
.
foregroundColor
(
.
white
)
)
}
else
{
Ellipse
()
.
fill
(
Color
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
overlay
(
Text
(
"-"
)
.
font
(
FontStyle
.
VersionText
.
font
)
.
foregroundColor
(
.
white
)
)
}
}
}
}
}
//チャットTab上の既読マーク
if
tab
==
Tab
.
alert
{
if
tab
==
Tab
.
map
{
if
pushHistory
.
viewCnt
!=
0
{
if
pushHistory
.
viewCnt
!=
0
{
Rectangle
()
if
pushHistory
.
viewCnt
<
10
{
.
foregroundColor
(
.
red
)
Ellipse
()
.
fill
(
Color
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
frame
(
width
:
12
,
height
:
12
)
.
cornerRadius
(
60
)
.
overlay
(
Text
(
String
(
pushHistory
.
viewCnt
))
.
font
(
FontStyle
.
VersionText
.
font
)
.
foregroundColor
(
.
white
)
)
}
else
{
Ellipse
()
.
fill
(
Color
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
overlay
(
Text
(
"-"
)
.
font
(
FontStyle
.
VersionText
.
font
)
.
foregroundColor
(
.
white
)
)
}
}
}
}
}
}
}
...
...
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