Commit f89be70e authored by shigemi miura's avatar shigemi miura

Web表示関連更新

parent 179391e5
......@@ -86,6 +86,9 @@
D52D213A2AEBAC0500324D58 /* HttpRequestType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D21392AEBAC0500324D58 /* HttpRequestType.swift */; };
D52D213F2AEBB7D700324D58 /* RegisteredEca.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D213E2AEBB7D700324D58 /* RegisteredEca.swift */; };
D52D21412AEDE18F00324D58 /* EcaCoordinatesTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D52D21402AEDE18F00324D58 /* EcaCoordinatesTable.swift */; };
D5384AFC2B306CEF006228C6 /* TermsView.html in Resources */ = {isa = PBXBuildFile; fileRef = D5384AFB2B306CEF006228C6 /* TermsView.html */; };
D5384AFE2B3121F2006228C6 /* PrivacyView.html in Resources */ = {isa = PBXBuildFile; fileRef = D5384AFD2B3121F2006228C6 /* PrivacyView.html */; };
D5384B012B312F2D006228C6 /* MenuLocalHtmlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5384B002B312F2D006228C6 /* MenuLocalHtmlView.swift */; };
D545FC742B09C74300F206D0 /* AlertManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D545FC732B09C74300F206D0 /* AlertManager.swift */; };
D545FC762B09C81300F206D0 /* PushNotificationTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = D545FC752B09C81300F206D0 /* PushNotificationTypes.swift */; };
D55135202B15B030007B66B1 /* SetEcaArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = D551351F2B15B030007B66B1 /* SetEcaArea.swift */; };
......@@ -236,6 +239,9 @@
D52D21392AEBAC0500324D58 /* HttpRequestType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HttpRequestType.swift; path = Sailassist/Http/HttpRequestType.swift; sourceTree = SOURCE_ROOT; };
D52D213E2AEBB7D700324D58 /* RegisteredEca.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RegisteredEca.swift; path = Sailassist/ECA/RegisteredEca.swift; sourceTree = SOURCE_ROOT; };
D52D21402AEDE18F00324D58 /* EcaCoordinatesTable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = EcaCoordinatesTable.swift; path = Sailassist/ECA/EcaCoordinatesTable.swift; sourceTree = SOURCE_ROOT; };
D5384AFB2B306CEF006228C6 /* TermsView.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = TermsView.html; path = SailAssist/html/TermsView.html; sourceTree = SOURCE_ROOT; };
D5384AFD2B3121F2006228C6 /* PrivacyView.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = PrivacyView.html; path = SailAssist/html/PrivacyView.html; sourceTree = SOURCE_ROOT; };
D5384B002B312F2D006228C6 /* MenuLocalHtmlView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuLocalHtmlView.swift; path = Sailassist/Menu/View/MenuLocalHtmlView.swift; sourceTree = SOURCE_ROOT; };
D53ACA752B0AECF8008DCB18 /* Sailassist.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Sailassist.entitlements; path = Sailassist/Sailassist.entitlements; sourceTree = "<group>"; };
D545FC732B09C74300F206D0 /* AlertManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AlertManager.swift; path = Sailassist/VoiceManager/AlertManager.swift; sourceTree = SOURCE_ROOT; };
D545FC752B09C81300F206D0 /* PushNotificationTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PushNotificationTypes.swift; path = Sailassist/DataSource/PushNotificationTypes.swift; sourceTree = SOURCE_ROOT; };
......@@ -324,6 +330,7 @@
020B98122AD8C3140029DE4C /* SailAssist */ = {
isa = PBXGroup;
children = (
D5384AFF2B3121FA006228C6 /* html */,
D545FC722B09C6DA00F206D0 /* VoiceManager */,
D51AA4052B099F6D00EBBDD4 /* DataSource */,
D51AA4022B099DA600EBBDD4 /* SignalR */,
......@@ -592,6 +599,7 @@
D5E008732B2ADD3F00C4070A /* MenuManualECDISView.swift */,
D5E008752B2ADD5900C4070A /* MenuManualRADARView.swift */,
D5E008772B2B022200C4070A /* MenuAboutAppView.swift */,
D5384B002B312F2D006228C6 /* MenuLocalHtmlView.swift */,
);
path = View;
sourceTree = "<group>";
......@@ -685,6 +693,15 @@
path = ECA;
sourceTree = "<group>";
};
D5384AFF2B3121FA006228C6 /* html */ = {
isa = PBXGroup;
children = (
D5384AFB2B306CEF006228C6 /* TermsView.html */,
D5384AFD2B3121F2006228C6 /* PrivacyView.html */,
);
path = html;
sourceTree = "<group>";
};
D545FC722B09C6DA00F206D0 /* VoiceManager */ = {
isa = PBXGroup;
children = (
......@@ -827,6 +844,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5384AFE2B3121F2006228C6 /* PrivacyView.html in Resources */,
D5384AFC2B306CEF006228C6 /* TermsView.html in Resources */,
020B981B2AD8C3190029DE4C /* Preview Assets.xcassets in Resources */,
020B98182AD8C3190029DE4C /* Assets.xcassets in Resources */,
);
......@@ -1001,6 +1020,7 @@
D5E008762B2ADD5900C4070A /* MenuManualRADARView.swift in Sources */,
D59908C62B19EA70000E13DD /* ResPushHistory.swift in Sources */,
020B986C2ADD3E810029DE4C /* InTextLib.swift in Sources */,
D5384B012B312F2D006228C6 /* MenuLocalHtmlView.swift in Sources */,
02C3E5D12AFCC16800AF7837 /* ChatTitleView.swift in Sources */,
024EDE1D2B0C42F70013BAC8 /* MenuGpsSelectView.swift in Sources */,
020B98472AD8FEE30029DE4C /* ColorSet.swift in Sources */,
......@@ -1187,6 +1207,7 @@
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -1229,6 +1250,7 @@
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -1414,6 +1436,7 @@
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
LD_RUNPATH_SEARCH_PATHS = (
......
......@@ -37,6 +37,7 @@ struct ContentView: View {
selectedTabModel.activeTab = .task
}, content: {
LoginView(isLogin: $loginViewModel.isLogin)
.environmentObject(selectedTabModel)
})
}
}
......
......@@ -10,11 +10,11 @@ import Foundation
// TODO: サイトのアドレスを変更
#if CANARY
enum HttpRequestType : String {
case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
// case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
case RegisterLogin = "https://ssv-canary-web.azurewebsites.net/sailassistlogin"
case SitePolicy = "https://ssv-canary-web.azurewebsites.net/sitepolicy"
case CookiePolicy = "https://ssv-canary-web.azurewebsites.net/cookiepolicy"
case PrivacyPolicy = "https://ssv-canary-web.azurewebsites.net/inapp?" //+バージョン番号
// case PrivacyPolicy = "https://ssv-canary-web.azurewebsites.net/inapp?" //+バージョン番号
case TaskList = "https://ssv-canary-web.azurewebsites.net/api/sailassist/tasklist/XXXXX"
case EcaArea = "https://ssv-canary-web.azurewebsites.net/api/sailassist/ecaarea/XXXXX"
case ShipStatus = "https://ssv-canary-web.azurewebsites.net/api/sailassist/shipstatus/XXXXX"
......@@ -26,14 +26,16 @@ enum HttpRequestType : String {
case ConnectionString = "Endpoint=sb://ssv-canary-notification.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=zHzVMA757FciMum5jVG4NMl82YpYVzclUgCiKOVRKf8="
case HubName = "ssv-canary-sailassist-notification"
case storage = "https://ssvcanarystorage.z1.web.core.windows.net/"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
}
#elseif QC
enum HttpRequestType : String {
case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
// case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
case RegisterLogin = "https://ssv-qc-web.azurewebsites.net/sailassistlogin"
case SitePolicy = "https://ssv-qc-web.azurewebsites.net/sitepolicy"
case CookiePolicy = "https://ssv-qc-web.azurewebsites.net/cookiepolicy"
case PrivacyPolicy = "https://ssv-qc-web.azurewebsites.net/inapp?" //+バージョン番号
// case PrivacyPolicy = "https://ssv-qc-web.azurewebsites.net/inapp?" //+バージョン番号
case TaskList = "https://ssv-qc-web.azurewebsites.net/api/sailassist/tasklist/XXXXX"
case EcaArea = "https://ssv-qc-web.azurewebsites.net/api/sailassist/ecaarea"
case ShipStatus = "https://ssv-qc-web.azurewebsites.net/api/sailassist/shipstatus/XXXXX"
......@@ -45,15 +47,17 @@ enum HttpRequestType : String {
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/"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
}
#else
//MARK: 運用サーバー用
enum HttpRequestType : String {
case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
// case Terms = "https://tacmistorage.blob.core.windows.net/$web/terms/terms.mobile.html?sv=2021-10-04&st=2023-11-22T06%3A26%3A32Z&se=2023-11-23T06%3A26%3A32Z&sr=b&sp=r&sig=wS6kbbT5SvNVTkRsnRk%2BiDceZAsQ3Y56vrqTUO1X50E%3D"
case RegisterLogin = "https://ssv.jmarinecloud.com/sailassistlogin"
case SitePolicy = "https://ssv.jmarinecloud.com/sitepolicy"
case CookiePolicy = "https://ssv.jmarinecloud.com/cookiepolicy"
case PrivacyPolicy = "https://ssv.jmarinecloud.com/inapp?" //+バージョン番号
// case PrivacyPolicy = "https://ssv.jmarinecloud.com/inapp?" //+バージョン番号
case TaskList = "https://ssv.jmarinecloud.com/api/sailassist/tasklist/XXXXX"
case EcaArea = "https://ssv.jmarinecloud.com/api/sailassist/ecaarea"
case ShipStatus = "https://ssv.jmarinecloud.com/api/sailassist/shipstatus/XXXXX"
......@@ -65,5 +69,7 @@ enum HttpRequestType : String {
case ConnectionString = "Endpoint=sb://ssv-notification.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=IzbO7Lo+PenhlIaHBw1MA7+NE9XaLikwieOFwCzZC50="
case HubName = "ssv-sailassist-notification"
case storage = "https://tacmistorage.z31.web.core.windows.net/"
case ContactPage = "https://www.jmarinecloud.com/eng/contact.php?type=ssv_mobile"
case ApachLicens = "https://raw.githubusercontent.com/Azure/azure-notificationhubs-ios/main/LICENSE"
}
#endif
......@@ -22,9 +22,8 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
super.init()
}
func requestPermission() -> (alert: Bool, type: AlertType) {
var alert = false
let type: AlertType = .gpsPermission
func requestPermission() -> Bool {
var alert = true
locationManager.requestWhenInUseAuthorization()
locationManager.requestAlwaysAuthorization() // バックグラウンド実行中も座標取得する場合はこちら
......@@ -32,18 +31,15 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
let status = CLLocationManager().authorizationStatus
switch status {
case .authorizedAlways :
alert = false
print(debug: "authorizationStatus : .authorizedAlways") //常に利用許可
case .notDetermined:
alert = true
print(debug: "authorizationStatus : .notDetermined") //一度だけ許可
case .restricted:
alert = true
print(debug: "authorizationStatus : .restricted") //ペアレンタルコントロールなどの影響で制限中
case .denied:
alert = true
print(debug: "authorizationStatus : .denied") //利用拒否
case .authorizedWhenInUse:
alert = true
print(debug: "authorizationStatus : .authorizedWhenInUse") //使用中のみ利用許可
@unknown default:
print(debug: "authorizationStatus : Unknown")
......@@ -63,7 +59,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
locationManager.startUpdatingLocation()
}
return(alert, type)
return alert
}
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
......
......@@ -21,7 +21,6 @@ enum AlertType: String {
case QrFailure
case ClientError
case Expired
case gpsPermission
}
class LoginViewParam: ObservableObject{
......@@ -35,6 +34,7 @@ let TimerInterval = 60.0 * 10.0
struct LoginView: View {
@ObservedObject var scannerViewModel = ScannerViewModel()
@EnvironmentObject var locationViewModel: LocationViewModel
@EnvironmentObject var selectedTabModel: SelectedTabModel
@Binding var isLogin: Bool
@State var isQrRead: Bool = false
@State var viewMode: LoginViewMode = .SelectType
......@@ -87,7 +87,10 @@ struct LoginView: View {
if !isProgressView {
Link("Site policy", destination: URL(string: HttpRequestType.SitePolicy.rawValue)!)
Link("Cookie policy", destination: URL(string: HttpRequestType.CookiePolicy.rawValue)!)
Link("Privacy policy", destination: URL(string: HttpRequestType.PrivacyPolicy.rawValue)!)
if let htmlPath = Bundle.main.path(forResource: "PrivacyView", ofType: "html") {
Link("Privacy policy", destination: URL(fileURLWithPath: htmlPath))
}
// Link("Privacy policy", destination: URL(string: HttpRequestType.CookiePolicy.rawValue)!)
} else {
EmptyView()
}
......@@ -122,11 +125,6 @@ struct LoginView: View {
message: Text("Expired."),
dismissButton: .default(Text("OK"), action: {viewMode = .SelectType})
)
case .gpsPermission:
return Alert(title: Text("Location"),
message: Text("To use ECA,set the permission to use location information to Always."),
dismissButton: .default(Text("Next"), action: {locationViewModel.requestPermission()})
)
}
}
}
......@@ -137,9 +135,7 @@ struct LoginView: View {
})
.onAppear() {
LoginCheck()
let result = locationViewModel.requestPermission()
isAlert = result.alert
alertType = result.type
selectedTabModel.isLocationAlert = locationViewModel.requestPermission()
}
.preferredColorScheme(.dark)
}
......@@ -302,4 +298,5 @@ fileprivate struct Triangle: Shape{
#Preview {
LoginView(isLogin: .constant(false))
.environmentObject(SelectedTabModel())
}
......@@ -86,7 +86,7 @@ struct MenuView: View {
NavigationStack(path: $path){
VStack(spacing: 0) {
MenuTitleView(path: $path)
HStack {
VStack(alignment: .leading, spacing: 10){
Text(SharingData.my.shipName)
......@@ -100,7 +100,7 @@ struct MenuView: View {
.padding(.vertical, 17)
Spacer()
}
Divider()
.background(ColorSet.LineColor04.color)
Button{
......@@ -108,25 +108,25 @@ struct MenuView: View {
}label: {
MenuContentView(content: .Manual)
}
Button{
path.append(.Information)
}label: {
MenuContentView(content: .Information)
}
Button{
path.append(.Setting)
}label: {
MenuContentView(content: .Setting)
}
Button{
isSignout = true
}label: {
MenuContentView(content: .SignOut)
}
Spacer()
}
.background(ColorSet.BackgroundPrimary.color)
......@@ -151,10 +151,18 @@ struct MenuView: View {
}else if goto == .AboutApp{
MenuAboutAppView(path: $path)
.navigationBarHidden(true)
}else if goto == .TermsOfUse{
MenuLocalHtmlView(path: $path)
.navigationBarHidden(true)
}else if goto == .PrivacyStatement{
MenuLocalHtmlView(path: $path)
.navigationBarHidden(true)
}else if goto == .ContactUs{
WebView(isLoading: .constant(false), url: HttpRequestType.ContactPage.rawValue)
}else{
VStack(spacing: 0) {
MenuTitleView(path: $path, title: goto.title)
if let url = Preferences.ECDISBasicUrl{
PDFViewer(url: url)
}else{
......@@ -165,11 +173,11 @@ struct MenuView: View {
.background(ColorSet.BackgroundPrimary.color)
}
}
.alert("Sign Out", isPresented: $isSignout) {
Button("Yes") {
Preferences.Id = ""
Preferences.Password = ""
Preferences.UserName = ""
loginViewModel.isLogin = false
sceneDelegate.tabWindow?.isHidden = true
}
......
......@@ -18,11 +18,11 @@ struct MenuAboutAppView: View {
HStack {
VStack(alignment: .leading, spacing: 10){
Text("Version")
.font(FontStyle.EmphasisText.font)
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
#if CANARY
Text("\(version)" + " Canary")
.font(FontStyle.EmphasisText.font)
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.Body.color)
#elseif QC
Text("\(version)" + " QC")
......@@ -44,7 +44,7 @@ struct MenuAboutAppView: View {
Spacer().frame(height: 50)
Text("Policy")
.font(FontStyle.EmphasisText.font)
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.leading, 30)
......@@ -64,7 +64,7 @@ struct MenuAboutAppView: View {
Spacer().frame(height: 50)
Text("Open Source Licenses")
.font(FontStyle.EmphasisText.font)
.font(FontStyle.SupplementText.font)
.foregroundColor(ColorSet.BodyDescriptiion.color)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.leading, 30)
......@@ -77,6 +77,11 @@ struct MenuAboutAppView: View {
.foregroundColor(ColorSet.Body.color)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.leading, 30)
VStack(spacing: 30) {
Link("https://github.com/Azure/azure-notificationhubs-ios/blob/main/LICENSE", destination: URL(string: HttpRequestType.ApachLicens.rawValue)!)
}
.font(FontStyle.RadioButtonText.font)
.foregroundColor(ColorSet.Body.color)
Spacer()
}
.background(ColorSet.BackgroundPrimary.color)
......
//
// MenuLocalHtmlView.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/12/19.
//
import Foundation
import SwiftUI
struct MenuLocalHtmlView: View {
@State var isAlert: Bool = false
@Binding var path : [MenuPath]
var body: some View {
VStack{
let aaa = path
MenuTitleView(path: $path, title: MenuPath.ManualRADAR.title)
// if content.rawValue != "TermsOfUse" {
// if let htmlPath = Bundle.main.path(forResource: "TermsView", ofType: "html") {
// WebView(isLoading: .constant(false), url: htmlPath)
// }
// } else if content.rawValue != "PrivacyStatement" {
// if let htmlPath = Bundle.main.path(forResource: "PrivacyView", ofType: "html") {
// WebView(isLoading: .constant(false), url: htmlPath)
// }
// }
Spacer()
}
.background(ColorSet.BackgroundPrimary.color)
.alert("delete", isPresented: $isAlert) {
Button(role: .destructive) {
} label: {
Text("delete")
}
} message: {
Text("eca delete")
}
}
}
#Preview {
MenuLocalHtmlView(path: .constant([.ManualRADAR]))
}
......@@ -16,14 +16,16 @@ struct SailassistApp: App {
@State private var isPrivAgree = Preferences.privacyPolicyAgreeDate != nil
let locationViewModel = LocationViewModel()
// let signalRService = SignalRService()
let signalRService = SignalRService()
var body: some Scene {
WindowGroup {
if !isTermsAgree{
VStack(spacing: 0){
WebView(isLoading: .constant(false), url: HttpRequestType.Terms.rawValue)
if let htmlPath = Bundle.main.path(forResource: "TermsView", ofType: "html") {
WebView(isLoading: .constant(false), url: htmlPath)
}
YesNoButtons(yesTitle: "Accept", noTitle: "Cancel") {
Preferences.termsAgreeDate_Int64 = DateTextLib.Date2UnixTime(date: Date())
isTermsAgree = true
......@@ -35,7 +37,9 @@ struct SailassistApp: App {
}else if !isPrivAgree{
VStack(spacing: 0){
WebView(isLoading: .constant(false), url: HttpRequestType.Terms.rawValue)
if let htmlPath = Bundle.main.path(forResource: "PrivacyView", ofType: "html") {
WebView(isLoading: .constant(false), url: htmlPath)
}
YesNoButtons(yesTitle: "Accept", noTitle: "Cancel") {
Preferences.privacyPolicyAgreeDate_Int64 = DateTextLib.Date2UnixTime(date: Date())
......
......@@ -110,12 +110,11 @@ struct CustomTabBar: View {
} message: {
Text("Do you change an emargency mode?")
}
.alert("location", isPresented: $isLocationAlert) {
Button("Next") {
print("")
.alert("location", isPresented: $selectedTabModel.isLocationAlert) {
Button("OK") {
}
} message: {
Text("To use ECA,set the permission to use location information to Always.")
Text("To use ECA,set the permission to use location information to ALWAYS.")
}
}
}
......
......@@ -11,4 +11,5 @@ import SwiftUI
class SelectedTabModel: ObservableObject {
@Published var activeTab: Tab = .task
@Published var isShowChangeEmrMode: Bool = false
@Published var isLocationAlert: Bool = false
}
......@@ -13,7 +13,13 @@ struct WebView: UIViewRepresentable {
var url : String
func makeUIView(context: Context) -> WKWebView {
let request = URLRequest(url: URL(string: url)!)
var address: URL
if url.contains("https://") {
address = URL(string: url)!
} else {
address = URL(fileURLWithPath: url)
}
let request = URLRequest(url: address)
let webView = WKWebView()
webView.navigationDelegate = context.coordinator
webView.load(request)
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Privacy Statement</title>
</head>
<body>
<h1>Privacy Statement</h1>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
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