Commit f7c1e69c authored by sugita mamoru's avatar sugita mamoru

利用規約作成、フォーカス作成

parent 460c8567
...@@ -13,4 +13,8 @@ extension View{ ...@@ -13,4 +13,8 @@ extension View{
self self
.toolbar(.hidden, for: .tabBar) .toolbar(.hidden, for: .tabBar)
} }
func border(_ color: Color, width: CGFloat, cornerRadius: CGFloat) -> some View {
overlay(RoundedRectangle(cornerRadius: cornerRadius).stroke(color, lineWidth: width))
}
} }
...@@ -10,6 +10,7 @@ import Foundation ...@@ -10,6 +10,7 @@ import Foundation
// TODO: サイトのアドレスを変更 // TODO: サイトのアドレスを変更
#if CANARY #if CANARY
enum HttpRequestType : String { 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 RegisterLogin = "https://ssv-canary-web.azurewebsites.net/sailassistlogin" case RegisterLogin = "https://ssv-canary-web.azurewebsites.net/sailassistlogin"
case SitePolicy = "https://ssv-canary-web.azurewebsites.net/sitepolicy" case SitePolicy = "https://ssv-canary-web.azurewebsites.net/sitepolicy"
case CookiePolicy = "https://ssv-canary-web.azurewebsites.net/cookiepolicy" case CookiePolicy = "https://ssv-canary-web.azurewebsites.net/cookiepolicy"
...@@ -26,6 +27,7 @@ enum HttpRequestType : String { ...@@ -26,6 +27,7 @@ enum HttpRequestType : String {
} }
#elseif QC #elseif QC
enum HttpRequestType : String { 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 RegisterLogin = "https://ssv-qc-web.azurewebsites.net/sailassistlogin" case RegisterLogin = "https://ssv-qc-web.azurewebsites.net/sailassistlogin"
case SitePolicy = "https://ssv-qc-web.azurewebsites.net/sitepolicy" case SitePolicy = "https://ssv-qc-web.azurewebsites.net/sitepolicy"
case CookiePolicy = "https://ssv-qc-web.azurewebsites.net/cookiepolicy" case CookiePolicy = "https://ssv-qc-web.azurewebsites.net/cookiepolicy"
...@@ -43,6 +45,7 @@ enum HttpRequestType : String { ...@@ -43,6 +45,7 @@ enum HttpRequestType : String {
#else #else
//MARK: 運用サーバー用 //MARK: 運用サーバー用
enum HttpRequestType : String { 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 RegisterLogin = "https://ssv.jmarinecloud.com/sailassistlogin" case RegisterLogin = "https://ssv.jmarinecloud.com/sailassistlogin"
case SitePolicy = "https://ssv.jmarinecloud.com/sitepolicy" case SitePolicy = "https://ssv.jmarinecloud.com/sitepolicy"
case CookiePolicy = "https://ssv.jmarinecloud.com/cookiepolicy" case CookiePolicy = "https://ssv.jmarinecloud.com/cookiepolicy"
......
...@@ -25,6 +25,10 @@ struct MapRepresentable: UIViewControllerRepresentable{ ...@@ -25,6 +25,10 @@ struct MapRepresentable: UIViewControllerRepresentable{
mapVC.updateEcaLine(line: ecaArea.points) mapVC.updateEcaLine(line: ecaArea.points)
} }
if let foucusEcaName = ecaData.foucusEca, let foucusEca = ecaData.ecaArea[foucusEcaName]{
mapVC.updateCamera(location: foucusEca.points.first)
}
if let mylocation = my.location { if let mylocation = my.location {
mapVC.updateOwnShip(location: mylocation, bearing: my.heading) mapVC.updateOwnShip(location: mylocation, bearing: my.heading)
...@@ -145,6 +149,7 @@ class MapViewController : UIViewController{ ...@@ -145,6 +149,7 @@ class MapViewController : UIViewController{
try? mapView.mapboxMap.style.addLayer(ecaSwLabelLayer) try? mapView.mapboxMap.style.addLayer(ecaSwLabelLayer)
} }
///自船
func updateOwnShip(location: CLLocationCoordinate2D, bearing: Double){ func updateOwnShip(location: CLLocationCoordinate2D, bearing: Double){
do { do {
var geoJSON = Feature(geometry: Point(location)) var geoJSON = Feature(geometry: Point(location))
...@@ -154,6 +159,12 @@ class MapViewController : UIViewController{ ...@@ -154,6 +159,12 @@ class MapViewController : UIViewController{
}catch{} }catch{}
} }
///カメラ
func updateCamera(location: CLLocationCoordinate2D?){
self.mapView.camera.ease(to: CameraOptions(center: location), duration: 1)
SharingData.eca.foucusEca = nil
}
///Ecaの線3本
func updateEcaSwitchingLine(center: CLLocationCoordinate2D, notice: Float, start: Float, finish: Float){ func updateEcaSwitchingLine(center: CLLocationCoordinate2D, notice: Float, start: Float, finish: Float){
do{ do{
var switchingLines : [Feature] = [] var switchingLines : [Feature] = []
......
...@@ -16,6 +16,9 @@ struct EcaListView: View { ...@@ -16,6 +16,9 @@ struct EcaListView: View {
Text(eca.name) Text(eca.name)
.font(FontStyle.DefaultText.font) .font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.Body.color) .foregroundColor(ColorSet.Body.color)
.onTapGesture {
ecaData.foucusEca = eca.name
}
Spacer() Spacer()
if !eca.isEnable{ if !eca.isEnable{
Button(action: { Button(action: {
......
...@@ -22,6 +22,19 @@ class Preferences{ ...@@ -22,6 +22,19 @@ class Preferences{
lastLoginDate = DateTextLib.UnixTime2Date(newValue ?? 0) lastLoginDate = DateTextLib.UnixTime2Date(newValue ?? 0)
} }
} }
@AppStorage(PreferencesKey.TypeInt.TermsAgreeDate.rawValue) static var termsAgreeDate: Date?
static var termsAgreeDate_Int64 : Int64?{
get{
if let date = termsAgreeDate{
DateTextLib.Date2UnixTime(date: date)
}else{
nil
}
}
set{
termsAgreeDate = DateTextLib.UnixTime2Date(newValue ?? 0)
}
}
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipId.rawValue) static var ShipId: String @AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipId.rawValue) static var ShipId: String
@AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipPassword.rawValue) static var ShipPassword: String @AppStorage(wrappedValue:"", PreferencesKey.TypeString.ShipPassword.rawValue) static var ShipPassword: String
......
...@@ -22,6 +22,8 @@ class PreferencesKey{ ...@@ -22,6 +22,8 @@ class PreferencesKey{
case LocationType case LocationType
case AppStartUsingDate case AppStartUsingDate
case LastLoginDate case LastLoginDate
case TermsAgreeDate
} }
enum TypeURL: String{ enum TypeURL: String{
......
...@@ -13,9 +13,32 @@ import WindowsAzureMessaging ...@@ -13,9 +13,32 @@ import WindowsAzureMessaging
@main @main
struct SailassistApp: App { struct SailassistApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate @UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
@State var isAgree = Preferences.termsAgreeDate != nil
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
if isAgree {
ContentView() ContentView()
}else{
VStack(spacing: 0){
WebView(isLoading: .constant(false), url: HttpRequestType.Terms.rawValue)
Button(action: {
Preferences.termsAgreeDate_Int64 = DateTextLib.Date2UnixTime(date: Date())
isAgree = true
}, label: {
Text("Accept")
.frame(maxWidth: .infinity)
.padding(.vertical, 10)
.border(ColorSet.LineColor04.color, width: 1, cornerRadius: 5)
})
.padding()
.background(ColorSet.BackgroundPrimary.color)
}
.preferredColorScheme(.dark)
}
} }
} }
} }
......
...@@ -103,6 +103,7 @@ class SharingData{ ...@@ -103,6 +103,7 @@ class SharingData{
static var eca = Eca() static var eca = Eca()
class Eca: ObservableObject{ class Eca: ObservableObject{
@Published var ecaArea: Dictionary<String, RegisteredEca> = [:] @Published var ecaArea: Dictionary<String, RegisteredEca> = [:]
@Published var foucusEca: String? = nil
func editEcaArea(key: String, value: RegisteredEca){ func editEcaArea(key: String, value: RegisteredEca){
ecaArea.updateValue(value, forKey: key) ecaArea.updateValue(value, forKey: key)
......
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