Commit 4292324a authored by shigemi miura's avatar shigemi miura

tabイメージ変更

チャット名称レイアウト変更 チャットインプット時にカメラ等を開き、閉じた場合にレイヤウトが崩れる不具合を修正 チャット参照カウントの表示を変更
parent f37540a2
......@@ -20,7 +20,7 @@ struct NotificationView: View {
.onTapGesture {
if let position = data.position {
if position.lat != nil && position.lon != nil {
selectedTabModel.activeTab = .task
selectedTabModel.activeTab = .map
pushHist.focusPushHistory = data.id
}
}
......
{
"images" : [
{
"filename" : "icon_company.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg viewBox="0 0 30 30" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M22.1438 7.87501V2.13751H7.85626V7.85626H2.13751V27.8625H13.575V22.1438H16.425V27.8625H27.8625V7.87501H22.1438ZM7.85626 25.0125H5.00626V22.1625H7.85626V25.0125ZM7.85626 19.2938H5.00626V16.4438H7.85626V19.2938ZM7.85626 13.575H5.00626V10.725H7.85626V13.575ZM13.575 19.2938H10.725V16.4438H13.575V19.2938ZM13.575 13.575H10.725V10.725H13.575V13.575ZM13.575 7.85626H10.725V5.00626H13.575V7.85626ZM19.2938 19.2938H16.4438V16.4438H19.2938V19.2938ZM19.2938 13.575H16.4438V10.725H19.2938V13.575ZM24.9938 13.575H22.1438V10.725H24.9938V13.575ZM19.2938 7.85626H16.4438V5.00626H19.2938V7.85626ZM25.0125 24.9938H22.1625V22.1438H25.0125V24.9938ZM25.0125 19.275H22.1625V16.425H25.0125V19.275Z" fill="black"/>
</svg>
{
"images" : [
{
"filename" : "icon_ship.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg viewBox="0 0 30 30" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M26.9812 16.2375L25.8937 8.36251C25.8562 8.06251 25.6125 7.85626 25.3125 7.85626H23.2687V5.23126H19.4625L18.45 7.85626H12.3375C11.8875 7.85626 11.475 8.11876 11.2687 8.53126L9.05622 13.1813L1.55622 11.7188C1.06872 11.625 0.562472 11.8313 0.262471 12.2438C-0.0375285 12.6563 -0.0187785 13.05 0.112471 13.65C0.487471 15.3375 1.12497 17.6625 2.69997 20.0438C3.71247 21.5813 5.71872 24.75 8.32497 24.7875H27.45C28.4437 24.7875 29.2875 24.0375 29.4 23.025L30.0375 16.7813L27.0187 16.2375H26.9812ZM10.575 13.425L12.075 9.82501C12.2625 9.39376 12.6937 9.09376 13.1625 9.09376H23.9437C24.2437 9.09376 24.4875 9.31876 24.525 9.60001L25.3875 15.8813L10.575 13.4063V13.425Z" fill="black"/>
<path d="M16.2375 13.05C16.8484 13.05 17.3437 12.5547 17.3437 11.9437C17.3437 11.3328 16.8484 10.8375 16.2375 10.8375C15.6265 10.8375 15.1312 11.3328 15.1312 11.9437C15.1312 12.5547 15.6265 13.05 16.2375 13.05Z" fill="black"/>
<path d="M20.5125 13.05C21.1235 13.05 21.6187 12.5547 21.6187 11.9437C21.6187 11.3328 21.1235 10.8375 20.5125 10.8375C19.9015 10.8375 19.4062 11.3328 19.4062 11.9437C19.4062 12.5547 19.9015 13.05 20.5125 13.05Z" fill="black"/>
</svg>
{
"images" : [
{
"filename" : "map_light.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "map_dark.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg viewBox="0 0 100 90" fill="none" xmlns="http://www.w3.org/2000/svg" height="23" width="26"><g clip-path="url(#clip0_1572_27813)"><path d="M37.5099 22.39L37.5699 56.57V58.75C37.5699 58.75 37.5699 58.78 37.5699 58.79C37.5699 59.61 36.8999 60.28 36.0799 60.28C35.2599 60.28 34.5899 59.61 34.5899 58.79C34.5899 58.78 34.5899 58.77 34.5899 58.75L34.5299 22.39C34.5299 22.39 34.5599 20.9 36.0499 20.9C37.4199 20.9 37.4999 22.39 37.4999 22.39H37.5099ZM36.0599 16.36C33.9399 17.17 9.53992 26.69 9.53992 26.69C8.40992 27.17 7.66992 28.28 7.66992 29.51V71.62C7.66992 73.07 9.14992 74.06 10.4899 73.5L36.0399 63.57L63.9299 73.33C64.4299 73.54 64.9999 73.54 65.4999 73.33L90.2999 63.33C91.4299 62.85 92.1699 61.74 92.1699 60.51V18.39C92.1699 16.94 90.6899 15.95 89.3499 16.51L64.7199 26.44C64.7199 26.44 39.0199 17.36 36.0599 16.35V16.36ZM66.2399 68.47C66.2399 69.3 65.5599 69.97 64.7099 69.97C63.8599 69.97 63.1799 69.3 63.1799 68.47V68.45L63.2699 31.63C63.2699 30.83 63.9299 30.18 64.7499 30.18C65.5699 30.18 66.2199 30.82 66.2299 31.61V31.63V68.45L66.2399 68.47Z" fill="white" /></g><defs><clipPath id="clip0_1572_27813"><rect width="100" height="90" fill="white" /></clipPath></defs></svg>
\ No newline at end of file
<svg viewBox="0 0 100 90" fill="none" xmlns="http://www.w3.org/2000/svg" height="23" width="26"><g clip-path="url(#clip0_1572_27816)"><path d="M37.5099 22.39L37.5699 56.57V58.75C37.5699 58.75 37.5699 58.78 37.5699 58.79C37.5699 59.61 36.8999 60.28 36.0799 60.28C35.2599 60.28 34.5899 59.61 34.5899 58.79C34.5899 58.78 34.5899 58.77 34.5899 58.75L34.5299 22.39C34.5299 22.39 34.5599 20.9 36.0499 20.9C37.4199 20.9 37.4999 22.39 37.4999 22.39H37.5099ZM36.0599 16.36C33.9399 17.17 9.53992 26.69 9.53992 26.69C8.40992 27.17 7.66992 28.28 7.66992 29.51V71.62C7.66992 73.07 9.14992 74.06 10.4899 73.5L36.0399 63.57L63.9299 73.33C64.4299 73.54 64.9999 73.54 65.4999 73.33L90.2999 63.33C91.4299 62.85 92.1699 61.74 92.1699 60.51V18.39C92.1699 16.94 90.6899 15.95 89.3499 16.51L64.7199 26.44C64.7199 26.44 39.0199 17.36 36.0599 16.35V16.36ZM66.2399 68.47C66.2399 69.3 65.5599 69.97 64.7099 69.97C63.8599 69.97 63.1799 69.3 63.1799 68.47V68.45L63.2699 31.63C63.2699 30.83 63.9299 30.18 64.7499 30.18C65.5699 30.18 66.2199 30.82 66.2299 31.61V31.63V68.45L66.2399 68.47Z" fill="#7E7E84" /></g><defs><clipPath id="clip0_1572_27816"><rect width="100" height="90" fill="white" /></clipPath></defs></svg>
\ No newline at end of file
{
"images" : [
{
"filename" : "map.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<svg viewBox="0 0 100 90" fill="none" xmlns="http://www.w3.org/2000/svg" height="23" width="26"><g clip-path="url(#clip0_1572_27809)"><path d="M37.5099 22.39L37.5699 56.57V58.75C37.5699 58.75 37.5699 58.78 37.5699 58.79C37.5699 59.61 36.8999 60.28 36.0799 60.28C35.2599 60.28 34.5899 59.61 34.5899 58.79C34.5899 58.78 34.5899 58.77 34.5899 58.75L34.5299 22.39C34.5299 22.39 34.5599 20.9 36.0499 20.9C37.4199 20.9 37.4999 22.39 37.4999 22.39H37.5099ZM36.0599 16.36C33.9399 17.17 9.53992 26.69 9.53992 26.69C8.40992 27.17 7.66992 28.28 7.66992 29.51V71.62C7.66992 73.07 9.14992 74.06 10.4899 73.5L36.0399 63.57L63.9299 73.33C64.4299 73.54 64.9999 73.54 65.4999 73.33L90.2999 63.33C91.4299 62.85 92.1699 61.74 92.1699 60.51V18.39C92.1699 16.94 90.6899 15.95 89.3499 16.51L64.7199 26.44C64.7199 26.44 39.0199 17.36 36.0599 16.35V16.36ZM66.2399 68.47C66.2399 69.3 65.5599 69.97 64.7099 69.97C63.8599 69.97 63.1799 69.3 63.1799 68.47V68.45L63.2699 31.63C63.2699 30.83 63.9299 30.18 64.7499 30.18C65.5699 30.18 66.2199 30.82 66.2299 31.61V31.63V68.45L66.2399 68.47Z" fill="#21BDD1" /></g><defs><clipPath id="clip0_1572_27809"><rect width="100" height="90" fill="white" /></clipPath></defs></svg>
\ No newline at end of file
......@@ -19,7 +19,7 @@ struct ChatInputView: View {
@State var source:UIImagePickerController.SourceType = .photoLibrary
@State var isActionSheet = false
@State var isImagePicker = false
@FocusState var isKeyboard : Bool
@FocusState var isKeyboard: Bool
var body: some View {
VStack(spacing: 0){
......@@ -102,6 +102,7 @@ struct ChatInputView: View {
.fullScreenCover(isPresented: .constant(isImagePicker), onDismiss: {
//シートを閉じる時に実行する処理
sceneDelegate.tabWindow?.isHidden = false
isKeyboard = false
if imageData.count != 0 {
let jpegData = UIImage(data: imageData)!.jpegData(compressionQuality: 1.0)
......@@ -134,7 +135,7 @@ struct ChatInputView: View {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
let _ = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
case .failure(let errorCode):
print(debug: errorCode)
......
......@@ -14,9 +14,23 @@ struct ChatMemberView: View {
VStack {
List {
ForEach(message.users, id: \.id) { user in
Text(user.name)
.foregroundColor(ColorSet.BodyChat.color)
.font(FontStyle.SupplementText.font)
HStack {
if user.location == 1 {
Image("chat_company")
.resizable()
.scaledToFill()
.frame(width: 12, height: 12)
} else {
Image("chat_ship")
.resizable()
.scaledToFill()
.frame(width: 10, height: 10)
}
Text(user.name)
.foregroundColor(ColorSet.BodyChat.color)
.font(FontStyle.SupplementText.font)
}
}
.listRowBackground(ColorSet.ModalWindowFront.color)
.listRowSeparatorTint(ColorSet.LineModal.color)
......
......@@ -28,28 +28,26 @@ struct ChatTitleView: View {
Text(SharingData.my.shipName)
.font(FontStyle.TitleL.font)
let usersName = userName()
HStack {
ForEach(message.users, id: \.id) { user in
Text(user.name + ",")
.font(FontStyle.TitleS.font)
Text(usersName)
.font(FontStyle.RadioButtonText.font)
Button{
isShowMember.toggle()
}label: {
Image(systemName: isShowMember ? "chevron.down" : "chevron.up")
.resizable()
.scaledToFit()
.frame(width: 22.63, height: 12.73)
.foregroundColor(ColorSet.Body.color)
}
.frame(width: 30, height: 30)
}
}
.foregroundColor(ColorSet.Body.color)
.frame(width: 162,height: 44)
Button{
isShowMember.toggle()
}label: {
Image(systemName: isShowMember ? "chevron.down" : "chevron.up")
.resizable()
.scaledToFit()
.frame(width: 22.63, height: 12.73)
.foregroundColor(ColorSet.Body.color)
}
.frame(width: 30, height: 30)
}
Spacer()
......@@ -70,6 +68,18 @@ struct ChatTitleView: View {
.background(ColorSet.LineColor04.color)
}
}
/**
* チャット名称をまとめる
*/
func userName() -> String {
var usersName = ""
for user in message.users {
usersName += user.name
usersName += ","
}
return usersName
}
}
#Preview {
......
......@@ -41,18 +41,28 @@ struct MyChatContentView: View {
}
}
HStack(spacing: 0){
HStack(spacing: 5){
//既読マーク
Text(DateTextLib.ISO86012FormatText(message.time, format: "yyyy/MM/dd hh:mm", errFormat: ""))
.padding(.trailing, 8)
Image(systemName: "eye.fill")
let viewerCnt = viewerCnt()
Image("chat_company")
.resizable()
.scaledToFit()
.frame(width: 17, height: 17)
.padding(.trailing, 4)
Text(String(message.viewer.count))
Text(String(viewerCnt.0))
Image("chat_ship")
.resizable()
.scaledToFit()
.frame(width: 17, height: 17)
.padding(.trailing, 4)
Text(String(viewerCnt.1))
}
.font(FontStyle.DateText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
......@@ -61,6 +71,19 @@ struct MyChatContentView: View {
}
.padding(.leading, 80)
}
func viewerCnt() -> (Int, Int) {
var shipViewer = 0
var companyViewr = 0
for viewer in message.viewer {
if viewer.location == 1 {
companyViewr += 1
} else {
shipViewer += 1
}
}
return (shipViewer, companyViewr)
}
}
#Preview {
......
......@@ -25,7 +25,7 @@ struct ContentView: View {
if loginViewModel.isLogin{
guard sceneDelegate.tabWindow == nil else{ return }
sceneDelegate.addTabBar(selectedTabModel)
selectedTabModel.activeTab = .task
selectedTabModel.activeTab = .map
}
}
.fullScreenCover(isPresented: .constant(!loginViewModel.isLogin), onDismiss: {
......@@ -34,7 +34,7 @@ struct ContentView: View {
return
}
sceneDelegate.addTabBar(selectedTabModel)
selectedTabModel.activeTab = .task
selectedTabModel.activeTab = .map
}, content: {
LoginView(isLogin: $loginViewModel.isLogin)
.environmentObject(selectedTabModel)
......
......@@ -50,7 +50,7 @@ enum HttpRequestType : String {
case GetMessage = "https://ssv-qc-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
case SignalR = "https://ssv-qc-web.azurewebsites.net/signalr/shore"
case PushHistory = "https://ssv-qc-web.azurewebsites.net/api/sailassist/pushhistory/XXXXX"
case UploadImage = "https://ssv-qc-web.azur.net/api/chatdata/uploadimage"
case UploadImage = "https://ssv-qc-web.azurewebsites.net/api/chatdata/uploadimage"
case ConnectionString = "Endpoint=sb://ssv-qc-notification.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=qjI5K38IyGfh2arFherVgp5tNUBE2U4eVClgTEQip54="
case HubName = "ssv-qc-sailassist-notification"
case storage = "https://tacmiquaritycheckstorage.z31.web.core.windows.net/"
......
......@@ -67,6 +67,7 @@ class MonitoringRoute {
}
}
case .failure(let errorCode):
print(debug: "serverError: \(errorCode)")
print(debug: errorCode)
break
}
......
......@@ -51,12 +51,15 @@ class ServerSession{
do{
if error != nil{
// print(debug: "clientError: \(error)")
throw APIError.clientError
}
guard let indata = data, let inresponse = response as? HTTPURLResponse else {
throw APIError.responseError
}
if inresponse.statusCode != 200 {
// let statusCode = inresponse.statusCode
// print(debug: "serverError: \(statusCode)")
throw APIError.serverError
}
//Cookieを保存
......@@ -102,14 +105,15 @@ class ServerSession{
do{
if error != nil{
// print(debug: "clientError: \(error)")
throw APIError.clientError
}
guard let indata = data, let inresponse = response as? HTTPURLResponse else {
throw APIError.responseError
}
if inresponse.statusCode != 200 {
let statusCode = inresponse.statusCode
print(debug: "serverError: \(statusCode)")
// let statusCode = inresponse.statusCode
// print(debug: "serverError: \(statusCode)")
throw APIError.serverError
}
//Cookieを保存
......@@ -146,12 +150,15 @@ class ServerSession{
do{
if error != nil{
// print(debug: "clientError: \(error)")
throw APIError.clientError
}
guard let indata = data, let inresponse = response as? HTTPURLResponse else {
throw APIError.responseError
}
if inresponse.statusCode != 200 {
// let statusCode = inresponse.statusCode
// print(debug: "serverError: \(statusCode)")
throw APIError.serverError
}
DispatchQueue.main.async {
......
......@@ -8,7 +8,7 @@
import SwiftUI
enum Tab: String, CaseIterable{
case task = "tab_task"
case map = "tab_map"
case chat = "tab_chat"
case alert = "tab_notification"
case menu = "tab_menu"
......@@ -35,7 +35,7 @@ struct MainTabView: View {
var body: some View {
if UIDevice.current.userInterfaceIdiom == .phone {
@State var isTabShow: Bool = sceneDelegate.tabWindow != nil
@State var isTaskSel: Bool = selectedTabModel.activeTab == .task
@State var isTaskSel: Bool = selectedTabModel.activeTab == .map
TabView(selection: $selectedTabModel.activeTab){
ChatView()
......@@ -46,7 +46,7 @@ struct MainTabView: View {
MapInformation()
}
.ignoresSafeArea()
.tag(Tab.task)
.tag(Tab.map)
NotificationView()
.tag(Tab.alert)
......@@ -77,7 +77,7 @@ struct MainTabView: View {
MapInformation()
}
.ignoresSafeArea()
.tag(Tab.task)
.tag(Tab.map)
NotificationView()
.tag(Tab.alert)
......@@ -118,7 +118,7 @@ struct CustomTabBar: View {
ForEach(Tab.allCases, id: \.rawValue) { tab in
Button(action: {
selectedTabModel.activeTab = tab
if tab == .task {
if tab == .map {
selectedTabModel.isPoppver.toggle()
location.focusOwnShip = true
} else if tab == .chat {
......@@ -147,7 +147,7 @@ struct CustomTabBar: View {
}
//チャットTab上の既読マーク
if tab == Tab.task {
if tab == Tab.map {
if pushHistory.viewCnt != 0 {
Rectangle()
.foregroundColor(.red)
......
......@@ -9,7 +9,7 @@ import SwiftUI
//@Observable
class SelectedTabModel: ObservableObject {
@Published var activeTab: Tab = .task
@Published var activeTab: Tab = .map
@Published var isShowChangeEmrMode: Bool = false
@Published var isLocationAlert: Bool = false
@Published var isPoppver: Bool = false
......
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