diff --git a/.DS_Store b/.DS_Store index b71655c..50bcd89 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate index 06ccbb3..790fd75 100644 Binary files a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate and b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 84ce777..f8ab1c9 100644 --- a/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/OrderScheduling.xcworkspace/xcuserdata/zd.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -1258,8 +1258,8 @@ filePath = "OrderScheduling/Common/View/AppUpdateTool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "107" - endingLineNumber = "107" + startingLineNumber = "110" + endingLineNumber = "110" landmarkName = "shouldPresentEntry()" landmarkType = "7"> @@ -1274,8 +1274,8 @@ filePath = "OrderScheduling/Common/View/AppUpdateTool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "109" - endingLineNumber = "109" + startingLineNumber = "112" + endingLineNumber = "112" landmarkName = "shouldPresentEntry()" landmarkType = "7"> @@ -1306,8 +1306,8 @@ filePath = "OrderScheduling/Common/View/AppUpdateTool.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "100" - endingLineNumber = "100" + startingLineNumber = "103" + endingLineNumber = "103" landmarkName = "canUpdate(localVersion:onlineVersion:)" landmarkType = "7"> @@ -2985,5 +2985,53 @@ + + + + + + + + + + + + diff --git a/OrderScheduling/Common/View/AppUpdateTool.swift b/OrderScheduling/Common/View/AppUpdateTool.swift index f8f5b46..7e08751 100644 --- a/OrderScheduling/Common/View/AppUpdateTool.swift +++ b/OrderScheduling/Common/View/AppUpdateTool.swift @@ -66,14 +66,17 @@ open class AppUpdateTool : NSObject { if response?.success == true { if self?.canUpdate(localVersion: TOOL.getVersion(), onlineVersion: response?.data?.appVersion ?? "0") == true { if type == .auto { - if self?.shouldPresentEntry() == true { + if response?.data?.update.code == .YES || self?.shouldPresentEntry() == true { if let appUpdateView = self?.appUpdateView { + appUpdateView.isForce(isForce: response?.data?.update.code == .YES ? true : false) appUpdateView.contentLabel.text = response?.data?.description ENTRY.showAppUpdateEntry(view: appUpdateView,name: appUpdateEntry) } } }else if type == .manual { if let appUpdateView = self?.appUpdateView { + appUpdateView.isForce(isForce: response?.data?.update.code == .YES ? true : false) + appUpdateView.contentLabel.text = response?.data?.description ENTRY.showAppUpdateEntry(view: appUpdateView,name: appUpdateEntry) } } @@ -110,13 +113,10 @@ open class AppUpdateTool : NSObject { } func openAppStore(by from:UIViewController?) { - if ignoreFlag == true { - }else{ - let vc = SKStoreProductViewController() - vc.delegate = self - vc.loadProduct(withParameters: [SKStoreProductParameterITunesItemIdentifier:AppItunesId]) - from?.present(vc, animated: true) - } + let vc = SKStoreProductViewController() + vc.delegate = self + vc.loadProduct(withParameters: [SKStoreProductParameterITunesItemIdentifier:AppItunesId]) + from?.present(vc, animated: true) } } diff --git a/OrderScheduling/Common/View/AppUpdateView.swift b/OrderScheduling/Common/View/AppUpdateView.swift index 74032f6..b123608 100644 --- a/OrderScheduling/Common/View/AppUpdateView.swift +++ b/OrderScheduling/Common/View/AppUpdateView.swift @@ -15,6 +15,8 @@ open class AppUpdateView : DDView { private let scrollView : DDScrollView private let scrollContentView : DDView public let contentLabel : DDLabel + public let horizontalLine : DDView + public let verticalLine : DDView public let ignoreButton : DDButton public let updateButton : DDButton public override init(frame: CGRect) { @@ -22,27 +24,32 @@ open class AppUpdateView : DDView { scrollView = DDScrollView() scrollContentView = DDView.init() contentLabel = DDLabel.dd_init(withText: "", font: .mediumFont(auto(14)), textColor: .black.alpha(0.5)) + horizontalLine = DDView() + verticalLine = DDView() ignoreButton = DDButton.dd_initCustom() updateButton = DDButton.dd_initCustom() super.init(frame: frame) + radiusView.layer.cornerRadius = auto(10) + radiusView.layer.masksToBounds = true addSubview(radiusView) radiusView.addSubview(scrollView) scrollView.addSubview(scrollContentView) contentLabel.numberOfLines = 0 scrollContentView.addSubview(contentLabel) + horizontalLine.backgroundColor = .hex("979797").alpha(0.35) + radiusView.addSubview(horizontalLine) + verticalLine.backgroundColor = .hex("979797").alpha(0.35) + verticalLine.isHidden = true + radiusView.addSubview(verticalLine) ignoreButton.setTitle("忽略", for: .normal) ignoreButton.titleLabel?.font = .mediumFont(auto(14)) ignoreButton.backgroundColor = .white ignoreButton.setTitleColor(.black.alpha(0.3), for: .normal) - ignoreButton.layer.borderColor = UIColor.hex("000000").alpha(0.3).cgColor - ignoreButton.layer.borderWidth = 0.5 - ignoreButton.layer.cornerRadius = auto(15) radiusView.addSubview(ignoreButton) updateButton.setTitle("更新", for: .normal) updateButton.setTitleColor(.white, for: .normal) updateButton.titleLabel?.font = .mediumFont(auto(14)) updateButton.backgroundColor = .hex("1C62D9") - updateButton.layer.cornerRadius = auto(15) radiusView.addSubview(updateButton) radiusView.snp.makeConstraints { make in @@ -51,7 +58,7 @@ open class AppUpdateView : DDView { scrollView.snp.makeConstraints { make in make.top.left.right.equalToSuperview() - make.bottom.equalToSuperview().offset(-auto(70)) + make.bottom.equalTo(horizontalLine.snp.top) } scrollContentView.snp.makeConstraints { make in @@ -63,25 +70,56 @@ open class AppUpdateView : DDView { make.left.equalToSuperview().offset(auto(20)) make.top.equalToSuperview().offset(auto(20)) make.right.equalTo(-auto(20)) - make.bottom.equalTo(scrollContentView) + make.bottom.equalTo(scrollContentView).offset(-auto(20)) + } + + horizontalLine.snp.makeConstraints { make in + make.bottom.equalToSuperview().offset(-auto(40)) + make.left.right.equalToSuperview() + make.height.equalTo(1) + } + + verticalLine.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalTo(horizontalLine.snp.bottom) + make.bottom.equalToSuperview() + make.width.equalTo(1) } ignoreButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().offset(-auto(20)) - make.width.equalTo(auto(80)) - make.height.equalTo(auto(30)) - make.centerX.equalToSuperview().offset(-auto(60)) + make.left.equalToSuperview() + make.right.equalTo(verticalLine.snp.left) + make.top.equalTo(horizontalLine.snp.bottom) + make.bottom.equalToSuperview() } updateButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().offset(-auto(20)) - make.width.equalTo(auto(80)) - make.height.equalTo(auto(30)) - make.centerX.equalToSuperview().offset(auto(60)) + make.bottom.equalToSuperview() + make.right.equalToSuperview() + make.top.equalTo(horizontalLine.snp.top) + make.left.equalTo(verticalLine.snp.right) } } public required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + func isForce(isForce:Bool) { + if isForce == true { + updateButton.snp.remakeConstraints { make in + make.bottom.equalToSuperview() + make.right.equalToSuperview() + make.top.equalTo(horizontalLine.snp.top) + make.left.equalToSuperview() + } + }else{ + updateButton.snp.remakeConstraints { make in + make.bottom.equalToSuperview() + make.right.equalToSuperview() + make.top.equalTo(horizontalLine.snp.top) + make.left.equalTo(verticalLine.snp.right) + } + } + } } diff --git a/OrderScheduling/Common/View/NotificationAuthView.swift b/OrderScheduling/Common/View/NotificationAuthView.swift index c6c670f..bef5213 100644 --- a/OrderScheduling/Common/View/NotificationAuthView.swift +++ b/OrderScheduling/Common/View/NotificationAuthView.swift @@ -16,6 +16,8 @@ open class NotificationAuthView : DDView{ private let scrollView : DDScrollView private let scrollContentView : DDView public let contentLabel : DDLabel + public let horizontalLine : DDView + public let verticalLine : DDView public let ignoreButton : DDButton public let setButton : DDButton public override init(frame: CGRect) { @@ -23,9 +25,13 @@ open class NotificationAuthView : DDView{ scrollView = DDScrollView() scrollContentView = DDView.init() contentLabel = DDLabel.dd_init(withText: "", font: .mediumFont(auto(17)), textColor: .black.alpha(0.5)) + horizontalLine = DDView() + verticalLine = DDView() ignoreButton = DDButton.dd_initCustom() setButton = DDButton.dd_initCustom() super.init(frame: frame) + radiusView.layer.cornerRadius = auto(10) + radiusView.layer.masksToBounds = true addSubview(radiusView) radiusView.addSubview(scrollView) scrollView.addSubview(scrollContentView) @@ -33,19 +39,20 @@ open class NotificationAuthView : DDView{ contentLabel.textAlignment = .center contentLabel.text = "当前应用未开启通知,建议开启" scrollContentView.addSubview(contentLabel) + horizontalLine.backgroundColor = .hex("979797").alpha(0.35) + radiusView.addSubview(horizontalLine) + verticalLine.backgroundColor = .hex("979797").alpha(0.35) + verticalLine.isHidden = true + radiusView.addSubview(verticalLine) ignoreButton.setTitle("取消", for: .normal) ignoreButton.titleLabel?.font = .mediumFont(auto(14)) ignoreButton.backgroundColor = .white ignoreButton.setTitleColor(.black.alpha(0.3), for: .normal) - ignoreButton.layer.borderColor = UIColor.hex("000000").alpha(0.3).cgColor - ignoreButton.layer.borderWidth = 0.5 - ignoreButton.layer.cornerRadius = auto(15) radiusView.addSubview(ignoreButton) setButton.setTitle("去设置", for: .normal) setButton.setTitleColor(.white, for: .normal) setButton.titleLabel?.font = .mediumFont(auto(14)) setButton.backgroundColor = .hex("1C62D9") - setButton.layer.cornerRadius = auto(15) radiusView.addSubview(setButton) radiusView.snp.makeConstraints { make in @@ -69,18 +76,31 @@ open class NotificationAuthView : DDView{ make.bottom.equalTo(scrollContentView) } + horizontalLine.snp.makeConstraints { make in + make.bottom.equalToSuperview().offset(-auto(40)) + make.left.right.equalToSuperview() + make.height.equalTo(1) + } + + verticalLine.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalTo(horizontalLine.snp.bottom) + make.bottom.equalToSuperview() + make.width.equalTo(1) + } + ignoreButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().offset(-auto(20)) - make.width.equalTo(auto(80)) - make.height.equalTo(auto(30)) - make.centerX.equalToSuperview().offset(-auto(60)) + make.left.equalToSuperview() + make.right.equalTo(verticalLine.snp.left) + make.top.equalTo(horizontalLine.snp.bottom) + make.bottom.equalToSuperview() } setButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().offset(-auto(20)) - make.width.equalTo(auto(80)) - make.height.equalTo(auto(30)) - make.centerX.equalToSuperview().offset(auto(60)) + make.bottom.equalToSuperview() + make.right.equalToSuperview() + make.top.equalTo(horizontalLine.snp.top) + make.left.equalTo(verticalLine.snp.right) } } diff --git a/OrderScheduling/Entry/Entry.swift b/OrderScheduling/Entry/Entry.swift index ac215aa..6d75762 100644 --- a/OrderScheduling/Entry/Entry.swift +++ b/OrderScheduling/Entry/Entry.swift @@ -93,7 +93,7 @@ open class Entry { ) attributes.positionConstraints.size = .init( width: .constant(value: auto(326)), - height: .constant(value: auto(285)) + height: .constant(value: auto(180)) ) attributes.positionConstraints.verticalOffset = 0 attributes.positionConstraints.safeArea = .overridden diff --git a/OrderScheduling/HttpResponseModel/ResponseModel.swift b/OrderScheduling/HttpResponseModel/ResponseModel.swift index e8aa3f7..b97cb9e 100644 --- a/OrderScheduling/HttpResponseModel/ResponseModel.swift +++ b/OrderScheduling/HttpResponseModel/ResponseModel.swift @@ -249,8 +249,16 @@ public class DispatchAppH5UrlDataModel : Decodable { public class VersionCheckDataModel : Decodable { var id : Int var appVersion : String - var update : UpdateEnum - var appType : AppTypeEnum + var update : UpdateModel + var appType : TypeModel + class UpdateModel : Decodable { + var code : UpdateEnum + var label : String + } + class TypeModel : Decodable { + var code : AppTypeEnum + var label : String + } enum UpdateEnum : Int,Decodable { case NO = 0 case YES = 1 diff --git a/OrderScheduling/Strings/AppKeyStrings.swift b/OrderScheduling/Strings/AppKeyStrings.swift index 67829aa..f6a9a40 100644 --- a/OrderScheduling/Strings/AppKeyStrings.swift +++ b/OrderScheduling/Strings/AppKeyStrings.swift @@ -11,4 +11,4 @@ public let MAAppKey = "6e13671d1444633f9fd5a407a309555a" public let JPushKey = "259b546bb2aaf5f02ffa2547" -public let AppItunesId = "1616776985" +public let AppItunesId = "1469168177" diff --git a/OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift b/OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift index 8a638d5..1c94ddc 100644 --- a/OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift +++ b/OrderScheduling/VehicleMonitoring/ViewController/VehicleMonitoringController.swift @@ -446,9 +446,11 @@ extension VehicleMonitoringController : JXCategoryListContainerViewDelegate { extension VehicleMonitoringController : JXCategoryViewDelegate { public func categoryView(_ categoryView: JXCategoryBaseView!, didSelectedItemAt index: Int) { - reloadData(index: index) - if vehicleMonitoringView.vehicleMonitoringPannelView.tapButton.isSelected == true { - vehicleMonitoringView.vehicleMonitoringPannelView.tapButton.sendActions(for: .touchUpInside) + DispatchQueue.main.async {[weak self] in + self?.reloadData(index: index) + if self?.vehicleMonitoringView.vehicleMonitoringPannelView.tapButton.isSelected == true { + self?.vehicleMonitoringView.vehicleMonitoringPannelView.tapButton.sendActions(for: .touchUpInside) + } } }