Commit 2b1d4f08 by xuning

集成配置、网络请求、缓存等工具

parent ad2a407a
......@@ -15,6 +15,22 @@
79267AAC2DBFC421000D2180 /* XVAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AAB2DBFC421000D2180 /* XVAboutViewController.m */; };
79267AAF2DBFC7AF000D2180 /* XVMyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AAE2DBFC7AF000D2180 /* XVMyViewController.m */; };
79267AB22DBFCC44000D2180 /* XVMyCertificateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AB12DBFCC44000D2180 /* XVMyCertificateView.m */; };
79267AB52DBFD464000D2180 /* XVHealthCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AB42DBFD464000D2180 /* XVHealthCardViewController.m */; };
79267AB82DC0E3E9000D2180 /* XVHealthCardStatusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AB72DC0E3E9000D2180 /* XVHealthCardStatusView.m */; };
79267ABB2DC0E3FB000D2180 /* XVHealthCardTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ABA2DC0E3FB000D2180 /* XVHealthCardTypeView.m */; };
79267ABE2DC11880000D2180 /* XVHealthCardTypeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ABD2DC11880000D2180 /* XVHealthCardTypeViewController.m */; };
79267AC52DC77509000D2180 /* XVUploadHealthCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AC42DC77509000D2180 /* XVUploadHealthCardViewController.m */; };
79267AC82DC77A7C000D2180 /* XVHealthCardTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AC72DC77A7C000D2180 /* XVHealthCardTipView.m */; };
79267ACF2DC8A511000D2180 /* AFNetworkingClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ACE2DC8A511000D2180 /* AFNetworkingClient.m */; };
79267AD82DC8AC25000D2180 /* AppConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AD72DC8AC25000D2180 /* AppConfig.m */; };
79267ADD2DC8AEEA000D2180 /* NSString+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ADC2DC8AEEA000D2180 /* NSString+Extention.m */; };
79267AE02DC8B8DC000D2180 /* UserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ADF2DC8B8DC000D2180 /* UserInfo.m */; };
79267AE32DC8B947000D2180 /* LocalCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AE22DC8B947000D2180 /* LocalCache.m */; };
79267AE62DC8BE15000D2180 /* TestClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AE52DC8BE15000D2180 /* TestClient.m */; };
79267AF22DC8C3C3000D2180 /* MBProgressHUD+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AF12DC8C3C3000D2180 /* MBProgressHUD+Extention.m */; };
79267AF52DC8C948000D2180 /* NSMutableDictionary+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AF42DC8C948000D2180 /* NSMutableDictionary+Extention.m */; };
79267AF82DC8CD65000D2180 /* XVAlertTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AF72DC8CD65000D2180 /* XVAlertTools.m */; };
79267AFE2DC8E1EC000D2180 /* AppTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AFD2DC8E1EC000D2180 /* AppTools.m */; };
798136512DB7AD84004BC05B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 798136502DB7AD84004BC05B /* CoreGraphics.framework */; };
798136532DB7AD90004BC05B /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 798136522DB7AD90004BC05B /* CoreLocation.framework */; };
798136572DB7ADB6004BC05B /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 798136562DB7ADB6004BC05B /* OpenGLES.framework */; };
......@@ -25,7 +41,6 @@
798136622DB7AE03004BC05B /* AVFAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 798136612DB7AE03004BC05B /* AVFAudio.framework */; };
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */; };
7981EABA2B6E670200F357E7 /* UIView+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */; };
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */; };
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAC22B6E800900F357E7 /* XVInputFieldView.m */; };
7981EAC72B6F41B000F357E7 /* XVRegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAC62B6F41B000F357E7 /* XVRegisterViewController.m */; };
7981EACA2B6F59E800F357E7 /* XVPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAC92B6F59E800F357E7 /* XVPasswordViewController.m */; };
......@@ -41,7 +56,7 @@
7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAFE2B712CC700F357E7 /* HBLockSliderView.m */; };
7981EB042B7273B500F357E7 /* XVPersonalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EB032B7273B500F357E7 /* XVPersonalViewController.m */; };
7981EB082B73BB2C00F357E7 /* XVPersonalHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EB072B73BB2C00F357E7 /* XVPersonalHeaderView.m */; };
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.m */; };
799DF0C62B6BD8AF00680907 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.mm */; };
799DF0D12B6BD8B100680907 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D02B6BD8B100680907 /* Assets.xcassets */; };
799DF0D42B6BD8B100680907 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D22B6BD8B100680907 /* LaunchScreen.storyboard */; };
799DF0D72B6BD8B100680907 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0D62B6BD8B100680907 /* main.m */; };
......@@ -90,6 +105,40 @@
79267AAE2DBFC7AF000D2180 /* XVMyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVMyViewController.m; sourceTree = "<group>"; };
79267AB02DBFCC44000D2180 /* XVMyCertificateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVMyCertificateView.h; sourceTree = "<group>"; };
79267AB12DBFCC44000D2180 /* XVMyCertificateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVMyCertificateView.m; sourceTree = "<group>"; };
79267AB32DBFD464000D2180 /* XVHealthCardViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVHealthCardViewController.h; sourceTree = "<group>"; };
79267AB42DBFD464000D2180 /* XVHealthCardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVHealthCardViewController.m; sourceTree = "<group>"; };
79267AB62DC0E3E9000D2180 /* XVHealthCardStatusView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVHealthCardStatusView.h; sourceTree = "<group>"; };
79267AB72DC0E3E9000D2180 /* XVHealthCardStatusView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVHealthCardStatusView.m; sourceTree = "<group>"; };
79267AB92DC0E3FB000D2180 /* XVHealthCardTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVHealthCardTypeView.h; sourceTree = "<group>"; };
79267ABA2DC0E3FB000D2180 /* XVHealthCardTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVHealthCardTypeView.m; sourceTree = "<group>"; };
79267ABC2DC11880000D2180 /* XVHealthCardTypeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVHealthCardTypeViewController.h; sourceTree = "<group>"; };
79267ABD2DC11880000D2180 /* XVHealthCardTypeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVHealthCardTypeViewController.m; sourceTree = "<group>"; };
79267AC32DC77509000D2180 /* XVUploadHealthCardViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVUploadHealthCardViewController.h; sourceTree = "<group>"; };
79267AC42DC77509000D2180 /* XVUploadHealthCardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVUploadHealthCardViewController.m; sourceTree = "<group>"; };
79267AC62DC77A7C000D2180 /* XVHealthCardTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVHealthCardTipView.h; sourceTree = "<group>"; };
79267AC72DC77A7C000D2180 /* XVHealthCardTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVHealthCardTipView.m; sourceTree = "<group>"; };
79267ACD2DC8A511000D2180 /* AFNetworkingClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFNetworkingClient.h; sourceTree = "<group>"; };
79267ACE2DC8A511000D2180 /* AFNetworkingClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AFNetworkingClient.m; sourceTree = "<group>"; };
79267AD02DC8A63D000D2180 /* Notification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Notification.h; sourceTree = "<group>"; };
79267AD62DC8AC25000D2180 /* AppConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppConfig.h; sourceTree = "<group>"; };
79267AD72DC8AC25000D2180 /* AppConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppConfig.m; sourceTree = "<group>"; };
79267AD92DC8ACE9000D2180 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
79267ADB2DC8AEEA000D2180 /* NSString+Extention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Extention.h"; sourceTree = "<group>"; };
79267ADC2DC8AEEA000D2180 /* NSString+Extention.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Extention.m"; sourceTree = "<group>"; };
79267ADE2DC8B8DC000D2180 /* UserInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfo.h; sourceTree = "<group>"; };
79267ADF2DC8B8DC000D2180 /* UserInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserInfo.m; sourceTree = "<group>"; };
79267AE12DC8B947000D2180 /* LocalCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalCache.h; sourceTree = "<group>"; };
79267AE22DC8B947000D2180 /* LocalCache.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalCache.m; sourceTree = "<group>"; };
79267AE42DC8BE15000D2180 /* TestClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestClient.h; sourceTree = "<group>"; };
79267AE52DC8BE15000D2180 /* TestClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestClient.m; sourceTree = "<group>"; };
79267AF02DC8C3C3000D2180 /* MBProgressHUD+Extention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD+Extention.h"; sourceTree = "<group>"; };
79267AF12DC8C3C3000D2180 /* MBProgressHUD+Extention.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "MBProgressHUD+Extention.m"; sourceTree = "<group>"; };
79267AF32DC8C948000D2180 /* NSMutableDictionary+Extention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+Extention.h"; sourceTree = "<group>"; };
79267AF42DC8C948000D2180 /* NSMutableDictionary+Extention.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+Extention.m"; sourceTree = "<group>"; };
79267AF62DC8CD65000D2180 /* XVAlertTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVAlertTools.h; sourceTree = "<group>"; };
79267AF72DC8CD65000D2180 /* XVAlertTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVAlertTools.m; sourceTree = "<group>"; };
79267AFC2DC8E1EC000D2180 /* AppTools.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppTools.h; sourceTree = "<group>"; };
79267AFD2DC8E1EC000D2180 /* AppTools.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppTools.m; sourceTree = "<group>"; };
798136262DB7AD09004BC05B /* BaiduMapAPI_Map.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Map.framework; path = "Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/BaiduMapAPI_Map.framework"; sourceTree = "<group>"; };
798136272DB7AD09004BC05B /* BaiduMapAPI_WalkNavi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_WalkNavi.framework; path = "Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/BaiduMapAPI_WalkNavi.framework"; sourceTree = "<group>"; };
798136282DB7AD09004BC05B /* BaiduMapAPI_Base.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BaiduMapAPI_Base.framework; path = "Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/BaiduMapAPI_Base.framework"; sourceTree = "<group>"; };
......@@ -134,8 +183,6 @@
7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+XVAdd.m"; sourceTree = "<group>"; };
7981EAB82B6E670200F357E7 /* UIView+XVAdd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+XVAdd.h"; sourceTree = "<group>"; };
7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+XVAdd.m"; sourceTree = "<group>"; };
7981EABB2B6E675F00F357E7 /* NSString+XVAdd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+XVAdd.h"; sourceTree = "<group>"; };
7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+XVAdd.m"; sourceTree = "<group>"; };
7981EAC22B6E800900F357E7 /* XVInputFieldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XVInputFieldView.m; sourceTree = "<group>"; };
7981EAC32B6E800900F357E7 /* XVInputFieldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XVInputFieldView.h; sourceTree = "<group>"; };
7981EAC52B6F41B000F357E7 /* XVRegisterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVRegisterViewController.h; sourceTree = "<group>"; };
......@@ -168,7 +215,7 @@
7981EB072B73BB2C00F357E7 /* XVPersonalHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVPersonalHeaderView.m; sourceTree = "<group>"; };
799DF0C12B6BD8AF00680907 /* fastservice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fastservice.app; sourceTree = BUILT_PRODUCTS_DIR; };
799DF0C42B6BD8AF00680907 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
799DF0C52B6BD8AF00680907 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
799DF0C52B6BD8AF00680907 /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
799DF0D02B6BD8B100680907 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
799DF0D32B6BD8B100680907 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
799DF0D52B6BD8B100680907 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
......@@ -218,6 +265,7 @@
79DC8B982B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVGetOrderAlterSliderView.m; sourceTree = "<group>"; };
79DC8B9B2B90813E00DBD8EA /* AppDelegate+ThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdParty.h"; sourceTree = "<group>"; };
79DC8B9C2B90813E00DBD8EA /* AppDelegate+ThirdParty.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+ThirdParty.m"; sourceTree = "<group>"; };
79F57E602DC8E7980035ADE8 /* Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -258,6 +306,41 @@
path = WMDragView;
sourceTree = "<group>";
};
79267ACC2DC8A4E8000D2180 /* Client */ = {
isa = PBXGroup;
children = (
79267ACD2DC8A511000D2180 /* AFNetworkingClient.h */,
79267ACE2DC8A511000D2180 /* AFNetworkingClient.m */,
79267AD62DC8AC25000D2180 /* AppConfig.h */,
79267AD72DC8AC25000D2180 /* AppConfig.m */,
79267AE42DC8BE15000D2180 /* TestClient.h */,
79267AE52DC8BE15000D2180 /* TestClient.m */,
79267AF62DC8CD65000D2180 /* XVAlertTools.h */,
79267AF72DC8CD65000D2180 /* XVAlertTools.m */,
79267AFC2DC8E1EC000D2180 /* AppTools.h */,
79267AFD2DC8E1EC000D2180 /* AppTools.m */,
);
path = Client;
sourceTree = "<group>";
};
79267AD12DC8A726000D2180 /* Model */ = {
isa = PBXGroup;
children = (
79267ADE2DC8B8DC000D2180 /* UserInfo.h */,
79267ADF2DC8B8DC000D2180 /* UserInfo.m */,
79267AE12DC8B947000D2180 /* LocalCache.h */,
79267AE22DC8B947000D2180 /* LocalCache.m */,
);
path = Model;
sourceTree = "<group>";
};
79267AEF2DC8C03A000D2180 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
798136302DB7AD45004BC05B /* NaviSDK */ = {
isa = PBXGroup;
children = (
......@@ -407,6 +490,12 @@
79267AAB2DBFC421000D2180 /* XVAboutViewController.m */,
79267AAD2DBFC7AF000D2180 /* XVMyViewController.h */,
79267AAE2DBFC7AF000D2180 /* XVMyViewController.m */,
79267AB32DBFD464000D2180 /* XVHealthCardViewController.h */,
79267AB42DBFD464000D2180 /* XVHealthCardViewController.m */,
79267ABC2DC11880000D2180 /* XVHealthCardTypeViewController.h */,
79267ABD2DC11880000D2180 /* XVHealthCardTypeViewController.m */,
79267AC32DC77509000D2180 /* XVUploadHealthCardViewController.h */,
79267AC42DC77509000D2180 /* XVUploadHealthCardViewController.m */,
);
path = Controller;
sourceTree = "<group>";
......@@ -426,6 +515,12 @@
79267AA82DBE655F000D2180 /* XVSettingTableViewCell.m */,
79267AB02DBFCC44000D2180 /* XVMyCertificateView.h */,
79267AB12DBFCC44000D2180 /* XVMyCertificateView.m */,
79267AB62DC0E3E9000D2180 /* XVHealthCardStatusView.h */,
79267AB72DC0E3E9000D2180 /* XVHealthCardStatusView.m */,
79267AB92DC0E3FB000D2180 /* XVHealthCardTypeView.h */,
79267ABA2DC0E3FB000D2180 /* XVHealthCardTypeView.m */,
79267AC62DC77A7C000D2180 /* XVHealthCardTipView.h */,
79267AC72DC77A7C000D2180 /* XVHealthCardTipView.m */,
);
path = View;
sourceTree = "<group>";
......@@ -464,8 +559,10 @@
799DF0DD2B6BD9DD00680907 /* Supporting Files */ = {
isa = PBXGroup;
children = (
79267AD92DC8ACE9000D2180 /* Constants.h */,
79267AD02DC8A63D000D2180 /* Notification.h */,
799DF0C42B6BD8AF00680907 /* AppDelegate.h */,
799DF0C52B6BD8AF00680907 /* AppDelegate.m */,
799DF0C52B6BD8AF00680907 /* AppDelegate.mm */,
79DC8B9B2B90813E00DBD8EA /* AppDelegate+ThirdParty.h */,
79DC8B9C2B90813E00DBD8EA /* AppDelegate+ThirdParty.m */,
799DF0D02B6BD8B100680907 /* Assets.xcassets */,
......@@ -473,6 +570,7 @@
799DF0D52B6BD8B100680907 /* Info.plist */,
799DF0D62B6BD8B100680907 /* main.m */,
799DF0FF2B6BDA2500680907 /* PrefixHeader.pch */,
79F57E602DC8E7980035ADE8 /* Header.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
......@@ -480,6 +578,7 @@
799DF0DE2B6BDA1300680907 /* Common */ = {
isa = PBXGroup;
children = (
79267ACC2DC8A4E8000D2180 /* Client */,
799DF0DF2B6BDA1300680907 /* Categpry */,
799DF0E22B6BDA1300680907 /* Libs */,
);
......@@ -495,10 +594,12 @@
7981EAB62B6E669000F357E7 /* UIScrollView+XVAdd.m */,
7981EAB82B6E670200F357E7 /* UIView+XVAdd.h */,
7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */,
7981EABB2B6E675F00F357E7 /* NSString+XVAdd.h */,
7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */,
79DC8B882B8D818000DBD8EA /* XVVerticalButton.h */,
79DC8B892B8D818000DBD8EA /* XVVerticalButton.m */,
79267AF02DC8C3C3000D2180 /* MBProgressHUD+Extention.h */,
79267AF12DC8C3C3000D2180 /* MBProgressHUD+Extention.m */,
79267AF32DC8C948000D2180 /* NSMutableDictionary+Extention.h */,
79267AF42DC8C948000D2180 /* NSMutableDictionary+Extention.m */,
);
path = Categpry;
sourceTree = "<group>";
......@@ -519,6 +620,8 @@
children = (
799DF0E42B6BDA1300680907 /* NSString+Unicode.m */,
799DF0E52B6BDA1300680907 /* NSString+Unicode.h */,
79267ADB2DC8AEEA000D2180 /* NSString+Extention.h */,
79267ADC2DC8AEEA000D2180 /* NSString+Extention.m */,
);
path = "NSString+Unicode";
sourceTree = "<group>";
......@@ -535,6 +638,8 @@
799DF0F12B6BDA1400680907 /* Base */ = {
isa = PBXGroup;
children = (
79267AEF2DC8C03A000D2180 /* View */,
79267AD12DC8A726000D2180 /* Model */,
799DF0F22B6BDA1400680907 /* Controller */,
);
path = Base;
......@@ -661,6 +766,7 @@
TargetAttributes = {
799DF0C02B6BD8AF00680907 = {
CreatedOnToolsVersion = 14.3;
LastSwiftMigration = 1620;
};
};
};
......@@ -743,16 +849,20 @@
files = (
79267AA02DBBCEE2000D2180 /* XVOrderSearchView.m in Sources */,
79267AA62DBE5720000D2180 /* XVSettingViewController.m in Sources */,
79267AFE2DC8E1EC000D2180 /* AppTools.m in Sources */,
79DC8B752B74B69600DBD8EA /* XVOrderDetailsViewController.m in Sources */,
79DC8B962B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m in Sources */,
79DC8B872B8CD5F000DBD8EA /* XVOrderSettingView.m in Sources */,
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */,
79DC8B9D2B90813F00DBD8EA /* AppDelegate+ThirdParty.m in Sources */,
79267ADD2DC8AEEA000D2180 /* NSString+Extention.m in Sources */,
7981EACF2B6F63CF00F357E7 /* XVMainJobViewController.m in Sources */,
79267AC52DC77509000D2180 /* XVUploadHealthCardViewController.m in Sources */,
799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */,
79DC8B8A2B8D818000DBD8EA /* XVVerticalButton.m in Sources */,
79267ABE2DC11880000D2180 /* XVHealthCardTypeViewController.m in Sources */,
79267AAF2DBFC7AF000D2180 /* XVMyViewController.m in Sources */,
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */,
799DF0C62B6BD8AF00680907 /* AppDelegate.mm in Sources */,
7981EAC72B6F41B000F357E7 /* XVRegisterViewController.m in Sources */,
79DC8B7B2B7AF42800DBD8EA /* XVOrderInfoTopView.m in Sources */,
79267AB22DBFCC44000D2180 /* XVMyCertificateView.m in Sources */,
......@@ -761,13 +871,16 @@
7981EAD32B6F656900F357E7 /* XVCustomBarView.m in Sources */,
7981EACA2B6F59E800F357E7 /* XVPasswordViewController.m in Sources */,
79DC8B782B74B78A00DBD8EA /* XVOrderInfoViewController.m in Sources */,
79267ACF2DC8A511000D2180 /* AFNetworkingClient.m in Sources */,
79DC8B842B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m in Sources */,
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */,
79267AF52DC8C948000D2180 /* NSMutableDictionary+Extention.m in Sources */,
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */,
79267AE02DC8B8DC000D2180 /* UserInfo.m in Sources */,
79DC8B722B74B3EC00DBD8EA /* XVOrderSettingViewController.m in Sources */,
7981EB082B73BB2C00F357E7 /* XVPersonalHeaderView.m in Sources */,
7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */,
79267AF82DC8CD65000D2180 /* XVAlertTools.m in Sources */,
79267AA92DBE655F000D2180 /* XVSettingTableViewCell.m in Sources */,
799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */,
7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */,
......@@ -777,14 +890,22 @@
79DC8B902B8DABF900DBD8EA /* XVNewOrderAlter.m in Sources */,
7981EB042B7273B500F357E7 /* XVPersonalViewController.m in Sources */,
79DC8B992B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m in Sources */,
79267AF22DC8C3C3000D2180 /* MBProgressHUD+Extention.m in Sources */,
79267AC82DC77A7C000D2180 /* XVHealthCardTipView.m in Sources */,
7981EAF32B6FC08F00F357E7 /* XVCategoryTitleCell.m in Sources */,
7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */,
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */,
79267ABB2DC0E3FB000D2180 /* XVHealthCardTypeView.m in Sources */,
7981EAD92B6FB53E00F357E7 /* XVNewJobViewController.m in Sources */,
79267AE62DC8BE15000D2180 /* TestClient.m in Sources */,
79267AB82DC0E3E9000D2180 /* XVHealthCardStatusView.m in Sources */,
7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */,
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */,
79267A9C2DBA8E0F000D2180 /* WMDragView.m in Sources */,
79267AE32DC8B947000D2180 /* LocalCache.m in Sources */,
7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */,
79267AB52DBFD464000D2180 /* XVHealthCardViewController.m in Sources */,
79267AD82DC8AC25000D2180 /* AppConfig.m in Sources */,
79267AAC2DBFC421000D2180 /* XVAboutViewController.m in Sources */,
799DF1102B6D25B400680907 /* UIBarButtonItem+SXCreate.m in Sources */,
79DC8B8D2B8D887000DBD8EA /* XVDispatchOrderAlter.m in Sources */,
......@@ -924,8 +1045,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = S3SN9ALHA9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -958,6 +1081,9 @@
PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "fastservice/fastservice-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
......@@ -968,8 +1094,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = S3SN9ALHA9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -1002,6 +1130,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "fastservice/fastservice-Bridging-Header.h";
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
......
......@@ -7,7 +7,7 @@
<key>fastservice.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>19</integer>
<integer>20</integer>
</dict>
</dict>
</dict>
......
......@@ -57,17 +57,17 @@
//}
- (void)onGetNetworkState:(int)iError{
if (0 == iError) {
Log(@"联网成功");
DebugLog(@"联网成功");
}else{
Log(@"onGetNetworkState %d",iError);
DebugLog(@"onGetNetworkState %d",iError);
}
}
- (void)onGetPermissionState:(int)iError{
if (0 == iError) {
Log(@"授权成功");
DebugLog(@"授权成功");
}else {
Log(@"onGetPermissionState %d",iError);
DebugLog(@"onGetPermissionState %d",iError);
}
}
@end
......@@ -12,5 +12,8 @@
}
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) NSString * token;
@end
......@@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "fanhui@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fanhui@3x.png",
"filename" : "iconPark-left 1 Copy 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "arcoDesign-right 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XVBaseViewController : UIViewController<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color;
......
......@@ -27,6 +27,8 @@
}
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color {
if(@available(iOS 15.0, *)) {
......
......@@ -35,7 +35,7 @@
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
if (self.viewControllers.count > 0) {
viewController.hidesBottomBarWhenPushed = YES;
viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"fanhui")];
viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"iconPark-left 1 Copy 1")];
}
[super pushViewController:viewController animated:animated];
......
//
// LocalCache.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface LocalCache : NSObject
@property (nonatomic,assign) int udTip_flag;//该版本不再提示
@property (nonatomic,assign) int sound_flag;//提示音设置
@property (nonatomic,copy ) NSString *sserver_address;
@property (nonatomic,assign) int screenL_flag;//屏幕常亮标识
@property (nonatomic,assign) int courier_set;//骑士高级设置
@property (nonatomic,assign) int vibration_flag;//新订单&派单震动标识
@property (nonatomic,copy) NSString *showTime; //1个小时后展示的时间
@property (nonatomic, copy) NSString *clanAlredyTime; //记录的昨日战绩弹框的时间
@property (nonatomic, assign) int invitationCount; //进入邀请有钱页面的引导计数
//自定义经纬度
@property (nonatomic, assign) int is_custom; //经纬度是否自定义
@property (nonatomic,copy ) NSString * user_mob;//用户登录手机号
@property(nonatomic, assign) BOOL closeVoice;//关闭声音
@end
NS_ASSUME_NONNULL_END
//
// LocalCache.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "LocalCache.h"
@implementation LocalCache
@end
//
// UserInfo.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
//默认地址信息
@interface UserInfoAddr : NSObject
@property (nonatomic, assign) double longitude;
@property (nonatomic, assign) double latitude;
@property (nonatomic, assign) int address_id;
@property (nonatomic, copy) NSString *mobile;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *label;
@property (nonatomic, copy) NSString *area;
@property (nonatomic, copy) NSString *address;
@property (nonatomic, copy) NSString *city;
@property (nonatomic, copy) NSString *district;
@end
@interface UserInfoB : NSObject
@property (nonatomic, copy) NSString *nickname;//用户名
@property (nonatomic, assign) int gender;//性别
@property (nonatomic, copy) NSString *mobile;
@property (nonatomic, copy) NSString *portrait;//头像
@property (nonatomic,assign) int u_count;//发单数
@property (nonatomic,assign) int uc_count;//取消单数
//微信信息
@property (nonatomic,copy) NSString *wx_name;
@property (nonatomic,copy) NSString *wx_openid;
@property (nonatomic,strong) UserInfoAddr *addr_d;
@end
//骑士信息
@interface UserInfoC : NSObject
@property (nonatomic, assign) int group_id;
@property (nonatomic, assign) int c_s;//骑士状态,0-无效,2-正常(抢单),3-收工,4-封禁,6-接受派单推送
@property (nonatomic, assign) int a_s;//审核状态,0-未认证,1-已认证
@property (nonatomic, assign) int t_s;//培训状态,0-未培训,1-已培训
@property (nonatomic, assign) int g_s;//服务保障状态,0-未认证,1-已认证
@property (nonatomic, copy) NSString *qr;//二维码地址
@property (nonatomic, assign) int c_count;//骑士接单数
@property (nonatomic, copy) NSString *a_name;//展现名字(如刘师傅)
@property (nonatomic, copy) NSString *name;//真实姓名
@property (nonatomic, copy) NSString *bstr;//保证金200元
@property (nonatomic, copy) NSString *reason_r; //认证驳回原因
@property (nonatomic, assign) int l; //骑士等级标志 0=铁牌骑士,1=铜牌骑士,2=银牌骑士,3=金牌骑士,4=钻石骑士
@property (nonatomic, assign) int assignable;//0 没有骑士调配功能
@property (nonatomic, strong) NSString *workDate;// 开工日期,避免第二天还是第一天的开工状态,导致无法接单
@end
//商户信息
@interface UserInfoM : NSObject
@property (nonatomic,assign) int group_id;//商户认证时的group_id
@property (nonatomic,assign) int m_s;//商户状态,0-未审核,1-已审核
@property (nonatomic,copy) NSString *cate;//商户品类
@property (nonatomic,assign) int *mul_f;//一取多发标志位,0-未开通,1-开通
@end
@interface UserInfo : NSObject
@property (nonatomic, strong) NSString * mobile;
@property (nonatomic, assign) int user_id;
@property (nonatomic, strong) NSString * cookie;
@property (nonatomic,copy ) NSString *spw;
@property (nonatomic,strong) UserInfoB *b;//普通用户信息
@property (nonatomic,strong) UserInfoC *c;//骑士信息
@property (nonatomic,strong) UserInfoM *m;//商户信息
@property (nonatomic,strong) NSString *headPortrait;//头像
//zi
@property (nonatomic, strong) NSString *lastDate;//上一次保存的时间 :保险使用
@property (nonatomic,assign) int merchant_set;//商家高级设置
@property (nonatomic,assign) int hide_flag;//隐身登录标识
@end
NS_ASSUME_NONNULL_END
//
// UserInfo.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "UserInfo.h"
@implementation UserInfoAddr
@end
@implementation UserInfoB
@end
@implementation UserInfoC
@end
@implementation UserInfoM
@end
@implementation UserInfo
@end
//
// MBProgressHUD+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <MBProgressHUD/MBProgressHUD.h>
NS_ASSUME_NONNULL_BEGIN
@interface MBProgressHUD (Extention)
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view;
+ (MBProgressHUD *)showMessage:(NSString *)message;
/**
需要主动关闭
*/
+ (MBProgressHUD *)showLoading:(NSString *)message toView:(UIView *)view;
@end
NS_ASSUME_NONNULL_END
//
// MBProgressHUD+Extention.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "MBProgressHUD+Extention.h"
@implementation MBProgressHUD (Extention)
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view {
// if (!message.length) {
// return nil;
// }
if (message == nil || message.length < 1) {
return nil;
}
if (view == nil) view = [UIApplication sharedApplication].keyWindow;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.bezelView.color = [UIColor colorWithWhite:0 alpha:0.4];
hud.userInteractionEnabled = NO;
hud.mode = MBProgressHUDModeText;
hud.detailsLabel.text = message;
hud.detailsLabel.font = [UIFont systemFontOfSize:16];
hud.detailsLabel.textColor = [UIColor whiteColor];
hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:2];
return hud;
}
+ (MBProgressHUD *)showMessage:(NSString *)message {
return [MBProgressHUD showMessage:message toView:nil];
}
/**
需要主动关闭
*/
+ (MBProgressHUD *)showLoading:(NSString *)message toView:(UIView *)view {
if (view == nil) view = [UIApplication sharedApplication].keyWindow;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.contentColor = [UIColor whiteColor];
hud.bezelView.color = [UIColor colorWithWhite:0 alpha:0.4];
hud.userInteractionEnabled = NO;
hud.mode = MBProgressHUDModeIndeterminate;
if (message.length > 0) {
hud.label.text = message;
hud.label.font = [UIFont systemFontOfSize:14];
hud.label.textColor = [UIColor whiteColor];
}
hud.removeFromSuperViewOnHide = YES;
return hud;
}
@end
//
// NSMutableDictionary+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSMutableDictionary (Extention)
- (void)setAnyObject:(id)anObject forKey:(NSString *)aKey;
@end
NS_ASSUME_NONNULL_END
//
// NSMutableDictionary+Extention.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "NSMutableDictionary+Extention.h"
@implementation NSMutableDictionary (Extention)
- (void)setAnyObject:(id)anObject forKey:(NSString *)aKey{
if (anObject != nil) {
[self setObject:anObject forKey:aKey];
}else{
[self setObject:@"" forKey:aKey];
}
}
@end
//
// NSString+XVAdd.h
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (XVAdd)
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width;
/**
获取指定宽度width,字体大小fontSize,字符串value的高度
@param text 文本
@param font 字体大小
@param width 限制字符串显示区域的宽度
@return 返回的高度
*/
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width;
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize;
@end
NS_ASSUME_NONNULL_END
//
// NSString+XVAdd.m
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "NSString+XVAdd.h"
@implementation NSString (XVAdd)
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width {
NSDictionary *attributes = @{NSFontAttributeName : font};
CGSize sizeToFit = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size;
return sizeToFit.height;
}
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize
{
CGSize size = CGSizeZero;
if ([self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
size = [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
}
//额外增加一个点,防止计算误差
return CGSizeMake(size.width + 1, size.height);
}
/**
* 计算富文本字体高度
*
* @param lineSpeace 行高
* @param font 字体
* @param width 字体所占宽度
*
* @return 富文本高度
*/
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width {
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
// paraStyle.lineBreakMode = NSLineBreakByCharWrapping;
/** 行高 */
paraStyle.lineSpacing = lineSpeace;
// NSKernAttributeName字体间距
NSDictionary *dic = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:paraStyle};
CGSize size = [self boundingRectWithSize:CGSizeMake(width,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size;
return size.height;
}
@end
//
// AFNetworkingClient.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
NS_ASSUME_NONNULL_BEGIN
/**
* 注册
*/
static NSString * const SS_SIGN = @"/flow/v1_0/user/signup";
/**
* 验证码
*/
static NSString * const SS_SMS_CODE12 = @"/flow/v1_2/user/smscode";
/**
* 更新上传DeviceToken
*/
static NSString * const SS_SMS_CODEW = @"/flow/v1_1//user/smscodew";
/**
* 登陆新
*/
static NSString * const SS_LOGINX = @"/flow/v1_1/user/login";
/**
* 环信账号
*/
static NSString * const SS_EASESPW = @"/flow/v1_0/user/easemobSPW";
/**
* 修改密码
*/
static NSString * const SS_RESET_PWD = @"/flow/v1_0/user/resetPasswd";
/**
* 修改手机号
*/
static NSString * const SS_REVISE_MB = @"/flow/v1_1/user/reviseMobile";
/**
* 忘记密码
*/
static NSString * const SS_FORGET_PWD = @"/flow/v1_0/user/forgetPasswd";
/**
* 获取随机图片验证码
*/
static NSString * const SS_SMS_PIC_CODE = @"/flow/v1_2/user/smsimgcode";
/**
* 用户信息
*/
static NSString * const SS_GET_USERPROFILE = @"/flow/v1_3/user/profile";
/**
* 设置用户信息
*/
static NSString * const SS_BASICINFO = @"/flow/v1_0/customer/basicInfo";
/**
* 位置更新x
*/
static NSString * const SS_GEO_UPDATE = @"/lbs/v1_0/location/geoUpdate";
/**
* 检测服务器是否连接正常
*/
static NSString * const SS_40_INDEX = @"/flow/v1_0/flow/index";
/**
* 百度
*/
static NSString * const SS_BAIDU = @"https://www.baidu.com";
/**
骑士在线时长统计
*/
static NSString *const SS_ONLINE_DURATION = @"/flow/v1_0/courier/onlineDuration";
@interface AFNetworkingClient : AFHTTPSessionManager
+ (instancetype)sharedClient;
+ (NSString *) baseURLString;
- (NSURLSessionTask * )runGET:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask * )runPost:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask * )runPut:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask *)runDELETE:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+ (void)updateBaseURL:(NSString *)baseURL;
@end
NS_ASSUME_NONNULL_END
//
// AFNetworkingClient.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "AFNetworkingClient.h"
#import "Header.h"
static NSString * const AFAppDotNetAPIBaseURLString = @"http://api.kfw.net";
static NSString * const AFAppDotNetAPIBaseURLString1 = @"http://apitest.kfw.net";
static NSString * const AFAppDotNetAPIBaseURLStringAPI1 = @"http://api1.kfw.net";
static NSString * const AFAppDotNetAPIBaseURLStringAPI2 = @"http://api2.kfw.net";
static NSString * const AFAppDotNetAPIBaseURLStringAPI3 = @"http://api3.kfw.net";
static BOOL _isUseableServer = YES;
static int sto_count = 0; //超时计数
static int snu_count = 0; //正常请求成功计数
static NSString * sg_privateNetworkBaseUrl = nil;
@implementation AFNetworkingClient
+ (instancetype)sharedClient {
static AFNetworkingClient *_sharedClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
//#warning - HuiDu SET 切换完成后 需要重启app
_sharedClient = [[AFNetworkingClient alloc] init];
_sharedClient.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
_sharedClient.requestSerializer = [ AFHTTPRequestSerializer serializer ];
//请求超时
_sharedClient.requestSerializer.timeoutInterval = 30 * 1;
[_sharedClient.requestSerializer setValue:[AppConfig cookie] forHTTPHeaderField:@"Cookie"];
_sharedClient. responseSerializer = [ AFHTTPResponseSerializer serializer ];
// _sharedClient.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
[_sharedClient.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
switch (status) {
case AFNetworkReachabilityStatusReachableViaWWAN:
DebugLog(@"-------AFNetworkReachabilityStatusReachableViaWWAN------");
[[NSNotificationCenter defaultCenter] postNotificationName:kAFNReloadData object:nil];
break;
case AFNetworkReachabilityStatusReachableViaWiFi:
DebugLog(@"-------AFNetworkReachabilityStatusReachableViaWiFi------");
[[NSNotificationCenter defaultCenter] postNotificationName:kAFNReloadData object:nil];
break;
case AFNetworkReachabilityStatusNotReachable:
{
DebugLog(@"-------AFNetworkReachabilityStatusNotReachable------");
// [MBProgressHUD showMessage:@"无网络连接,请检查网络设置"];
[[NSNotificationCenter defaultCenter] postNotificationName:kAFNReloadData object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:kAFNNotReachable object:nil];
}
break;
default:
break;
}
}];
[_sharedClient.reachabilityManager startMonitoring];
});
return _sharedClient;
}
#pragma mark
#pragma mark -服务器域名
+ (NSString *) baseURLString{
NSString *url = AFAppDotNetAPIBaseURLString;
if ([AppConfig getEnvironmentType] == 0) {
// url = SERVER_ADDRESS ? SERVER_ADDRESS : AFAppDotNetAPIBaseURLString;//正式环境
url = AFAppDotNetAPIBaseURLString;//正式环境
}
else if ([AppConfig getEnvironmentType] == 1) {
url = AFAppDotNetAPIBaseURLString1;//灰度环境
}
else if([AppConfig getEnvironmentType] == 2){
url = AFAppDotNetAPIBaseURLStringAPI1;//api环境
}
else if([AppConfig getEnvironmentType] == 3){
url = AFAppDotNetAPIBaseURLStringAPI2;//api环境
}
else if([AppConfig getEnvironmentType] == 4){
url = AFAppDotNetAPIBaseURLStringAPI3;//api环境
}
else if([AppConfig getEnvironmentType] == 5){
url = [AppConfig getLocalCache].sserver_address;//api环境
if (StringIsNullOrEmpty(url)) {
url = AFAppDotNetAPIBaseURLString;
[AppConfig setEnvironmentType:0];
}
}else{
url = AFAppDotNetAPIBaseURLString;//正式环境
}
DebugLog(@"服务器域名:%@",sg_privateNetworkBaseUrl ? sg_privateNetworkBaseUrl : url);
return sg_privateNetworkBaseUrl ? sg_privateNetworkBaseUrl : url;
}
#pragma mark
#pragma mark -GET 请求
- (NSURLSessionTask * )runGET:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{
if (!parameters) {
parameters = [[NSMutableDictionary alloc] init];
}
NSString *encoded = [self getParameters:parameters url:URLString method:@"GET"];
return [self GET:encoded parameters:parameters headers:nil progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[AFNetworkingClient successWithParameters:parameters encoded:encoded task:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[AFNetworkingClient failureWithParameters:parameters URLString:URLString task:task error:error failure:failure];
}];
}
#pragma mark
#pragma mark -Post 请求
- (NSURLSessionTask * )runPost:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{
if (!parameters) {
parameters = [[NSMutableDictionary alloc] init];
}
NSString *encoded = [self getParameters:parameters url:URLString method:@"Post"];
return [self POST:encoded parameters:parameters headers:nil progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask *task, id responseObject) {
[AFNetworkingClient successWithParameters:parameters encoded:encoded task:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
DebugLog(@"ddd----->%ld",error.code);
[AFNetworkingClient failureWithParameters:parameters URLString:URLString task:task error:error failure:failure];
}];
}
#pragma mark
#pragma mark -Post 请求
- (NSURLSessionTask * )runPut:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{
if (!parameters) {
parameters = [[NSMutableDictionary alloc] init];
}
NSString *encoded = [self getParameters:parameters url:URLString method:@"Put"];
return [self PUT:encoded parameters:parameters headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[AFNetworkingClient successWithParameters:parameters encoded:encoded task:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[AFNetworkingClient failureWithParameters:parameters URLString:URLString task:task error:error failure:failure];
}];
}
#pragma mark
#pragma mark DELETE请求
- (NSURLSessionTask *)runDELETE:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure {
if (!parameters) {
parameters = [[NSMutableDictionary alloc] init];
}
NSString *encoded = [self getParameters:parameters url:URLString method:@"DELETE"];
return [self DELETE:encoded parameters:parameters headers:nil success:^(NSURLSessionDataTask *task, id responseObject) {
[AFNetworkingClient successWithParameters:parameters encoded:encoded task:task responseObject:responseObject success:success];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[AFNetworkingClient failureWithParameters:parameters URLString:URLString task:task error:error failure:failure];
}];
}
//获取扩展后的参数
- (NSString *)getParameters:(NSMutableDictionary *)parameters url:(NSString *)URLString method:(NSString *)method{
NSString *cookie = [AppConfig cookie];
if (StringNotNullAndEmpty(cookie)) {
[self.requestSerializer setValue:cookie forHTTPHeaderField:@"Cookie"];
}
//设备类型
[parameters setObject:@"ios_knight" forKey:@"device"];
//设备版本
int version = [[AppTools sharedAppTools] versionToIntValue];;
[parameters setObject:@(version) forKey:@"version"];
//设备device_token
if (StringNotNullAndEmpty(theApp().token)) {
[parameters setObject:theApp().token forKey:@"device_token"];
}
NSString *encoded = [URLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if (![encoded hasPrefix:@"http"]) {
encoded = S(@"%@%@",[AFNetworkingClient baseURLString],URLString);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[AFNetworkingClient appServerLow:parameters andAPI:URLString];
});
}
//转码打印
DebugLog(@"%@ ---请求参数:%@",encoded,[AppTools replaceUnicode:[parameters description]]);
return encoded;
}
#pragma mark
#pragma mark -Post 请求如果慢 发送通知
+ (void)appServerLow:(NSMutableDictionary *)parameters andAPI:(NSString *)api {
int inter_count = 3;
if (!parameters[@"_isTimeOut"]) {
sto_count = sto_count + (sto_count >= inter_count ? 0 : 1);
}else if([parameters[@"_isTimeOut"] intValue] == 1){
snu_count = snu_count + (snu_count >= inter_count ? 0 : 1);
}
if ((sto_count >= inter_count || snu_count >= inter_count) && _isUseableServer) {
NSString *isTimeOut = sto_count >= inter_count ? @"1" : snu_count >= inter_count ? @"0" : @"";
[[NSNotificationCenter defaultCenter] postNotificationName:kAppServerLow object:nil userInfo:@{@"isTimeOut":S(@"%@",isTimeOut)}];
sto_count = 0;
snu_count = 0;
}
}
#pragma mark
#pragma mark - 请求成功
+ (void)successWithParameters:(NSMutableDictionary *)parameters encoded:(NSString *)encoded task:(NSURLSessionDataTask *)task responseObject:(id) responseObject success:(void (^)(NSURLSessionDataTask *task, id responseObject))success{
NSError *error;
id jsonObject = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:&error];
NSDictionary *pDic = [[NSDictionary alloc] initWithDictionary:jsonObject];
//转码打印
DebugLog(@"%@\n%@ \n返回参数:%@ ",error ? error : @"", encoded,[AppTools replaceUnicode:[jsonObject description]]);
if ([pDic[@"respcd"] isEqualToString:@"2100"] && ![AppConfig needLogin] && ![AFNetworkingClient noMessageAlert:encoded error:error]) {
[TestClient dicMobClickStatistics:@"respcd2100" url:encoded];
showAlertMessage(@"登录已经过期,请重新登录!");
// [[GlobalNetManager sharedGlobalNetManager] logout:nil];
}
if (success) {
success(task,jsonObject);
}
_isUseableServer = YES;
[parameters setObject:@(1) forKey:@"_isTimeOut"];
}
#pragma mark
#pragma mark - 失败
+ (void)failureWithParameters:(NSMutableDictionary *)parameters URLString:(NSString *)URLString task:(NSURLSessionDataTask *)task error:(NSError *)error failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure{
NSString *error_info = [[NSString alloc] initWithData:error.userInfo[@"com.alamofire.serialization.response.error.data"] encoding:NSUTF8StringEncoding];
DebugLog(@"\n服务器请求异常 %@ \nerror_info: %@ \nerror_code:%ld",URLString,error_info,(long)error.code);
if ([AFNetworkingClient noMessageAlert:URLString error:error]) {
DebugLog(@"-999 / geo.update");
}else if (error.code == -1003){
// [MBProgressHUD showMessage:@"线路繁忙,请重试!"];
// TODO ! Warning
// [AFNetworkingClient updateBaseURL:BACKUP_ADDRESS];
}
else{
if (_isUseableServer) {
sto_count = 0;
snu_count = 0;
_isUseableServer = NO;
[[NSNotificationCenter defaultCenter] postNotificationName:kAppServerError object:nil];
}
[task cancel];
#if DEBUG
#else
// [MBProgressHUD showMessage:S(@"网络出了点小状况,请稍后~ %ld",(long)error.code)];
#endif
}
showIndicator(NO, nil, nil);
if (failure) {
failure(task,error);
}
}
#pragma mark
#pragma mark - 更新域名
+ (void)updateBaseURL:(NSString *)baseURL{
if (![baseURL isEqualToString:sg_privateNetworkBaseUrl] && baseURL && baseURL.length) {
sg_privateNetworkBaseUrl = baseURL;
}
}
//不提醒用户的接口 或者 错误码
+ (BOOL)noMessageAlert:(NSString *)url error:(NSError *)error{
DebugLog(@"noMessageAlert:%@",url);
if (error.code == -999 || [url hasSuffix:SS_GEO_UPDATE] || [url hasSuffix:SS_40_INDEX] || [url hasPrefix:SS_BAIDU]) {
return YES;
}
return NO;
}
@end
//
// AppConfig.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UserInfo.h"
#import "LocalCache.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppConfig : NSObject
@property (nonatomic,strong) UserInfo *user;
//当前开发环境 灰度 线上
+ (void)setEnvironmentType:(int)type;
+ (int)getEnvironmentType;
+ (void)clearUserInfo;
+ (void)setUser:(UserInfo *)userInfo;
+ (UserInfo *)getUserInfo;
+ (NSString * )cookie;
+ (BOOL)needLogin;
//本地缓存
+ (void)saveLocalCache:(LocalCache *)lc;
+ (LocalCache *)getLocalCache;
//保存当前位置经纬度
+ (void)saveLocationCoordinate:(CLLocationCoordinate2D)coordinate;
+ (CLLocationCoordinate2D)getLocationCoordinate;
//保存和删除自定义的位置经纬度
+ (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude;
+ (void)deleteCustomLocationCoordinate;
@end
NS_ASSUME_NONNULL_END
//
// AppConfig.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "AppConfig.h"
@implementation AppConfig
DEF_SINGLETION(AppConfig);
- (instancetype)init
{
self = [super init];
if (self) {
}
return self;
}
+ (void)setEnvironmentType:(int)type
{
[[NSUserDefaults standardUserDefaults] setInteger:type forKey:kAppEnvironmentType];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (int)getEnvironmentType
{
int type = (int)[[NSUserDefaults standardUserDefaults] integerForKey:kAppEnvironmentType];
return type;
}
+ (void)clearUserInfo{
[AppConfig sharedAppConfig].user = nil;
[[NSUserDefaults standardUserDefaults]removeObjectForKey:kAppUserInfo];
[[NSUserDefaults standardUserDefaults]synchronize];
}
+ (void)setUser:(UserInfo *)userInfo{
[AppConfig sharedAppConfig].user = userInfo;
[[NSUserDefaults standardUserDefaults] setObject:userInfo.mj_keyValues forKey:kAppUserInfo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (UserInfo *)getUserInfo{
if ([AppConfig sharedAppConfig].user) {
return [AppConfig sharedAppConfig].user;
}else{
NSDictionary * dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppUserInfo];
UserInfo * userInfo;
if (dic) {
userInfo = [UserInfo mj_objectWithKeyValues:dic];
}
[AppConfig sharedAppConfig].user = userInfo;
return userInfo;
}
}
+ (NSString * )cookie{
UserInfo * userInfo = [self getUserInfo];
return userInfo.cookie;
}
//courier_status 0=未提交认证信息,1=已提交认证信息,2=认证成功,正常工作,3=收工状态 4-已封禁配送权限
+ (BOOL)needCer{
UserInfo * userInfo = [self getUserInfo];
if (userInfo.c.c_s == 0) {
return YES;
}
if (userInfo.c.c_s >= 1) {
return NO;
}
return YES;
}
+ (BOOL)needLogin{
UserInfo * userInfo = [self getUserInfo];
if (userInfo == nil) {
return YES;
}
if (StringNotNullAndEmpty(userInfo.cookie)) {
return NO;
}
return YES;
}
//本地缓存标识 int
+ (void)saveLocalCache:(LocalCache *)localCache{
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString *filePath = [path stringByAppendingPathComponent:@"localCache.plist"];
[@[localCache.mj_keyValues] writeToFile:filePath atomically:YES];
}
+ (LocalCache *)getLocalCache{
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString *filePath = [path stringByAppendingPathComponent:@"localCache.plist"];
NSArray *plist_arr = [NSArray arrayWithContentsOfFile:filePath];
LocalCache *localCache;
if ([plist_arr firstObject]) {
localCache = [LocalCache mj_objectWithKeyValues:[plist_arr firstObject]];
}
return localCache;
}
//保存经纬度
+ (void)saveLocationCoordinate:(CLLocationCoordinate2D)coordinate{
[[NSUserDefaults standardUserDefaults] setValue:@{@"longitude":@(coordinate.longitude),@"latitude":@(coordinate.latitude)} forKey:kAppLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude {
[[NSUserDefaults standardUserDefaults] setValue:@{@"longitude":longitude,@"latitude":latitude} forKey:kAppCustomLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)deleteCustomLocationCoordinate {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kAppCustomLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (CLLocationCoordinate2D)getLocationCoordinate{
NSDictionary *dic;
LocalCache *lc = [AppConfig getLocalCache];
if (lc.is_custom == 1) {
dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppCustomLocationCoo];
} else {
dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppLocationCoo];
}
if (dic) {
CLLocationCoordinate2D cood = CLLocationCoordinate2DMake([[dic objectForKey:@"latitude"] doubleValue], [[dic objectForKey:@"longitude"] doubleValue]);
return cood;
}
return CLLocationCoordinate2DMake(0, 0);
}
@end
//
// AppTools.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface AppTools : NSObject
AS_SINGLETION(AppTools);
- (int)versionToIntValue;
//json串 unicode转中文
+ (NSString *)replaceUnicode:(NSString *)unicodeStr;
@end
NS_ASSUME_NONNULL_END
//
// AppTools.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "AppTools.h"
@interface AppTools()
@property (nonatomic,assign) int version_int;
@end
@implementation AppTools
DEF_SINGLETION(AppTools);
- (int)versionToIntValue{
if (self.version_int == 0) {
//将版本号点去除,拼接成int型传给服务器
NSArray *vs = [APP_VERSION componentsSeparatedByString:@"."];
NSMutableString *ver = [NSMutableString string];
for (NSString *string in vs) {
[ver appendString:string];
}
self.version_int = [ver intValue];
}
return self.version_int;
}
//json串 unicode转中文
+ (NSString *)replaceUnicode:(NSString *)unicodeStr {
if (StringIsNullOrEmpty(unicodeStr)) {
return @"空数据";
}else{
NSString *tempStr1 = [unicodeStr stringByReplacingOccurrencesOfString:@"\\u" withString:@"\\U"];
NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
NSString *tempStr3 = [[@"\"" stringByAppendingString:tempStr2] stringByAppendingString:@"\""];
NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];
NSString* returnStr = [NSPropertyListSerialization propertyListWithData:tempData options:NSPropertyListImmutable format:NULL error:NULL];
return [returnStr stringByReplacingOccurrencesOfString:@"\\r\\n" withString:@"\n"];
}
}
@end
//
// TestClient.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface TestClient : NSObject
/**
弹出测试密码框
*/
+ (void)alertTESTViewWithBlock:(EventVoidHandler)block;
/**
切换环境
@param view 展示view
@param longPress 长按手势
*/
+ (void)changeEnvironment:(UIView *)view longPress:(UILongPressGestureRecognizer *)longPress;
/**
5下单击处罚自定义经纬度
@param vc 需要显示的控制器
@param view 需要显示的View
@param fivePress 响应的手势
*/
//
+ (void)changeCustomLocationWithTempVc:(UIViewController *)vc TempView:(UIView *)view fivePress:(UITapGestureRecognizer *)fivePress;
//统计带字典参数
+ (void)dicMobClickStatistics:(NSString *)event;
+ (void)dicMobClickStatistics:(NSString *)event url:(NSString *)url;
@end
NS_ASSUME_NONNULL_END
//
// TestClient.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "TestClient.h"
@implementation TestClient
+ (void)alertTESTViewWithBlock:(EventVoidHandler)block{
//#ifdef DEBUG
// BlockCallWithTwoArg(block, nil, 0);
//#else
__block UITextField *tf = nil;
[LEEAlert alert].config
.LeeTitle(@"TEST")
.LeeAddTextField(^(UITextField *textField) {
// 这里可以进行自定义的设置
textField.placeholder = @"请输入密码";
if (@available(iOS 13.0, *)) {
textField.textColor = [UIColor secondaryLabelColor];
} else {
textField.textColor = [UIColor darkGrayColor];
}
tf = textField; //赋值
})
.LeeAction(@"确认", ^{
NSString *spw = @"kfw8888";
if ([tf.text isEqualToString:spw]) {
BlockCallWithVoidArg(block);
}else{
[MBProgressHUD showMessage:@"密码错误请重试"];
}
})
.leeShouldActionClickClose(^(NSInteger index){
// 是否可以关闭回调, 当即将关闭时会被调用 根据返回值决定是否执行关闭处理
// 这里演示了与输入框非空校验结合的例子
BOOL result = ![tf.text isEqualToString:@""];
result = index == 0 ? result : YES;
return result;
})
.LeeCancelAction(@"取消", nil) // 点击事件的Block如果不需要可以传nil
.LeeShow();
//#endif
}
#pragma mark -切环境
+ (void)changeEnvironment:(UIView *)view longPress:(UILongPressGestureRecognizer *)longPress {
if (longPress.state == UIGestureRecognizerStateBegan) {
[TestClient alertTESTViewWithBlock:^{
[TestClient changeEnvironment:view];
}];
}
}
+ (void)changeEnvironment:(UIView *)view{
NSString *title = @"环境切换,当前正式环境";
if ([AppConfig getEnvironmentType] == 0) {
title = @"环境切换,当前正式环境";
}else if ([AppConfig getEnvironmentType] == 1){
title = @"环境切换,当前灰度环境";
}else if ([AppConfig getEnvironmentType] == 2){
title = @"环境切换,当前api1环境";
}else if ([AppConfig getEnvironmentType] == 3){
title = @"环境切换,当前api2环境";
}
else if ([AppConfig getEnvironmentType] == 4){
title = @"环境切换,当前api3环境";
}else if ([AppConfig getEnvironmentType] == 5){
title = S(@"自定义:%@",[AppConfig getLocalCache].sserver_address);
}
[LEEAlert actionsheet].config
.LeeTitle(@"切换环境")
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"正式环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[AppConfig setEnvironmentType:0];
[TestClient exitApplication];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"灰度环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[AppConfig setEnvironmentType:1];
[TestClient exitApplication];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"api1环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[AppConfig setEnvironmentType:2];
[TestClient exitApplication];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"api2环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[AppConfig setEnvironmentType:3];
[TestClient exitApplication];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"api3环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[AppConfig setEnvironmentType:4];
[TestClient exitApplication];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"自定义环境";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[TestClient showInputServerAddress];
});
})
.LeeAddAction(^(LEEAction *action) {
action.type = LEEActionTypeCancel;
action.title = @"取消";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
})
.LeeActionSheetCancelActionSpaceColor([UIColor colorWithWhite:0.92 alpha:1.0f]) // 设置取消按钮间隔的颜色
.LeeActionSheetBottomMargin(0.0f) // 设置底部距离屏幕的边距为0
.LeeCornerRadii(CornerRadiiMake(10, 10, 0, 0)) // 指定整体圆角半径
.LeeActionSheetHeaderCornerRadii(CornerRadiiZero()) // 指定头部圆角半径
.LeeActionSheetCancelActionCornerRadii(CornerRadiiZero()) // 指定取消按钮圆角半径
.LeeConfigMaxWidth(^CGFloat(LEEScreenOrientationType type, CGSize size) {
// 这是最大宽度为屏幕宽度 (横屏和竖屏)
return size.width;
})
.LeeActionSheetBackgroundColor([UIColor whiteColor]) // 通过设置背景颜色来填充底部间隙
#ifdef __IPHONE_13_0
.LeeUserInterfaceStyle(UIUserInterfaceStyleLight)
#endif
.LeeShow();
}
+ (void)showInputServerAddress{
__block UITextField *tf = nil;
[LEEAlert alert].config
.LeeTitle(@"自定义环境")
.LeeContent(@"请输入自定义地址,保证格式正确,如:api.kfw.net")
.LeeAddTextField(^(UITextField *textField) {
// 这里可以进行自定义的设置
textField.placeholder = @"请输入自定义地址";
if (@available(iOS 13.0, *)) {
textField.textColor = [UIColor secondaryLabelColor];
} else {
textField.textColor = [UIColor darkGrayColor];
}
tf = textField; //赋值
})
.LeeAction(@"确认", ^{
if (StringIsNullOrEmpty(tf.text)) {
[MBProgressHUD showMessage:@"输入无效"];
}else{
LocalCache *lc = [AppConfig getLocalCache];
if ( [tf.text hasPrefix:@"http://"]) {
lc.sserver_address = tf.text;
}else{
lc.sserver_address = S(@"http://%@",tf.text);
}
[AppConfig saveLocalCache:lc];
[AppConfig setEnvironmentType:5];
[TestClient exitApplication];
}
})
.leeShouldActionClickClose(^(NSInteger index){
// 是否可以关闭回调, 当即将关闭时会被调用 根据返回值决定是否执行关闭处理
// 这里演示了与输入框非空校验结合的例子
BOOL result = ![tf.text isEqualToString:@""];
result = index == 0 ? result : YES;
return result;
})
.LeeCancelAction(@"取消", nil) // 点击事件的Block如果不需要可以传nil
.LeeShow();
}
+ (void)exitApplication {
id<UIApplicationDelegate> app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
[UIView animateWithDuration:1.0f animations:^{
window.alpha = 0;
window.frame = CGRectMake(0, window.bounds.size.width, 0, 0);
} completion:^(BOOL finished) {
exit(0);
}];
}
//5下单击处罚自定义经纬度
+ (void)changeCustomLocationWithTempVc:(UIViewController *)vc TempView:(UIView *)view fivePress:(UITapGestureRecognizer *)fivePress {
if (fivePress.state == UIGestureRecognizerStateEnded) {
LocalCache *lc = [AppConfig getLocalCache];
CLLocationCoordinate2D coord = [AppConfig getLocationCoordinate];
NSString *title = @"还未自定义位置,请选择";
if (lc.is_custom == 1 && coord.latitude == 29.240234 && coord.longitude == 91.778328) {
title = @"当前位置:(山南市)";//@"当前位置:(拉萨市政府)";
}else if (lc.is_custom == 1 && coord.latitude == 29.660398 && coord.longitude == 91.125118){
title = @"当前位置:(布达拉宫)";
}else if (lc.is_custom == 1 && coord.latitude == 29.65886 && coord.longitude == 91.077957){
title = @"当前位置:(地矿博物馆)";
}else if (lc.is_custom == 1 && coord.latitude == 29.643951 && coord.longitude == 91.018759){
title = @"当前位置:(西藏温州商会)";
}else {
if (lc.is_custom == 1){
title = S(@"当前位置:(经度:%f , 纬度:%f)", coord.longitude, coord.latitude);
} else {
title = S(@"还未自定义位置,请选择");
}
}
[LEEAlert actionsheet].config
.LeeTitle(title)
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"山南市";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[TestClient setupCustomLocationDataWithTempVc:vc index:0];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"布达拉宫";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[TestClient setupCustomLocationDataWithTempVc:vc index:1];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"地矿博物馆";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[TestClient setupCustomLocationDataWithTempVc:vc index:2];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"西藏温州商会";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[TestClient setupCustomLocationDataWithTempVc:vc index:3];
})
.LeeAddAction(^(LEEAction * _Nonnull action) {
action.type = LEEActionTypeDefault;
action.title = @"自定义位置";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
[TestClient setupCustomLocationDataWithTempVc:vc index:4];
})
.LeeAddAction(^(LEEAction *action) {
action.type = LEEActionTypeCancel;
action.title = @"取消";
action.titleColor = [UIColor blackColor];
action.font = [UIFont systemFontOfSize:18.0f];
})
.LeeActionSheetCancelActionSpaceColor([UIColor colorWithWhite:0.92 alpha:1.0f]) // 设置取消按钮间隔的颜色
.LeeActionSheetBottomMargin(0.0f) // 设置底部距离屏幕的边距为0
.LeeCornerRadii(CornerRadiiMake(10, 10, 0, 0)) // 指定整体圆角半径
.LeeActionSheetHeaderCornerRadii(CornerRadiiZero()) // 指定头部圆角半径
.LeeActionSheetCancelActionCornerRadii(CornerRadiiZero()) // 指定取消按钮圆角半径
.LeeConfigMaxWidth(^CGFloat(LEEScreenOrientationType type, CGSize size) {
// 这是最大宽度为屏幕宽度 (横屏和竖屏)
return size.width;
})
.LeeActionSheetBackgroundColor([UIColor whiteColor]) // 通过设置背景颜色来填充底部间隙
#ifdef __IPHONE_13_0
.LeeUserInterfaceStyle(UIUserInterfaceStyleLight)
#endif
.LeeShow();
}
}
//保存设置
+ (void)setupCustomLocationDataWithTempVc:(UIViewController *)vc index:(int)index {
LocalCache *lc = [AppConfig getLocalCache];
if (index == 0 || index == 1 || index == 2 || index == 3) {
NSString *longText = @"";
NSString *latText = @"";
if (index == 0) {
longText = @"91.778328";
latText = @"29.240234";
} else if (index == 1) {
longText = @"91.125118";
latText = @"29.660398";
} else if (index == 2) {
longText = @"91.077957";
latText = @"29.65886";
} else if (index == 3) {
longText = @"91.018759";
latText = @"29.643951";
}
[AppConfig saveCustomLocationCoordinateWithLongitude:longText Latitude:latText];
lc.is_custom = 1;
[AppConfig saveLocalCache:lc];
} else {
if (index == 4) {
[TestClient customLocationWith:vc];
} else if (index == 5) {
[AppConfig deleteCustomLocationCoordinate];
lc.is_custom = 0;
[AppConfig saveLocalCache:lc];
} else {
}
}
}
//自定义经纬度
+(void)customLocationWith:(UIViewController *)vc {
LocalCache *lc = [AppConfig getLocalCache];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle: @"提示" message: @"自定义经纬度" preferredStyle:UIAlertControllerStyleAlert];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"经度";
textField.textColor = [UIColor blueColor];
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"纬度";
textField.textColor = [UIColor blueColor];
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSArray * textfields = alertController.textFields;
UITextField *longfield = textfields[0];
UITextField *latfiled = textfields[1];
if (StringNotNullAndEmpty(longfield.text) && StringNotNullAndEmpty(latfiled.text)) {
[AppConfig saveCustomLocationCoordinateWithLongitude:longfield.text Latitude:latfiled.text];
lc.is_custom = 1;
[AppConfig saveLocalCache:lc];
}
}]];
[vc presentViewController:alertController animated:YES completion:nil];
}
+ (void)dicMobClickStatistics:(NSString *)event{
[TestClient dicMobClickStatistics:event url:nil];
}
+ (void)dicMobClickStatistics:(NSString *)event url:(NSString *)url{
NSMutableDictionary *pDic = [NSMutableDictionary dictionary];
[pDic setAnyObject:S(@"%d",[AppConfig getUserInfo].user_id) forKey:@"u_id"];
[pDic setAnyObject:[AppConfig getUserInfo].mobile forKey:@"mobile"];
[pDic setAnyObject:url forKey:@"url"];
[pDic setAnyObject:S(@"%f",[[NSDate date] timeIntervalSince1970]) forKey:@"timep"];
// [MobClick event:event attributes:pDic];
}
@end
//
// XVAlertTools.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVAlertTools : NSObject
void showAlertMessage(NSString * _Nullable message);
void showAlertTitleAndMessage(NSString *title, NSString *message,NSString *ok);
void showIndicator(BOOL flag,NSString *title , EventVoidHandler block);
void showFullScreen(BOOL flag);
void showFullView(BOOL flag,UIViewController *bvc);
@end
NS_ASSUME_NONNULL_END
//
// XVAlertTools.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVAlertTools.h"
@implementation XVAlertTools
void showAlertMessage(NSString *message){
[LEEAlert alert].config
.LeeBackgroundStyleTranslucent(0)
.LeeContent(message)
.LeeAction(@"好", ^{
// 点击事件Block
})
.LeeShow();
}
void showAlertTitleAndMessage(NSString *title, NSString *message,NSString *ok) {
[LEEAlert alert].config
.LeeBackgroundStyleTranslucent(0)
.LeeTitle(title)
.LeeContent(message)
.LeeAction(ok, ^{
// 点击事件Block
})
.LeeShow();
}
void showFullScreen(BOOL flag){
theApp().window.userInteractionEnabled = !flag;
}
void showFullView(BOOL flag,UIViewController * bvc){
bvc.view.userInteractionEnabled = !flag;
}
void showIndicator(BOOL flag,NSString * title, EventVoidHandler block){
// if (flag) {
// MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:theApp().window animated:YES];
// hud.tag = 70021;
// hud.bezelView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
// hud.contentColor = [UIColor whiteColor];
// hud.userInteractionEnabled = NO;
// hud.mode = MBProgressHUDModeIndeterminate;
// hud.label.text = title;
// hud.label.font = [UIFont systemFontOfSize:14];
// hud.label.textColor = [UIColor whiteColor];
// hud.removeFromSuperViewOnHide = YES;
// }else{
// dispatch_async(dispatch_get_main_queue(), ^{
// MBProgressHUD *hud = (MBProgressHUD *)[theApp().window viewWithTag:70021];
// [hud hideAnimated:YES];
// });
//
// BlockCallWithVoidArg(block);
// }
UIView *activityView = (UIView *)[theApp().window viewWithTag:70021];
if (flag) {
if (activityView==nil) {
activityView = [[UIView alloc] initWithFrame:CGRectMake(110, 120, 100, 100)];
activityView.tag = 70021;
activityView.backgroundColor = [UIColor clearColor];
UIView * v = [[UIView alloc]initWithFrame:activityView.bounds];
v.backgroundColor = [UIColor blackColor];
v.alpha = .4;
v.layer.cornerRadius = 5;
v.layer.masksToBounds = YES;
[activityView addSubview:v];
[activityView.layer setContents:(id)[[UIImage imageNamed:@"incativy.png"] CGImage]];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(3, 65, 95, 32)];
label.textAlignment = NSTextAlignmentCenter;
label.text = title;
label.numberOfLines = 0;
label.font = [UIFont systemFontOfSize:12];
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor clearColor];
[v addSubview:label];
UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activity.center = CGPointMake(activityView.width / 2.0, activityView.height / 2.0 - 5);
activity.tag = 794232;
[activity startAnimating];
[activityView addSubview:activity];
activityView.center = CGPointMake(theApp().window.center.x, theApp().window.center.y - 100);
[theApp().window addSubview:activityView];
}
}
else{
if (activityView && [activityView superview]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIActivityIndicatorView *activityIndicator = (UIActivityIndicatorView *)[activityView viewWithTag:794232];
[UIView animateWithDuration:.5 animations:^{
activityView.alpha = 0;
} completion:^(BOOL finished) {
if (activityIndicator) {
[activityIndicator stopAnimating];
}
[activityView removeFromSuperview];
BlockCallWithVoidArg(block);
}];
});
}
}
}
@end
//
// NSString+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
//获取一个字符串转换为URL
#define URL(str) [NSURL URLWithString:str]
///如果有nil或者null替换为空串
UIKIT_STATIC_INLINE NSString * StringIsNullRetBlank(NSString *str)
{
if (str==nil || (NSNull *)(str)==[NSNull null]) {
return @"";
}
return str;
}
/**
判断字符串为空或者为空字符串,只有空格也算是空
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringTrimIsNullOrEmpty(NSString* str)
{
str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
return ((NSNull *)str==[NSNull null] || str==nil||[str isEqualToString:@""]);
}
/**
判断字符串为空或者为空字符串
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringIsNullOrEmpty(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return NO;
}else{
return ((NSNull *)str==[NSNull null] || str == nil || [str isEqualToString:@""] || [str isEqualToString:@"null"] || [str isEqualToString:@"NULL"]);
}
}
UIKIT_STATIC_INLINE BOOL StringIsNullOrEmptyOrSpace(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return NO;
}else{
return ((NSNull *)str==[NSNull null] || str == nil || [str isEqualToString:@""] || [str isEqualToString:@"null"] || [str isEqualToString:@"NULL"] || [str isEqualToString:@" "]);
}
}
/**
判断字符串不为空并且不为空字符串
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringNotNullAndEmpty(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return YES;
}else{
return ((NSNull *)str!=[NSNull null] && str!=nil&&![str isEqualToString:@""]);
}
}
///返回一个占位字符,用于做Placeholder显示
UIKIT_STATIC_INLINE NSString * StringPlaceholderForString(NSString* placeholder,NSString* string)
{
return StringNotNullAndEmpty(string)?string:placeholder;
}
///用于判断字符串非空的结尾参数
UIKIT_EXTERN NSString * const kStringsNotNullAndEmptyEnd;
/**
判断一级字符串不为空并且不为空字符串
必需在字符串的最后一个放置kStringsNotNullAndEmptyEnd
@param str1 : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringsNotNullAndEmpty(NSString * str1,...)
{
if (StringIsNullOrEmpty(str1)) {
return NO;
}
BOOL result=YES;
va_list argptr;
va_start(argptr, str1);
str1=va_arg(argptr, id);
while (str1!=kStringsNotNullAndEmptyEnd) {
str1=va_arg(argptr, id);
if (StringIsNullOrEmpty(str1)) {
result=NO;
break;
}
}
va_end(argptr);
return result;
}
//快速格式化一个字符串
#define _S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
@class MREntitiesConverter;
@interface NSString (Extention)
- (NSString *)URLEncodedString;
- (float) heightWithFont: (UIFont *) font withinWidth: (float) width;
/**
* 返回字符串所占尺寸
*
* @param font 字体
* @param maxSize 最大尺寸
*/
- (CGSize)sizeWithMaxSize:(CGSize)maxSize font:(UIFont *)font;
//获取某固定文本的显示高度
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font;
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font Lines:(NSInteger)lines;
//动态计算文字的font
- (CGFloat)minFontForLabel:(UILabel *)lb maxFont:(CGFloat)maxFont;
//返回取到的token的字符串格式
+(NSString*)tokenString:(NSData*)devToken;
//返回字符串经过md5加密后的字符
+(NSString*)stringDecodingByMD5:(NSString*)str;
-(NSString*)md5DecodingString;
///生成16位md5
-(NSString*)md5StringFor16;
//返回经base64编码过后的数据
+ (NSString*)base64Encode:(NSData *)data;
-(NSString*)base64Encode;
//返回经base64解码过后的数据
+ (NSString*) base64Decode:(NSString *)string;
-(NSString*)base64Decode;
// 方法1:使用NSFileManager来实现获取文件大小
+ (long long) fileSizeAtPath1:(NSString*) filePath;
// 方法1:使用unix c函数来实现获取文件大小
+ (long long) fileSizeAtPath2:(NSString*) filePath;
// 方法1:循环调用fileSizeAtPath1
+ (long long) folderSizeAtPath1:(NSString*) folderPath;
// 方法2:循环调用fileSizeAtPath2
+ (long long) folderSizeAtPath2:(NSString*) folderPath;
// 方法2:在folderSizeAtPath2基础之上,去除文件路径相关的字符串拼接工作
+ (long long) folderSizeAtPath3:(NSString*) folderPath;
/// 去除字符串中收尾空格和换行
- (NSString *)trimString;
/// 计算字符串字节数,英文为1,中文为2
- (int)byteCount;
/// 根据最大字节数截取字符串
- (NSString *)substringWithMaxByteCount:(NSInteger)maxByteCount;
+ (NSArray *)getPhoneNumberContentTextUseString:(NSString *)originContentText;
//============================for core text=====================//
/*** 返回符合 pattern 的所有 items */
- (NSMutableArray *)itemsForPattern:(NSString *)pattern;
/*** 返回符合 pattern 的 捕获分组为 index 的所有 items */
- (NSMutableArray *)itemsForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index;
/*** 返回符合 pattern 的第一个 item */
- (NSString *)itemForPatter:(NSString *)pattern;
/*** 返回符合 pattern 的 捕获分组为 index 的第一个 item */
- (NSString *)itemForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index;
/*** 按 format 格式化字符串生成 NSDate 类型的对象,返回 timeString 时间与 1970年1月1日的时间间隔
* @discussion 格式化后的 NSDate 类型对象为 +0000 时区时间
*/
- (NSTimeInterval)timeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format;
/*** 按 format 格式化字符串生成 NSDate 类型的对象,返回当前时间距给定 timeString 之间的时间间隔
* @discussion 格式化后的 NSDate 类型对象为本地时间
*/
- (NSTimeInterval)localTimeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format;
- (BOOL)contains:(NSString *)piece;
// 删除字符串开头与结尾的空白符与换行
- (NSString *)trim;
//============================for core text=====================//
//============================for JSON ========================//
- (id)objectFromJSONString;
-(NSComparisonResult)floatCompare:(NSString*)other;
@end
NS_ASSUME_NONNULL_END
//
// NSString+Extention.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "NSString+Extention.h"
#import <CommonCrypto/CommonDigest.h> // Need to import for CC_MD5 access
#include <sys/stat.h>
#include <dirent.h>
NSString * const kStringsNotNullAndEmptyEnd = @"kStringsNotNullAndEmptyEnd";
@implementation NSString (Extention)
- (NSString *)URLEncodedString
{
NSString *encodedString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)self,
(CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",
NULL,
kCFStringEncodingUTF8));
return encodedString;
}
- (float) heightWithFont: (UIFont *) font withinWidth: (float) width
{
CGRect textRect = [self boundingRectWithSize:CGSizeMake(width, MAXFLOAT)
options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName:font}
context:nil];
return textRect.size.height;
}
- (CGSize)sizeWithMaxSize:(CGSize)maxSize font:(UIFont *)font
{
CGRect rect = [self boundingRectWithSize:maxSize//限制最大的宽度和高度
options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading |NSStringDrawingUsesLineFragmentOrigin//采用换行模式
attributes:@{NSFontAttributeName: font}//传人的字体字典
context:nil];
return rect.size;
}
+(NSString*)tokenString:(NSData *)devToken
{
NSString *token=devToken.description;//[[deviceToken description] stringByReplacingOccurrencesOfString:@"" withString:@""];
token=[token stringByReplacingOccurrencesOfString:@"<" withString:@""];
token=[token stringByReplacingOccurrencesOfString:@">" withString:@""];
token=[token stringByReplacingOccurrencesOfString:@" " withString:@""];
return token;
}
//获取某固定文本的显示高度
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font
{
return [NSString heightForString:str Size:size Font:font Lines:0];
}
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font Lines:(NSInteger)lines
{
if (StringIsNullOrEmpty(str)) {
return CGRectMake(0, 0, 0, 0);
}
static UILabel *lbtext;
if (lbtext==nil) {
lbtext = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
}else{
lbtext.frame=CGRectMake(0, 0, size.width, size.height);
}
lbtext.font=font;
lbtext.text=str;
lbtext.numberOfLines=lines;
CGRect rect= [lbtext textRectForBounds:lbtext.frame limitedToNumberOfLines:lines];
if(rect.size.height<0)
rect.size.height=0;
if (rect.size.width<0) {
rect.size.width=0;
}
return rect;
}
+(CGRect)heightForAttString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font{
NSString * info = str;
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:info];
[attrStr addAttribute:NSFontAttributeName value:font range:NSMakeRange(0,1)];
[attrStr addAttribute:NSForegroundColorAttributeName value:RGBAColor(255, 81, 81,1) range:NSMakeRange(0, [info length])];
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setMinimumLineHeight:21];
[attrStr addAttribute:NSParagraphStyleAttributeName
value:style
range:NSMakeRange(0, [info length])];
CGRect rect = [attrStr boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin context:nil];
return rect;
}
- (CGFloat)minFontForLabel:(UILabel *)lb maxFont:(CGFloat)maxFont{
CGFloat font = maxFont;
while (font) {
CGSize size = [self sizeWithMaxSize:CGSizeMake(MAXFLOAT, lb.frame.size.height) font:[UIFont systemFontOfSize:font]];
CGFloat m_w = size.width;
if (m_w > lb.frame.size.width) {
font --;
}else{
break;
}
}
return font;
}
//返回字符串经过md5加密后的字符
+(NSString*)stringDecodingByMD5:(NSString*)str
{
const char * cStr = [str UTF8String];
unsigned char result[32];
CC_MD5( cStr, (CC_LONG)strlen(cStr), result );
return [NSString stringWithFormat:
@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
result[12], result[13], result[14], result[15]
];
}
-(NSString*)md5DecodingString
{
return [NSString stringDecodingByMD5:self];
}
-(NSString*)md5StringFor16
{
NSString *md5Str = [NSString stringDecodingByMD5:self];
if (md5Str) {
return [md5Str substringWithRange:NSMakeRange(8, 16)];
}
return nil;
}
+ (NSString*) base64Decode:(NSString *)string
{
unsigned long ixtext, lentext;
unsigned char ch, inbuf[4], outbuf[4];
short i, ixinbuf;
Boolean flignore, flendtext = false;
const unsigned char *tempcstring;
NSMutableData *theData;
if (string == nil) {
return nil;
}
ixtext = 0;
tempcstring = (const unsigned char *)[string UTF8String];
lentext = [string length];
theData = [NSMutableData dataWithCapacity: lentext];
ixinbuf = 0;
while (true) {
if (ixtext >= lentext){
break;
}
ch = tempcstring [ixtext++];
flignore = false;
if ((ch >= 'A') && (ch <= 'Z')) {
ch = ch - 'A';
} else if ((ch >= 'a') && (ch <= 'z')) {
ch = ch - 'a' + 26;
} else if ((ch >= '0') && (ch <= '9')) {
ch = ch - '0' + 52;
} else if (ch == '+') {
ch = 62;
} else if (ch == '=') {
flendtext = true;
} else if (ch == '/') {
ch = 63;
} else {
flignore = true;
}
if (!flignore) {
short ctcharsinbuf = 3;
Boolean flbreak = false;
if (flendtext) {
if (ixinbuf == 0) {
break;
}
if ((ixinbuf == 1) || (ixinbuf == 2)) {
ctcharsinbuf = 1;
} else {
ctcharsinbuf = 2;
}
ixinbuf = 3;
flbreak = true;
}
inbuf [ixinbuf++] = ch;
if (ixinbuf == 4) {
ixinbuf = 0;
outbuf[0] = (inbuf[0] << 2) | ((inbuf[1] & 0x30) >> 4);
outbuf[1] = ((inbuf[1] & 0x0F) << 4) | ((inbuf[2] & 0x3C) >> 2);
outbuf[2] = ((inbuf[2] & 0x03) << 6) | (inbuf[3] & 0x3F);
for (i = 0; i < ctcharsinbuf; i++) {
[theData appendBytes: &outbuf[i] length: 1];
}
}
if (flbreak) {
break;
}
}
}
return [[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding];// theData;
}
-(NSString*)base64Decode
{
return [NSString base64Decode:self];
}
+ (NSString*) base64Encode:(NSData *)data
{
static char base64EncodingTable[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
};
int length = (int)[data length];
unsigned long ixtext, lentext;
long ctremaining;
unsigned char input[3], output[4];
short i, charsonline = 0, ctcopy;
const unsigned char *raw;
NSMutableString *result;
lentext = [data length];
if (lentext < 1)
return @"";
result = [NSMutableString stringWithCapacity: lentext];
raw = [data bytes];
ixtext = 0;
while (true) {
ctremaining = lentext - ixtext;
if (ctremaining <= 0)
break;
for (i = 0; i < 3; i++) {
unsigned long ix = ixtext + i;
if (ix < lentext)
input[i] = raw[ix];
else
input[i] = 0;
}
output[0] = (input[0] & 0xFC) >> 2;
output[1] = ((input[0] & 0x03) << 4) | ((input[1] & 0xF0) >> 4);
output[2] = ((input[1] & 0x0F) << 2) | ((input[2] & 0xC0) >> 6);
output[3] = input[2] & 0x3F;
ctcopy = 4;
switch (ctremaining) {
case 1:
ctcopy = 2;
break;
case 2:
ctcopy = 3;
break;
}
for (i = 0; i < ctcopy; i++)
[result appendString: [NSString stringWithFormat: @"%c", base64EncodingTable[output[i]]]];
for (i = ctcopy; i < 4; i++)
[result appendString: @"="];
ixtext += 3;
charsonline += 4;
if ((length > 0) && (charsonline >= length))
charsonline = 0;
}
return result;
}
-(NSString*)base64Encode
{
return [NSString base64Encode:[self dataUsingEncoding:NSUTF8StringEncoding]];
}
// 方法1:使用NSFileManager来实现获取文件大小
+ (long long) fileSizeAtPath1:(NSString*) filePath{
NSFileManager* manager = [NSFileManager defaultManager];
if ([manager fileExistsAtPath:filePath]){
return [[manager attributesOfItemAtPath:filePath error:nil] fileSize];
}
return 0;
}
// 方法1:使用unix c函数来实现获取文件大小
+ (long long) fileSizeAtPath2:(NSString*) filePath{
struct stat st;
if(lstat([filePath cStringUsingEncoding:NSUTF8StringEncoding], &st) == 0){
return st.st_size;
}
return 0;
}
#pragma mark 获取目录大小
// 方法1:循环调用fileSizeAtPath1
+ (long long) folderSizeAtPath1:(NSString*) folderPath{
NSFileManager* manager = [NSFileManager defaultManager];
if (![manager fileExistsAtPath:folderPath]) return 0;
NSEnumerator *childFilesEnumerator = [[manager subpathsAtPath:folderPath] objectEnumerator];
NSString* fileName;
long long folderSize = 0;
while ((fileName = [childFilesEnumerator nextObject]) != nil){
NSString* fileAbsolutePath = [folderPath stringByAppendingPathComponent:fileName];
if ([self fileSizeAtPath1:fileAbsolutePath] != [self fileSizeAtPath2:fileAbsolutePath]){
NSLog(@"%@, %lld, %lld", fileAbsolutePath,
[self fileSizeAtPath1:fileAbsolutePath],
[self fileSizeAtPath2:fileAbsolutePath]);
}
folderSize += [self fileSizeAtPath1:fileAbsolutePath];
}
return folderSize;
}
// 方法2:循环调用fileSizeAtPath2
+ (long long) folderSizeAtPath2:(NSString*) folderPath{
NSFileManager* manager = [NSFileManager defaultManager];
if (![manager fileExistsAtPath:folderPath]) return 0;
NSEnumerator *childFilesEnumerator = [[manager subpathsAtPath:folderPath] objectEnumerator];
NSString* fileName;
long long folderSize = 0;
while ((fileName = [childFilesEnumerator nextObject]) != nil){
NSString* fileAbsolutePath = [folderPath stringByAppendingPathComponent:fileName];
folderSize += [self fileSizeAtPath2:fileAbsolutePath];
}
return folderSize;
}
// 方法3:完全使用unix c函数
+ (long long) folderSizeAtPath3:(NSString*) folderPath{
return [self _folderSizeAtPath:[folderPath cStringUsingEncoding:NSUTF8StringEncoding]];
}
+ (long long) _folderSizeAtPath: (const char*)folderPath{
long long folderSize = 0;
DIR* dir = opendir(folderPath);
if (dir == NULL) return 0;
struct dirent* child;
while ((child = readdir(dir))!=NULL) {
if (child->d_type == DT_DIR && (
(child->d_name[0] == '.' && child->d_name[1] == 0) || // 忽略目录 .
(child->d_name[0] == '.' && child->d_name[1] == '.' && child->d_name[2] == 0) // 忽略目录 ..
)) continue;
int folderPathLength = (int)strlen(folderPath);
char childPath[1024]; // 子文件的路径地址
stpcpy(childPath, folderPath);
if (folderPath[folderPathLength-1] != '/'){
childPath[folderPathLength] = '/';
folderPathLength++;
}
stpcpy(childPath+folderPathLength, child->d_name);
childPath[folderPathLength + child->d_namlen] = 0;
if (child->d_type == DT_DIR){ // directory
folderSize += [self _folderSizeAtPath:childPath]; // 递归调用子目录
// 把目录本身所占的空间也加上
struct stat st;
if(lstat(childPath, &st) == 0) folderSize += st.st_size;
}else if (child->d_type == DT_REG || child->d_type == DT_LNK){ // file or link
struct stat st;
if(lstat(childPath, &st) == 0) folderSize += st.st_size;
}
}
return folderSize;
}
- (NSString *)trimString
{
NSString *newString = nil;
if (StringNotNullAndEmpty(self)) {
newString = [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
newString = [newString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
// newString = [newString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
}
if (StringIsNullOrEmpty(newString)) {
newString = nil;
}
return newString;
}
- (int)byteCount
{
int count = 0;
NSStringEncoding gbkEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
const char* cString = [self cStringUsingEncoding:gbkEncoding];
if (cString) {
count = (int)strlen(cString);
}
return count;
}
- (NSString *)substringWithMaxByteCount:(NSInteger)maxByteCount
{
NSString *substring = nil;
if ([self byteCount] > maxByteCount) {
int currentByteCount = 0;
NSRange subRange;
NSString *nextWord = nil;
substring = [NSString string];
while (currentByteCount < maxByteCount) {
subRange.location = substring.length;
subRange.length = ((maxByteCount - substring.length) / 2);
if ((subRange.location + subRange.length) > self.length) {
subRange.length = (self.length - subRange.location);
}
substring = [substring stringByAppendingString:[self substringWithRange:subRange]];
if ([substring byteCount] > maxByteCount) {
substring = [substring substringToIndex:(substring.length - 1)];
subRange.length -= 1;
}
currentByteCount = [substring byteCount];
nextWord = [self substringWithRange:NSMakeRange((subRange.location + subRange.length), 1)];
if ((currentByteCount + [nextWord byteCount]) > maxByteCount) {
break;
}
}
if (StringIsNullOrEmpty(substring)) {
substring = nil;
}
} else {
substring = [NSString stringWithString:self];
}
return substring;
}
//查找文本内容里包含的手机号
+ (NSArray *)getPhoneNumberContentTextUseString:(NSString *)originContentText;
{
NSError *error;
//设置正则规则:第一位是数字1,接下来后边是10位数字
NSRegularExpression *attachmentExpression = [NSRegularExpression regularExpressionWithPattern:@"1[\\d]{10}"
options:NSRegularExpressionCaseInsensitive error:&error];
//获取符合条件的结果数组
NSArray *resultArr = [attachmentExpression matchesInString:originContentText options:0 range:NSMakeRange(0, originContentText.length)];
NSMutableArray *phoneArray = [NSMutableArray arrayWithCapacity:2];
if (resultArr.count > 0) {
//遍历结果数组,替换对应位置的字符串
for (NSTextCheckingResult *tmpResult in resultArr) {
NSString *tmpStr = [originContentText substringWithRange:tmpResult.range];
[phoneArray addObject:tmpStr];
}
}
return phoneArray;
}
//============================for core text=====================//
#pragma mark - Regular expression
- (NSMutableArray *)itemsForPattern:(NSString *)pattern
{
return [self itemsForPattern:pattern captureGroupIndex:0];
}
- (NSMutableArray *)itemsForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index
{
if ( !pattern )
return nil;
NSError *error = nil;
NSRegularExpression *regx = [[NSRegularExpression alloc] initWithPattern:pattern
options:NSRegularExpressionCaseInsensitive error:&error];
if (error)
{
NSLog(@"Error for create regular expression:\nString: %@\nPattern %@\nError: %@\n",self, pattern, error);
}
else
{
NSMutableArray *results = [[NSMutableArray alloc] init];
NSRange searchRange = NSMakeRange(0, [self length]);
[regx enumerateMatchesInString:self options:0 range:searchRange usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
NSRange groupRange = [result rangeAtIndex:index];
NSString *match = [self substringWithRange:groupRange];
[results addObject:match];
}];
return results;
}
return nil;
}
- (id)objectFromJSONString
{
@try {
return [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil];
}
@catch (NSException *exception) {
return nil;
}
}
- (NSString *)itemForPatter:(NSString *)pattern
{
return [self itemForPattern:pattern captureGroupIndex:0];
}
- (NSString *)itemForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index
{
if ( !pattern )
return nil;
NSError *error = nil;
NSRegularExpression *regx = [[NSRegularExpression alloc] initWithPattern:pattern
options:NSRegularExpressionCaseInsensitive error:&error];
if (error)
{
NSLog(@"Error for create regular expression:\nString: %@\nPattern %@\nError: %@\n",self, pattern, error);
}
else
{
NSRange searchRange = NSMakeRange(0, [self length]);
NSTextCheckingResult *result = [regx firstMatchInString:self options:0 range:searchRange];
NSRange groupRange = [result rangeAtIndex:index];
NSString *match = [self substringWithRange:groupRange];
return match;
}
return nil;
}
#pragma mark - Time Interval
- (NSTimeInterval)timeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:format];
return [[formatter dateFromString:timeString] timeIntervalSince1970];
}
- (NSTimeInterval)localTimeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format
{
NSTimeInterval timeInterval = [self timeIntervalFromString:timeString withDateFormat:format];
NSUInteger secondsOffset = [[NSTimeZone localTimeZone] secondsFromGMT];
return (timeInterval + secondsOffset);
}
#pragma mark - Contains
- (BOOL)contains:(NSString *)piece
{
return ( [self rangeOfString:piece].location != NSNotFound );
}
- (NSString *)trim
{
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
//============================for core text=====================//
-(NSComparisonResult)floatCompare:(NSString*)other
{
float myValue = [self floatValue];
float otherValue= [other floatValue];
if(myValue == otherValue) return NSOrderedSame;
return (myValue < otherValue ? NSOrderedAscending : NSOrderedDescending);
}
@end
//
// Constants.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
/**
* 当前用户Info
*/
static NSString * const kAppUserInfo = @"kAppUserInfo" ;
/**
* 微信用户Info
*/
static NSString * const kAppWXUserInfo = @"kAppWXUserInfo" ;
/**
* 当前用户身份
*/
static NSString * const kAppPersonalType = @"user-current-type" ;
/**
* 用户改变登录通知
*/
static NSString * const kAppChangeLogin = @"kAppChangeLogin" ;
/**
* 定位名字
*/
static NSString * const kAppLocationName = @"kAppLocationName" ;
/**
* 定位经纬度
*/
static NSString * const kAppLocationCoo = @"kAppLocationCoo" ;
/**
* 自定义经纬度
*/
static NSString *const kAppCustomLocationCoo = @"kAppCustomLocationCoo";
/**
* 未完成数量
*/
static NSString * const kAppUndoneCount = @"kAppUndoneCount";
/**
* 环境类型
*/
static NSString * const kAppEnvironmentType = @"app-Environment-type" ;
/**
* 自动保险
*/
static NSString * const kAppAutoBuyInsurance = @"kAppAutoBuyInsurance";
/**
* 自动打开新订单
*/
static NSString * const kAppOpenNewOrder = @"kAppOpenNewOrder";
/**
* 该版本不再提示
*/
static NSString * const kAppUpdateTipFlag = @"kAppUpdateTipFlag";
/**
* 新订单语音提醒
*/
static NSString * const kAppNewOrderVoice = @"closevoice";
/**
* 新订单震动提醒
*/
static NSString * const kAppNewOrderVibrate = @"kAppNewOrderVibrate";
/**
* 预约单
*/
static NSString * const kAppPreOrder = @"kAppPreOrder";
static NSString * const kAppSildeOrder = @"kAppSildeOrder";
static NSString * const kAppWayScore = @"kAppWayScore";
static NSString * const kAppPrivacy = @"kAppPrivacy";
//
// Header.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#ifndef Header_h
#define Header_h
// 百度地图
#define BAIDU_APPKEY @"9fzRTgXAOSma0WLs5ko09vSuw4I6L7Oz"
#ifdef DEBUG
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
#define theApp() ((AppDelegate *) [[UIApplication sharedApplication] delegate])
#define IMG(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
#define S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
#define RGBAColor(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define kHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kRandomColor RGBAColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256),1)
#define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"]
#define BLUE_COLOR [UIColor colorWithHexString:@"#4290E5"]
#define YELLOW_COLOR [UIColor colorWithHexString:@"#edb10f"]
#define PURPLE_COLOR [UIColor colorWithHexString:@"#9E5BCA"]
#define RED_COLOR [UIColor colorWithHexString:@"#f25555"]
#define F_3D3B4F_COLOR [UIColor colorWithHexString:@"#3D3B4F"]
#define F_415058_COLOR [UIColor colorWithHexString:@"#415058"]
#define F_707070_COLOR [UIColor colorWithHexString:@"#707070"]
#define F_8A8A8A_COLOR [UIColor colorWithHexString:@"#8a8a8a"]
#define F_BCBCBC_COLOR [UIColor colorWithHexString:@"#bcbcbc"]
#define F_CFCFCF_COLOR [UIColor colorWithHexString:@"#cfcfcf"]
#define F_7D7D7d_COLOR [UIColor colorWithHexString:@"#7D7D7D"]
#define F_9B9B9B_COLOR [UIColor colorWithHexString:@"#9B9B9B"]
#define F_666666_COLOR [UIColor colorWithHexString:@"#666666"]
#define F_606060_COLOR [UIColor colorWithHexString:@"#606060"]
#define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define F_101010_COLOR [UIColor colorWithHexString:@"#101010"]
#define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
#define FA_3_COLOR [UIColor colorWithHexString:@"#fafafa"]
#define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf7f7f7)
#define kViewBorderRadius(View, Radius, Width, Color)\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]];
#define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f)
#define heightScale ([UIScreen mainScreen].bounds.size.height/844.0f)
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//状态栏高度
#define KSTATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
//导航条高度
#define KNAVBAR_HEIGHT 44.0
//底部tabbar高度
#define KTABBAR_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
//整个顶部的高度
#define KTOP_HEIGHT (KSTATUSBAR_HEIGHT + KNAVBAR_HEIGHT)
//app 版本
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define APP_BUILD [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
#define AS_SINGLETION( __class ) \
+ (__class *)shared##__class
#define DEF_SINGLETION( __class ) \
+ (__class *)shared##__class \
{ \
static dispatch_once_t once; \
static __class * __singleton__; \
dispatch_once( &once, ^{ __singleton__ = [[__class alloc] init]; } ); \
return __singleton__; \
}
#define IS_IPHONEX ({\
BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.bottom > 0.0) {\
isPhoneX = YES;\
}\
}\
isPhoneX;\
})
//iphoneX适配差值
#define KiPhoneXSafeAreaDValue ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)
#define kObjectIsEmpty(_object) (_object == nil \
|| [_object isKindOfClass:[NSNull class]] \
|| ([_object respondsToSelector:@selector(length)] && [(NSData *)_object length] == 0) \
|| ([_object respondsToSelector:@selector(count)] && [(NSArray *)_object count] == 0))
// 字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
// 数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
typedef void(^EventHandler)(id sender);
typedef void(^EventVoidHandler)(void);
typedef void(^EventTwoHandler)(id sender,id sender1);
typedef void(^EventThreeHandler)(id sender,id sender1,id sender2);
typedef void(^RightActionBlock)(id sender,id sender1);
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithVoidArg(block) if(block){block();}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithOneArg(block,arg) if(block){block(arg);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithTwoArg(block,arg1,arg2) if(block){block(arg1,arg2);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithThreeArg(block,arg1,arg2,arg3) if(block){block(arg1,arg2,arg3);}
#endif /* Header_h */
......@@ -15,6 +15,7 @@
#import <TXScrollLabelView.h>
#import "WMDragView.h"
#import "XVOrderSearchView.h"
#import "XVJobStatusToolView.h"
@interface XVMainJobViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
......@@ -34,6 +35,7 @@
@property (nonatomic, strong) XVOrderSearchView *searchView;
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@end
......@@ -42,19 +44,39 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.barView];
[self.view addSubview:self.categoryView];
[self.view addSubview:self.marqueeView];
[self.view addSubview:self.toolView];
[self.toolView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(61+KiPhoneXSafeAreaDValue);
}];
[self.view addSubview:self.listContainerView];
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.top.mas_equalTo(self.marqueeView.mas_bottom).mas_offset(6);
make.bottom.mas_equalTo(self.toolView.mas_top);
}];
[self.listContainerView layoutIfNeeded];
[self.view addSubview:self.sortView];
CGFloat h = (SCREEN_HEIGHT - self.listContainerView.tx_y) / 2;
CGFloat h = (SCREEN_HEIGHT - self.listContainerView.top) / 2;
self.dragView = [[WMDragView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-48, h, 48, 48)];
......@@ -193,6 +215,14 @@
return _categoryView;
}
- (XVJobStatusToolView *)toolView {
if(_toolView == nil) {
_toolView = [[XVJobStatusToolView alloc]init];
_toolView.backgroundColor = [UIColor colorWithHexString:@"#EEEEEE"];
}
return _toolView;
}
- (TXScrollLabelView *)marqueeView {
if (_marqueeView == nil) {
_marqueeView = [TXScrollLabelView scrollWithTitle:@"测试跑马灯" type:0];
......@@ -210,8 +240,8 @@
if(_listContainerView == nil) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
CGFloat h = self.barView.height + self.categoryView.height + self.marqueeView.height + 6;
_listContainerView.frame = CGRectMake(0, h, SCREEN_WIDTH, SCREEN_HEIGHT - h);
// CGFloat h = self.barView.height + self.categoryView.height + self.marqueeView.height + 6;
// _listContainerView.frame = CGRectMake(0, h, SCREEN_WIDTH, SCREEN_HEIGHT - h);
_listContainerView.scrollView.scrollEnabled = NO;
}
return _listContainerView;
......
......@@ -8,14 +8,13 @@
#import "XVNewJobViewController.h"
#import "XVOrderDetailsViewController.h"
#import "XVJobStatusToolView.h"
#import "XVNewJobViewCell.h"
@interface XVNewJobViewController ()<UITextFieldDelegate>
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@property (nonatomic, strong) UITableView *tableView;
......@@ -41,19 +40,11 @@
- (void)setupUI {
[self.view addSubview:self.toolView];
[self.toolView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(61 + KiPhoneXSafeAreaDValue);
}];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view);
make.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-61);
make.bottom.mas_equalTo(self.view);
}];
}
......@@ -82,13 +73,6 @@
}
- (XVJobStatusToolView *)toolView {
if(_toolView == nil) {
_toolView = [[XVJobStatusToolView alloc]init];
_toolView.backgroundColor = [UIColor colorWithHexString:@"#EEEEEE"];
}
return _toolView;
}
- (UITableView *)tableView {
if (_tableView == nil) {
......
......@@ -9,8 +9,12 @@
#import "XVOrderDetailsViewController.h"
#import "XVOrderInfoViewController.h"
@interface XVOrderDetailsViewController ()<UIGestureRecognizerDelegate>
@property (nonatomic, strong) XVOrderInfoViewController *infoVc;
@property (nonatomic, assign) CGPoint containerOrigin;
@property (nonatomic, assign) NSInteger lastPos;
......@@ -22,6 +26,8 @@
[super viewDidLoad];
self.view.backgroundColor = [UIColor greenColor];
[self setupUI];
}
......@@ -57,7 +63,7 @@
}else{
view.top += offset.y;
}
Log(@"%f===%ld",view.top,(long)pan.state);
DebugLog(@"%f===%ld",view.top,(long)pan.state);
if(pan.state == UIGestureRecognizerStateEnded) {
......
......@@ -44,7 +44,7 @@
.LeeShow();
}
- (void)dealloc {
Log(@"XVNewOrderAlter dealloc");
DebugLog(@"XVNewOrderAlter dealloc");
// if (_mapView) {
// _mapView.delegate = nil;
// _mapView = nil;
......
//
// Notification.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
/**
* 网络断开
*/
static NSString * const kAFNNotReachable = @"kAFNNotReachable" ;
/**
* 网络重新加载数据
*/
static NSString * const kAFNReloadData = @"kAFNReloadData" ;
/**
* 服务器异常通知
*/
static NSString * const kAppServerError = @"kAppServerError";
/**
* 服务器慢通知
*/
static NSString * const kAppServerLow = @"kAppServerLow";
//
// XVHealthCardTypeViewController.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTypeViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTypeViewController.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTypeViewController.h"
#import "XVHealthCardTypeView.h"
#import "XVUploadHealthCardViewController.h"
@interface XVHealthCardTypeViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) XVHealthCardTypeView *type1View;
@property (nonatomic, strong) XVHealthCardTypeView *type2View;
@property (nonatomic, strong) XVHealthCardTypeView *type3View;
@property (nonatomic, strong) XVHealthCardTypeView *type4View;
@end
@implementation XVHealthCardTypeViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"上传健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.scrollView];
[self.scrollView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.scrollView).mas_offset(14);
make.left.mas_equalTo(self.view).mas_offset(13);
}];
[self.scrollView addSubview:self.type1View];
[self.type1View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(9);
make.right.mas_equalTo(self.view).mas_offset(-9);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(10);
make.height.mas_equalTo(102);
}];
kViewBorderRadius(self.type1View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type2View];
[self.type2View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type1View.mas_bottom).mas_offset(10);
}];
kViewBorderRadius(self.type2View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type3View];
[self.type3View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type2View.mas_bottom).mas_offset(10);
}];
kViewBorderRadius(self.type3View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type4View];
[self.type4View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type3View.mas_bottom).mas_offset(10);
make.bottom.mas_equalTo(self.scrollView).mas_offset(-40);
}];
kViewBorderRadius(self.type4View, 20, 0, [UIColor whiteColor]);
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"请选择健康证类型" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _titleLabel;
}
- (XVHealthCardTypeView *)type1View {
if (_type1View == nil) {
_type1View = [[XVHealthCardTypeView alloc]init];
_type1View.backgroundColor = [UIColor whiteColor];
[_type1View title:@"卡制" subTitle:@"印有个人信息及日期的卡片"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type1View addGestureRecognizer:tap];
}
return _type1View;
}
- (XVHealthCardTypeView *)type2View {
if (_type2View == nil) {
_type2View = [[XVHealthCardTypeView alloc]init];
_type2View.backgroundColor = [UIColor whiteColor];
[_type2View title:@"本制" subTitle:@"含有手写和机打信息、印章的本子"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type2View addGestureRecognizer:tap];
}
return _type2View;
}
- (XVHealthCardTypeView *)type3View {
if (_type3View == nil) {
_type3View = [[XVHealthCardTypeView alloc]init];
_type3View.backgroundColor = [UIColor whiteColor];
[_type3View title:@"纸制" subTitle:@"含有手写和机打信息、印章的纸张"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type3View addGestureRecognizer:tap];
}
return _type3View;
}
- (XVHealthCardTypeView *)type4View {
if (_type4View == nil) {
_type4View = [[XVHealthCardTypeView alloc]init];
_type4View.backgroundColor = [UIColor whiteColor];
[_type4View title:@"电子" subTitle:@"官方渠道下载的含有个人信息及日期的图片"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type4View addGestureRecognizer:tap];
}
return _type4View;
}
@end
//
// XVHealthCardViewController.h
// fastservice
//
// Created by xuning on 4/28/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardViewController.m
// fastservice
//
// Created by xuning on 4/28/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardViewController.h"
#import "XVHealthCardStatusView.h"
#import "XVHealthCardTypeViewController.h"
@interface XVHealthCardViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) XVHealthCardStatusView *statusView;
@property (nonatomic, strong) UIButton *uploadButton;
@end
@implementation XVHealthCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.uploadButton];
[self.uploadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
make.height.mas_equalTo(47);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-7);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-7);
}
}];
kViewBorderRadius(self.uploadButton, 4, 0, COLOR_THEMEGRENN);
[self.view addSubview:self.scrollView];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.uploadButton.mas_top);
}];
[self.scrollView addSubview:self.statusView];
[self.statusView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.scrollView).mas_offset(18);
make.left.mas_equalTo(self.view).mas_offset(9);
make.right.mas_equalTo(self.view).mas_offset(-9);
make.height.mas_equalTo(165*widthScale);
}];
kViewBorderRadius(self.statusView, 20, 0, [UIColor whiteColor]);
}
- (UIButton *)uploadButton {
if (_uploadButton == nil) {
_uploadButton = [[UIButton alloc]initWithTitle:@"上传健康证" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_uploadButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
XVHealthCardTypeViewController *typeVc = [[XVHealthCardTypeViewController alloc]init];
[self.navigationController pushViewController:typeVc animated:YES];
}];
}
return _uploadButton;
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]init];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (XVHealthCardStatusView *)statusView {
if (_statusView == nil) {
_statusView = [[XVHealthCardStatusView alloc]init];
_statusView.backgroundColor = [UIColor whiteColor];
}
return _statusView;
}
@end
......@@ -8,6 +8,7 @@
#import "XVMyViewController.h"
#import "XVMyCertificateView.h"
#import "XVHealthCardViewController.h"
@interface XVMyViewController ()
@property (nonatomic, strong) UIImageView *userImageView;
......@@ -258,6 +259,11 @@
if (_healthView == nil) {
_healthView = [[XVMyCertificateView alloc]init];
[_healthView setNormalImageName:@"群组 2" selectedImgName:@"群组 2" title:@"健康证"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVHealthCardViewController *healthVc = [[XVHealthCardViewController alloc]init];
[self.navigationController pushViewController:healthVc animated:YES];
}];
[_healthView addGestureRecognizer:tap];
}
return _healthView;
}
......
......@@ -132,7 +132,12 @@
make.left.mas_equalTo(self.view).mas_offset(13);
make.right.mas_equalTo(self.view).mas_offset(-13);
make.height.mas_equalTo(44);
make.bottom.mas_equalTo(self.view).mas_offset(-KiPhoneXSafeAreaDValue - 18);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-18);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-18);
}
}];
kViewBorderRadius(self.serviceButton, 4, 0, [UIColor whiteColor]);
......
//
// XVUploadHealthCardViewController.h
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVUploadHealthCardViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVUploadHealthCardViewController.m
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVUploadHealthCardViewController.h"
#import "XVHealthCardTipView.h"
@interface XVUploadHealthCardViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *uploadImageView;
@property (nonatomic, strong) UILabel *subTitleLabel;
@property (nonatomic, strong) UILabel *descLabel;
@property (nonatomic, strong) UIButton *uploadButton;
@property (nonatomic, strong) XVHealthCardTipView *tip1View;
@property (nonatomic, strong) XVHealthCardTipView *tip2View;
@property (nonatomic, strong) XVHealthCardTipView *tip3View;
@property (nonatomic, strong) XVHealthCardTipView *tip4View;
@end
@implementation XVUploadHealthCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"上传健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.uploadButton];
[self.uploadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
make.height.mas_equalTo(47);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-7);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-7);
}
}];
kViewBorderRadius(self.uploadButton, 4, 0, COLOR_THEMEGRENN);
[self.view addSubview:self.scrollView];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.uploadButton.mas_top);
}];
[self.scrollView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(17);
make.top.mas_equalTo(self.scrollView).mas_offset(18);
}];
[self.scrollView addSubview:self.uploadImageView];
[self.uploadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(16);
make.right.mas_equalTo(self.view).mas_offset(-16);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(15);
make.height.mas_equalTo(186*widthScale);
}];
[self.scrollView addSubview:self.subTitleLabel];
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(13);
make.top.mas_equalTo(self.uploadImageView.mas_bottom).mas_offset(14);
}];
[self.scrollView addSubview:self.descLabel];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(16);
make.top.mas_equalTo(self.subTitleLabel.mas_bottom).mas_offset(14);
}];
CGFloat w = (SCREEN_WIDTH - 15*5) / 4;
[self.scrollView addSubview:self.tip1View];
[self.tip1View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.view).mas_offset(15);
}];
[self.scrollView addSubview:self.tip2View];
[self.tip2View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip1View.mas_right).mas_offset(15);
}];
[self.scrollView addSubview:self.tip3View];
[self.tip3View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip2View.mas_right).mas_offset(15);
}];
[self.scrollView addSubview:self.tip4View];
[self.tip4View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip3View.mas_right).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
}];
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"请拍摄您的健康证" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _titleLabel;
}
- (UIImageView *)uploadImageView {
if (_uploadImageView == nil) {
_uploadImageView = [[UIImageView alloc]initWithImageName:@"jk群组 1"];
UIImageView *icon = [[UIImageView alloc]initWithImageName:@"riFill-camera-fill 1"];
[_uploadImageView addSubview:icon];
[icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(_uploadImageView);
make.size.mas_equalTo(CGSizeMake(38, 38));
}];
}
return _uploadImageView;
}
- (UILabel *)subTitleLabel {
if (_subTitleLabel == nil) {
_subTitleLabel = [[UILabel alloc]initWithText:@"拍摄要求" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _subTitleLabel;
}
- (UILabel *)descLabel {
if (_descLabel == nil) {
_descLabel = [[UILabel alloc]init];
UIFont *font = [UIFont systemFontOfSize:12];
NSMutableAttributedString *text = [NSMutableAttributedString new];
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.lineSpacing = 10;
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"请拍摄本人证件原件,不得使用复印件或他人证件" attributes:@{NSFontAttributeName : font,NSForegroundColorAttributeName:F_101010_COLOR,NSParagraphStyleAttributeName:paragraphStyle}]];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n" attributes:nil]];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"拍摄时确保证件边框完整、字体清晰" attributes:@{NSFontAttributeName : font,NSForegroundColorAttributeName:F_101010_COLOR}]];
_descLabel.numberOfLines = 2;
_descLabel.attributedText = text;
}
return _descLabel;
}
- (UIButton *)uploadButton {
if (_uploadButton == nil) {
_uploadButton = [[UIButton alloc]initWithTitle:@"上传健康证" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_uploadButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
}];
}
return _uploadButton;
}
- (XVHealthCardTipView *)tip1View {
if (_tip1View == nil) {
_tip1View = [[XVHealthCardTipView alloc]init];
[_tip1View title:@" 边框缺失" imageName:nil];
}
return _tip1View;
}
- (XVHealthCardTipView *)tip2View {
if (_tip2View == nil) {
_tip2View = [[XVHealthCardTipView alloc]init];
[_tip2View title:@" 照片模糊" imageName:nil];
}
return _tip2View;
}
- (XVHealthCardTipView *)tip3View {
if (_tip3View == nil) {
_tip3View = [[XVHealthCardTipView alloc]init];
[_tip3View title:@" 信息遮挡" imageName:nil];
}
return _tip3View;
}
- (XVHealthCardTipView *)tip4View {
if (_tip4View == nil) {
_tip4View = [[XVHealthCardTipView alloc]init];
[_tip4View title:@" 拍复印件" imageName:nil];
}
return _tip4View;
}
@end
//
// XVHealthCardStatusView.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardStatusView : UIView
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardStatusView.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardStatusView.h"
@interface XVHealthCardStatusView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *rightImageView;
@property (nonatomic, strong) UIImageView *healthImageView;
@property (nonatomic, strong) UIImageView *statusImageView;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UIButton *submitButton;
@end
@implementation XVHealthCardStatusView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).mas_offset(30);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.rightImageView];
[self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(5);
}];
[self addSubview:self.healthImageView];
[self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(53, 53));
make.right.mas_equalTo(self).mas_offset(-26);
}];
[self addSubview:self.statusImageView];
[self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).mas_offset(16);
make.bottom.mas_equalTo(self).mas_offset(-16);
make.size.mas_equalTo(CGSizeMake(65, 27));
}];
[self addSubview:self.submitButton];
[self.submitButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(80, 30));
make.right.mas_equalTo(self).mas_offset(-26);
make.centerY.mas_equalTo(self.statusImageView);
}];
kViewBorderRadius(self.submitButton, 4, 0, [UIColor whiteColor]);
[self addSubview:self.dateLabel];
[self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.statusImageView);
make.left.mas_equalTo(self.statusImageView.mas_right).mas_offset(9);
make.height.mas_equalTo(27);
make.right.mas_equalTo(self.submitButton.mas_left).mas_offset(-25);
}];
kViewBorderRadius(self.dateLabel, 10, 0, [UIColor whiteColor]);
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"暂无证件" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
}
return _titleLabel;
}
- (UIImageView *)rightImageView {
if (_rightImageView == nil) {
_rightImageView = [[UIImageView alloc]initWithImageName:@"arcoDesign-right 1"];
}
return _rightImageView;
}
- (UIImageView *)statusImageView {
if (_statusImageView == nil) {
_statusImageView = [[UIImageView alloc]initWithImageName:@"图标 3"];
}
return _statusImageView;
}
- (UIImageView *)healthImageView {
if (_healthImageView == nil) {
_healthImageView = [[UIImageView alloc]initWithImageName:@"图标 1"];
}
return _healthImageView;
}
- (UILabel *)dateLabel {
if (_dateLabel == nil) {
_dateLabel = [[UILabel alloc]initWithText:@"" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
}
return _dateLabel;
}
- (UIButton *)submitButton {
if (_submitButton == nil) {
_submitButton = [[UIButton alloc]initWithTitle:@"重新提交" fontSize:14 titleColor:[UIColor whiteColor] bgColor:kHexRGB(0xA4ADB3)];
}
return _submitButton;
}
@end
//
// XVHealthCardTipView.h
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTipView : UIView
- (void)title:(NSString *)title imageName:(NSString *)imageName;
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTipView.m
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTipView.h"
@interface XVHealthCardTipView()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) YYLabel *label;
@end
@implementation XVHealthCardTipView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)title:(NSString *)title imageName:(NSString *)imageName {
NSMutableAttributedString *text = [NSMutableAttributedString new];
UIFont *font = [UIFont systemFontOfSize:12];
UIColor *color = [UIColor colorWithHexString:@"#737272"];
// UIView attachment
UIImageView *imageView = [[UIImageView alloc]initWithImageName:@"if-close-circled 1"];
imageView.size = CGSizeMake(17, 17);
NSMutableAttributedString *attachment = [NSMutableAttributedString attachmentStringWithContent:imageView contentMode:UIViewContentModeBottom attachmentSize:imageView.size alignToFont:font alignment:YYTextVerticalAlignmentCenter];
[text appendAttributedString: attachment];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:title];
str.font = font;
str.color = color;
[text appendAttributedString:str];
_label.attributedText = text;
_label.textAlignment = NSTextAlignmentCenter;
}
- (void)setupUI {
[self addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(53);
}];
kViewBorderRadius(self.imageView, 6, 0, [UIColor whiteColor]);
[self addSubview:self.label];
[self.label mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self);
make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(5);
}];
}
- (UIImageView *)imageView {
if (_imageView == nil) {
_imageView = [[UIImageView alloc]init];
_imageView.backgroundColor = [UIColor whiteColor];
}
return _imageView;
}
- (YYLabel *)label {
if (_label == nil) {
_label = [[YYLabel alloc]init];
NSMutableAttributedString *text = [NSMutableAttributedString new];
UIFont *font = [UIFont systemFontOfSize:12];
UIColor *color = [UIColor colorWithHexString:@"#737272"];
// UIView attachment
UIImageView *imageView = [[UIImageView alloc]initWithImageName:@"if-close-circled 1"];
imageView.size = CGSizeMake(17, 17);
NSMutableAttributedString *attachment = [NSMutableAttributedString attachmentStringWithContent:imageView contentMode:UIViewContentModeBottom attachmentSize:imageView.size alignToFont:font alignment:YYTextVerticalAlignmentCenter];
[text appendAttributedString: attachment];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@" 边框缺失"];
str.font = font;
str.color = color;
[text appendAttributedString:str];
_label.attributedText = text;
_label.textAlignment = NSTextAlignmentCenter;
}
return _label;
}
@end
//
// XVHealthCardTypeView.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTypeView : UIView
- (void)title:(NSString *)title subTitle:(NSString *)subTitle;
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTypeView.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTypeView.h"
@interface XVHealthCardTypeView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *subTitleLabel;
@property (nonatomic, strong) UIImageView *healthImageView;
@end
@implementation XVHealthCardTypeView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.userInteractionEnabled = YES;
[self setupUI];
}
return self;
}
- (void)title:(NSString *)title subTitle:(NSString *)subTitle {
self.titleLabel.text = title;
self.subTitleLabel.text = subTitle;
}
- (void)setupUI {
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).mas_offset(22);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.subTitleLabel];
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self).mas_offset(-15);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.healthImageView];
[self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(53, 53));
make.right.mas_equalTo(self).mas_offset(-26);
}];
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
}
return _titleLabel;
}
- (UILabel *)subTitleLabel {
if (_subTitleLabel == nil) {
_subTitleLabel = [[UILabel alloc]initWithText:@"副标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:14];
}
return _subTitleLabel;
}
- (UIImageView *)healthImageView {
if (_healthImageView == nil) {
_healthImageView = [[UIImageView alloc]initWithImageName:@"图标 1"];
}
return _healthImageView;
}
@end
......@@ -36,6 +36,8 @@
- (void)setupUI {
self.userInteractionEnabled = YES;
[self addSubview:self.button];
[self.button mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
......@@ -69,6 +71,7 @@
[_button setTitleColor:kHexRGB(0xF78606) forState:UIControlStateNormal];
[_button setTitleColor:kHexRGB(0x00BE70) forState:UIControlStateSelected];
_button.titleLabel.font = [UIFont systemFontOfSize:10];
_button.userInteractionEnabled = NO;
}
return _button;
}
......
......@@ -9,6 +9,7 @@
#define PrefixHeader_pch
#ifdef __OBJC__
#import <YYKit.h>
#import "MJExtension.h"
#import "UIImageView+WebCache.h"
......@@ -32,141 +33,20 @@
//#import<BaiduMapAPI_Utils/BMKUtilsComponent.h>
//#import <BaiduMapAPI_WalkNavi/BMKWalkNaviComponent.h>
//#import <BaiduNaviKit-All/BNaviService.h>
#import "Header.h"
#import "AppDelegate.h"
#import "UIScrollView+XVAdd.h"
#import "UIView+XVAdd.h"
#import "NSString+XVAdd.h"
#import "NSString+Extention.h"
#import "MBProgressHUD+Extention.h"
#import "NSMutableDictionary+Extention.h"
#import "Notification.h"
#import "Constants.h"
#import "AppConfig.h"
#import "TestClient.h"
#import "XVAlertTools.h"
#import "AppTools.h"
#endif
// 百度地图
#define BAIDU_APPKEY @"9fzRTgXAOSma0WLs5ko09vSuw4I6L7Oz"
#ifdef DEBUG
#define Log(FORMAT, ...) fprintf(stderr,"[%s:%d行] %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define Log(...)
#endif
#define IMG(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
#define S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
#define RGBAColor(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define kHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kRandomColor RGBAColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256),1)
#define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"]
#define BLUE_COLOR [UIColor colorWithHexString:@"#4290E5"]
#define YELLOW_COLOR [UIColor colorWithHexString:@"#edb10f"]
#define PURPLE_COLOR [UIColor colorWithHexString:@"#9E5BCA"]
#define RED_COLOR [UIColor colorWithHexString:@"#f25555"]
#define F_3D3B4F_COLOR [UIColor colorWithHexString:@"#3D3B4F"]
#define F_415058_COLOR [UIColor colorWithHexString:@"#415058"]
#define F_707070_COLOR [UIColor colorWithHexString:@"#707070"]
#define F_8A8A8A_COLOR [UIColor colorWithHexString:@"#8a8a8a"]
#define F_BCBCBC_COLOR [UIColor colorWithHexString:@"#bcbcbc"]
#define F_CFCFCF_COLOR [UIColor colorWithHexString:@"#cfcfcf"]
#define F_7D7D7d_COLOR [UIColor colorWithHexString:@"#7D7D7D"]
#define F_9B9B9B_COLOR [UIColor colorWithHexString:@"#9B9B9B"]
#define F_666666_COLOR [UIColor colorWithHexString:@"#666666"]
#define F_606060_COLOR [UIColor colorWithHexString:@"#606060"]
#define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define F_101010_COLOR [UIColor colorWithHexString:@"#101010"]
#define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
#define FA_3_COLOR [UIColor colorWithHexString:@"#fafafa"]
#define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf7f7f7)
#define kViewBorderRadius(View, Radius, Width, Color)\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]];
#define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f)
#define heightScale ([UIScreen mainScreen].bounds.size.height/844.0f)
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//状态栏高度
#define KSTATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
//导航条高度
#define KNAVBAR_HEIGHT 44.0
//底部tabbar高度
#define KTABBAR_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
//整个顶部的高度
#define KTOP_HEIGHT (KSTATUSBAR_HEIGHT + KNAVBAR_HEIGHT)
//app 版本
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define APP_BUILD [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
#define IS_IPHONEX ({\
BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.bottom > 0.0) {\
isPhoneX = YES;\
}\
}\
isPhoneX;\
})
//iphoneX适配差值
#define KiPhoneXSafeAreaDValue ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)
#define kObjectIsEmpty(_object) (_object == nil \
|| [_object isKindOfClass:[NSNull class]] \
|| ([_object respondsToSelector:@selector(length)] && [(NSData *)_object length] == 0) \
|| ([_object respondsToSelector:@selector(count)] && [(NSArray *)_object count] == 0))
// 字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
// 数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
typedef void(^EventHandler)(id sender);
typedef void(^EventVoidHandler)(void);
typedef void(^EventTwoHandler)(id sender,id sender1);
typedef void(^EventThreeHandler)(id sender,id sender1,id sender2);
typedef void(^RightActionBlock)(id sender,id sender1);
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithVoidArg(block) if(block){block();}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithOneArg(block,arg) if(block){block(arg);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithTwoArg(block,arg1,arg2) if(block){block(arg1,arg2);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithThreeArg(block,arg1,arg2,arg3) if(block){block(arg1,arg2,arg3);}
#endif /* PrefixHeader_pch */
......@@ -37,6 +37,9 @@ target 'fastservice' do
# pod 'BMKLocationKit'
# pod 'BaiduNaviKit-All', '6.4.0' # 集成地图Map包
pod 'CWLateralSlide', '~> 1.6.3'
pod 'HWPanModal', '~> 0.9.9'
# pod 'FloatingPanel'
end
......@@ -30,6 +30,7 @@ PODS:
- Bugly (2.5.93)
- CWLateralSlide (1.6.5)
- DZNEmptyDataSet (1.8.1)
- HWPanModal (0.9.9)
- IQKeyboardManager (6.5.11)
- JXCategoryView (1.6.1)
- LEEAlert (1.6.4)
......@@ -55,6 +56,7 @@ DEPENDENCIES:
- Bugly
- CWLateralSlide (~> 1.6.3)
- DZNEmptyDataSet
- HWPanModal (~> 0.9.9)
- IQKeyboardManager
- JXCategoryView
- LEEAlert
......@@ -76,6 +78,7 @@ SPEC REPOS:
- Bugly
- CWLateralSlide
- DZNEmptyDataSet
- HWPanModal
- IQKeyboardManager
- JXCategoryView
- LEEAlert
......@@ -96,6 +99,7 @@ SPEC CHECKSUMS:
Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da
CWLateralSlide: 8939c8dea91a24e40d0793553118cb57cd67f64b
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
HWPanModal: b57a6717d3cdcd666bff44f9dd2a5be9f4d6f5d2
IQKeyboardManager: ef43ce1ba1e5aaf4adf222c0a46f39761f246879
JXCategoryView: 7b1ee69ede4843c581688afe84d0f047723262f2
LEEAlert: a604ad481e3e9b021421a271f78594926dd034bb
......@@ -109,6 +113,6 @@ SPEC CHECKSUMS:
TXScrollLabelView: 0e1650caf61198bf5dc0938ea6493254aeb80f90
YYKit: 7cda43304a8dc3696c449041e2cb3107b4e236e7
PODFILE CHECKSUM: c7adb24e1766e2a88ca10141694f2ba79f8557d6
PODFILE CHECKSUM: 9b2eae658cd096a7fea42e04e882b217100d7c13
COCOAPODS: 1.11.3
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