Commit 05ba2383 by xuning

跑马灯接口、用户信息接口(包含缓存用户信息等操作)、banner接口(包分站id逻辑)

parent 2b1d4f08
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
792327182DCCE8BA00F4205D /* GlobalNetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 792327172DCCE8BA00F4205D /* GlobalNetManager.m */; };
792327262DCCFA4D00F4205D /* LocalCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 792327222DCCFA4D00F4205D /* LocalCache.m */; };
792327272DCCFA4D00F4205D /* UserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 792327242DCCFA4D00F4205D /* UserInfo.m */; };
7923272D2DCCFADE00F4205D /* GroupList.m in Sources */ = {isa = PBXBuildFile; fileRef = 7923272C2DCCFADE00F4205D /* GroupList.m */; };
792327312DCCFC9300F4205D /* HomeBannerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 792327302DCCFC9300F4205D /* HomeBannerModel.m */; };
79267A9C2DBA8E0F000D2180 /* WMDragView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267A9A2DBA8E0F000D2180 /* WMDragView.m */; }; 79267A9C2DBA8E0F000D2180 /* WMDragView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267A9A2DBA8E0F000D2180 /* WMDragView.m */; };
79267AA02DBBCEE2000D2180 /* XVOrderSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267A9F2DBBCEE2000D2180 /* XVOrderSearchView.m */; }; 79267AA02DBBCEE2000D2180 /* XVOrderSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267A9F2DBBCEE2000D2180 /* XVOrderSearchView.m */; };
79267AA32DBD1BFF000D2180 /* XVPersonalHeaderItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AA22DBD1BFF000D2180 /* XVPersonalHeaderItemView.m */; }; 79267AA32DBD1BFF000D2180 /* XVPersonalHeaderItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AA22DBD1BFF000D2180 /* XVPersonalHeaderItemView.m */; };
...@@ -24,8 +29,6 @@ ...@@ -24,8 +29,6 @@
79267ACF2DC8A511000D2180 /* AFNetworkingClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ACE2DC8A511000D2180 /* AFNetworkingClient.m */; }; 79267ACF2DC8A511000D2180 /* AFNetworkingClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267ACE2DC8A511000D2180 /* AFNetworkingClient.m */; };
79267AD82DC8AC25000D2180 /* AppConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AD72DC8AC25000D2180 /* AppConfig.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 */; }; 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 */; }; 79267AE62DC8BE15000D2180 /* TestClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AE52DC8BE15000D2180 /* TestClient.m */; };
79267AF22DC8C3C3000D2180 /* MBProgressHUD+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AF12DC8C3C3000D2180 /* MBProgressHUD+Extention.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 */; }; 79267AF52DC8C948000D2180 /* NSMutableDictionary+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = 79267AF42DC8C948000D2180 /* NSMutableDictionary+Extention.m */; };
...@@ -82,6 +85,11 @@ ...@@ -82,6 +85,11 @@
79DC8B962B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B952B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m */; }; 79DC8B962B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B952B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m */; };
79DC8B992B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B982B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m */; }; 79DC8B992B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B982B8DB07A00DBD8EA /* XVGetOrderAlterSliderView.m */; };
79DC8B9D2B90813F00DBD8EA /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B9C2B90813E00DBD8EA /* AppDelegate+ThirdParty.m */; }; 79DC8B9D2B90813F00DBD8EA /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B9C2B90813E00DBD8EA /* AppDelegate+ThirdParty.m */; };
79F57E632DCA48190035ADE8 /* XVWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F57E622DCA48180035ADE8 /* XVWebViewController.m */; };
79F57E692DCA4F040035ADE8 /* CustomMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F57E652DCA4F040035ADE8 /* CustomMethod.m */; };
79F57E6A2DCA4F040035ADE8 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F57E672DCA4F040035ADE8 /* RegexKitLite.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
79F57E6D2DCA50B60035ADE8 /* MyNetWork.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F57E6C2DCA50B60035ADE8 /* MyNetWork.m */; };
79F57E6F2DCA54B40035ADE8 /* libicucore.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 79F57E6E2DCA54840035ADE8 /* libicucore.tbd */; };
FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; }; FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -89,6 +97,16 @@ ...@@ -89,6 +97,16 @@
08D109EE60B32403F3655A70 /* Pods_fastservice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fastservice.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_fastservice.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0A560A1F356C4AB4EE319B53 /* Pods-fastservice.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.debug.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.debug.xcconfig"; sourceTree = "<group>"; }; 0A560A1F356C4AB4EE319B53 /* Pods-fastservice.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.debug.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.debug.xcconfig"; sourceTree = "<group>"; };
6102ECAEC07A0BE24F1B6143 /* Pods-fastservice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.release.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.release.xcconfig"; sourceTree = "<group>"; }; 6102ECAEC07A0BE24F1B6143 /* Pods-fastservice.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fastservice.release.xcconfig"; path = "Target Support Files/Pods-fastservice/Pods-fastservice.release.xcconfig"; sourceTree = "<group>"; };
792327162DCCE8BA00F4205D /* GlobalNetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalNetManager.h; sourceTree = "<group>"; };
792327172DCCE8BA00F4205D /* GlobalNetManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GlobalNetManager.m; sourceTree = "<group>"; };
792327212DCCFA4D00F4205D /* LocalCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalCache.h; sourceTree = "<group>"; };
792327222DCCFA4D00F4205D /* LocalCache.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalCache.m; sourceTree = "<group>"; };
792327232DCCFA4D00F4205D /* UserInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfo.h; sourceTree = "<group>"; };
792327242DCCFA4D00F4205D /* UserInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserInfo.m; sourceTree = "<group>"; };
7923272B2DCCFADE00F4205D /* GroupList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GroupList.h; sourceTree = "<group>"; };
7923272C2DCCFADE00F4205D /* GroupList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GroupList.m; sourceTree = "<group>"; };
7923272F2DCCFC9300F4205D /* HomeBannerModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeBannerModel.h; sourceTree = "<group>"; };
792327302DCCFC9300F4205D /* HomeBannerModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeBannerModel.m; sourceTree = "<group>"; };
79267A992DBA8E0F000D2180 /* WMDragView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMDragView.h; sourceTree = "<group>"; }; 79267A992DBA8E0F000D2180 /* WMDragView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMDragView.h; sourceTree = "<group>"; };
79267A9A2DBA8E0F000D2180 /* WMDragView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WMDragView.m; sourceTree = "<group>"; }; 79267A9A2DBA8E0F000D2180 /* WMDragView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WMDragView.m; sourceTree = "<group>"; };
79267A9E2DBBCEE2000D2180 /* XVOrderSearchView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSearchView.h; sourceTree = "<group>"; }; 79267A9E2DBBCEE2000D2180 /* XVOrderSearchView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSearchView.h; sourceTree = "<group>"; };
...@@ -125,10 +143,6 @@ ...@@ -125,10 +143,6 @@
79267AD92DC8ACE9000D2180 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constants.h; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 79267AF02DC8C3C3000D2180 /* MBProgressHUD+Extention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD+Extention.h"; sourceTree = "<group>"; };
...@@ -266,6 +280,15 @@ ...@@ -266,6 +280,15 @@
79DC8B9B2B90813E00DBD8EA /* AppDelegate+ThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdParty.h"; 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>"; }; 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>"; }; 79F57E602DC8E7980035ADE8 /* Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = "<group>"; };
79F57E612DCA48180035ADE8 /* XVWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVWebViewController.h; sourceTree = "<group>"; };
79F57E622DCA48180035ADE8 /* XVWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVWebViewController.m; sourceTree = "<group>"; };
79F57E642DCA4F040035ADE8 /* CustomMethod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomMethod.h; sourceTree = "<group>"; };
79F57E652DCA4F040035ADE8 /* CustomMethod.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomMethod.m; sourceTree = "<group>"; };
79F57E662DCA4F040035ADE8 /* RegexKitLite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = "<group>"; };
79F57E672DCA4F040035ADE8 /* RegexKitLite.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = "<group>"; };
79F57E6B2DCA50B60035ADE8 /* MyNetWork.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyNetWork.h; sourceTree = "<group>"; };
79F57E6C2DCA50B60035ADE8 /* MyNetWork.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyNetWork.m; sourceTree = "<group>"; };
79F57E6E2DCA54840035ADE8 /* libicucore.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libicucore.tbd; path = usr/lib/libicucore.tbd; sourceTree = SDKROOT; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -274,6 +297,7 @@ ...@@ -274,6 +297,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
798136592DB7ADC1004BC05B /* QuartzCore.framework in Frameworks */, 798136592DB7ADC1004BC05B /* QuartzCore.framework in Frameworks */,
79F57E6F2DCA54B40035ADE8 /* libicucore.tbd in Frameworks */,
798136602DB7ADF9004BC05B /* Accelerate.framework in Frameworks */, 798136602DB7ADF9004BC05B /* Accelerate.framework in Frameworks */,
FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */, FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */,
7981365B2DB7ADC7004BC05B /* Security.framework in Frameworks */, 7981365B2DB7ADC7004BC05B /* Security.framework in Frameworks */,
...@@ -297,6 +321,28 @@ ...@@ -297,6 +321,28 @@
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
792327252DCCFA4D00F4205D /* Model */ = {
isa = PBXGroup;
children = (
792327212DCCFA4D00F4205D /* LocalCache.h */,
792327222DCCFA4D00F4205D /* LocalCache.m */,
792327232DCCFA4D00F4205D /* UserInfo.h */,
792327242DCCFA4D00F4205D /* UserInfo.m */,
7923272B2DCCFADE00F4205D /* GroupList.h */,
7923272C2DCCFADE00F4205D /* GroupList.m */,
);
path = Model;
sourceTree = "<group>";
};
7923272E2DCCFC7F00F4205D /* Model */ = {
isa = PBXGroup;
children = (
7923272F2DCCFC9300F4205D /* HomeBannerModel.h */,
792327302DCCFC9300F4205D /* HomeBannerModel.m */,
);
path = Model;
sourceTree = "<group>";
};
79267A9B2DBA8E0F000D2180 /* WMDragView */ = { 79267A9B2DBA8E0F000D2180 /* WMDragView */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -319,21 +365,14 @@ ...@@ -319,21 +365,14 @@
79267AF72DC8CD65000D2180 /* XVAlertTools.m */, 79267AF72DC8CD65000D2180 /* XVAlertTools.m */,
79267AFC2DC8E1EC000D2180 /* AppTools.h */, 79267AFC2DC8E1EC000D2180 /* AppTools.h */,
79267AFD2DC8E1EC000D2180 /* AppTools.m */, 79267AFD2DC8E1EC000D2180 /* AppTools.m */,
79F57E6B2DCA50B60035ADE8 /* MyNetWork.h */,
79F57E6C2DCA50B60035ADE8 /* MyNetWork.m */,
792327162DCCE8BA00F4205D /* GlobalNetManager.h */,
792327172DCCE8BA00F4205D /* GlobalNetManager.m */,
); );
path = Client; path = Client;
sourceTree = "<group>"; 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 */ = { 79267AEF2DC8C03A000D2180 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -471,6 +510,7 @@ ...@@ -471,6 +510,7 @@
7981EB002B72739300F357E7 /* Personal */ = { 7981EB002B72739300F357E7 /* Personal */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7923272E2DCCFC7F00F4205D /* Model */,
7981EB052B73BB0D00F357E7 /* View */, 7981EB052B73BB0D00F357E7 /* View */,
7981EB012B72739D00F357E7 /* Controller */, 7981EB012B72739D00F357E7 /* Controller */,
); );
...@@ -607,6 +647,7 @@ ...@@ -607,6 +647,7 @@
799DF0E22B6BDA1300680907 /* Libs */ = { 799DF0E22B6BDA1300680907 /* Libs */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
79F57E682DCA4F040035ADE8 /* RegexKitLite */,
79267A9B2DBA8E0F000D2180 /* WMDragView */, 79267A9B2DBA8E0F000D2180 /* WMDragView */,
799DF1082B6D25B400680907 /* UINavigation+SXFixSpace */, 799DF1082B6D25B400680907 /* UINavigation+SXFixSpace */,
799DF0E32B6BDA1300680907 /* NSString+Unicode */, 799DF0E32B6BDA1300680907 /* NSString+Unicode */,
...@@ -638,8 +679,8 @@ ...@@ -638,8 +679,8 @@
799DF0F12B6BDA1400680907 /* Base */ = { 799DF0F12B6BDA1400680907 /* Base */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
792327252DCCFA4D00F4205D /* Model */,
79267AEF2DC8C03A000D2180 /* View */, 79267AEF2DC8C03A000D2180 /* View */,
79267AD12DC8A726000D2180 /* Model */,
799DF0F22B6BDA1400680907 /* Controller */, 799DF0F22B6BDA1400680907 /* Controller */,
); );
path = Base; path = Base;
...@@ -652,6 +693,8 @@ ...@@ -652,6 +693,8 @@
799DF1032B6D220300680907 /* XVBaseViewController.m */, 799DF1032B6D220300680907 /* XVBaseViewController.m */,
799DF1052B6D224000680907 /* XVNaviViewController.h */, 799DF1052B6D224000680907 /* XVNaviViewController.h */,
799DF1062B6D224000680907 /* XVNaviViewController.m */, 799DF1062B6D224000680907 /* XVNaviViewController.m */,
79F57E612DCA48180035ADE8 /* XVWebViewController.h */,
79F57E622DCA48180035ADE8 /* XVWebViewController.m */,
); );
path = Controller; path = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -706,9 +749,21 @@ ...@@ -706,9 +749,21 @@
path = OrderAlter; path = OrderAlter;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
79F57E682DCA4F040035ADE8 /* RegexKitLite */ = {
isa = PBXGroup;
children = (
79F57E642DCA4F040035ADE8 /* CustomMethod.h */,
79F57E652DCA4F040035ADE8 /* CustomMethod.m */,
79F57E662DCA4F040035ADE8 /* RegexKitLite.h */,
79F57E672DCA4F040035ADE8 /* RegexKitLite.m */,
);
path = RegexKitLite;
sourceTree = "<group>";
};
C642CCEC71A6009B069B11C8 /* Frameworks */ = { C642CCEC71A6009B069B11C8 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
79F57E6E2DCA54840035ADE8 /* libicucore.tbd */,
798136612DB7AE03004BC05B /* AVFAudio.framework */, 798136612DB7AE03004BC05B /* AVFAudio.framework */,
7981365F2DB7ADF9004BC05B /* Accelerate.framework */, 7981365F2DB7ADF9004BC05B /* Accelerate.framework */,
7981365E2DB7ADE6004BC05B /* libz.tbd */, 7981365E2DB7ADE6004BC05B /* libz.tbd */,
...@@ -851,6 +906,7 @@ ...@@ -851,6 +906,7 @@
79267AA62DBE5720000D2180 /* XVSettingViewController.m in Sources */, 79267AA62DBE5720000D2180 /* XVSettingViewController.m in Sources */,
79267AFE2DC8E1EC000D2180 /* AppTools.m in Sources */, 79267AFE2DC8E1EC000D2180 /* AppTools.m in Sources */,
79DC8B752B74B69600DBD8EA /* XVOrderDetailsViewController.m in Sources */, 79DC8B752B74B69600DBD8EA /* XVOrderDetailsViewController.m in Sources */,
79F57E6D2DCA50B60035ADE8 /* MyNetWork.m in Sources */,
79DC8B962B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m in Sources */, 79DC8B962B8DB05900DBD8EA /* XVGetOrderAlterButtonView.m in Sources */,
79DC8B872B8CD5F000DBD8EA /* XVOrderSettingView.m in Sources */, 79DC8B872B8CD5F000DBD8EA /* XVOrderSettingView.m in Sources */,
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */, 7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */,
...@@ -858,8 +914,10 @@ ...@@ -858,8 +914,10 @@
79267ADD2DC8AEEA000D2180 /* NSString+Extention.m in Sources */, 79267ADD2DC8AEEA000D2180 /* NSString+Extention.m in Sources */,
7981EACF2B6F63CF00F357E7 /* XVMainJobViewController.m in Sources */, 7981EACF2B6F63CF00F357E7 /* XVMainJobViewController.m in Sources */,
79267AC52DC77509000D2180 /* XVUploadHealthCardViewController.m in Sources */, 79267AC52DC77509000D2180 /* XVUploadHealthCardViewController.m in Sources */,
792327312DCCFC9300F4205D /* HomeBannerModel.m in Sources */,
799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */, 799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */,
79DC8B8A2B8D818000DBD8EA /* XVVerticalButton.m in Sources */, 79DC8B8A2B8D818000DBD8EA /* XVVerticalButton.m in Sources */,
792327182DCCE8BA00F4205D /* GlobalNetManager.m in Sources */,
79267ABE2DC11880000D2180 /* XVHealthCardTypeViewController.m in Sources */, 79267ABE2DC11880000D2180 /* XVHealthCardTypeViewController.m in Sources */,
79267AAF2DBFC7AF000D2180 /* XVMyViewController.m in Sources */, 79267AAF2DBFC7AF000D2180 /* XVMyViewController.m in Sources */,
799DF0C62B6BD8AF00680907 /* AppDelegate.mm in Sources */, 799DF0C62B6BD8AF00680907 /* AppDelegate.mm in Sources */,
...@@ -876,7 +934,6 @@ ...@@ -876,7 +934,6 @@
79267AF52DC8C948000D2180 /* NSMutableDictionary+Extention.m in Sources */, 79267AF52DC8C948000D2180 /* NSMutableDictionary+Extention.m in Sources */,
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */, 799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */, 79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */,
79267AE02DC8B8DC000D2180 /* UserInfo.m in Sources */,
79DC8B722B74B3EC00DBD8EA /* XVOrderSettingViewController.m in Sources */, 79DC8B722B74B3EC00DBD8EA /* XVOrderSettingViewController.m in Sources */,
7981EB082B73BB2C00F357E7 /* XVPersonalHeaderView.m in Sources */, 7981EB082B73BB2C00F357E7 /* XVPersonalHeaderView.m in Sources */,
7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */, 7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */,
...@@ -885,6 +942,8 @@ ...@@ -885,6 +942,8 @@
799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */, 799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */,
7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */, 7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */,
79267AA32DBD1BFF000D2180 /* XVPersonalHeaderItemView.m in Sources */, 79267AA32DBD1BFF000D2180 /* XVPersonalHeaderItemView.m in Sources */,
79F57E692DCA4F040035ADE8 /* CustomMethod.m in Sources */,
79F57E6A2DCA4F040035ADE8 /* RegexKitLite.m in Sources */,
7981EAF92B71205A00F357E7 /* XVJobStatusToolView.m in Sources */, 7981EAF92B71205A00F357E7 /* XVJobStatusToolView.m in Sources */,
799DF0D72B6BD8B100680907 /* main.m in Sources */, 799DF0D72B6BD8B100680907 /* main.m in Sources */,
79DC8B902B8DABF900DBD8EA /* XVNewOrderAlter.m in Sources */, 79DC8B902B8DABF900DBD8EA /* XVNewOrderAlter.m in Sources */,
...@@ -896,13 +955,16 @@ ...@@ -896,13 +955,16 @@
7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */, 7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */,
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */, 7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */,
79267ABB2DC0E3FB000D2180 /* XVHealthCardTypeView.m in Sources */, 79267ABB2DC0E3FB000D2180 /* XVHealthCardTypeView.m in Sources */,
79F57E632DCA48190035ADE8 /* XVWebViewController.m in Sources */,
7981EAD92B6FB53E00F357E7 /* XVNewJobViewController.m in Sources */, 7981EAD92B6FB53E00F357E7 /* XVNewJobViewController.m in Sources */,
79267AE62DC8BE15000D2180 /* TestClient.m in Sources */, 79267AE62DC8BE15000D2180 /* TestClient.m in Sources */,
79267AB82DC0E3E9000D2180 /* XVHealthCardStatusView.m in Sources */, 79267AB82DC0E3E9000D2180 /* XVHealthCardStatusView.m in Sources */,
7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */, 7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */,
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */, 799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */,
792327262DCCFA4D00F4205D /* LocalCache.m in Sources */,
7923272D2DCCFADE00F4205D /* GroupList.m in Sources */,
792327272DCCFA4D00F4205D /* UserInfo.m in Sources */,
79267A9C2DBA8E0F000D2180 /* WMDragView.m in Sources */, 79267A9C2DBA8E0F000D2180 /* WMDragView.m in Sources */,
79267AE32DC8B947000D2180 /* LocalCache.m in Sources */,
7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */, 7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */,
79267AB52DBFD464000D2180 /* XVHealthCardViewController.m in Sources */, 79267AB52DBFD464000D2180 /* XVHealthCardViewController.m in Sources */,
79267AD82DC8AC25000D2180 /* AppConfig.m in Sources */, 79267AD82DC8AC25000D2180 /* AppConfig.m in Sources */,
...@@ -1077,7 +1139,7 @@ ...@@ -1077,7 +1139,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/thirdlibs", "$(PROJECT_DIR)/Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/thirdlibs",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice; PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
...@@ -1126,7 +1188,7 @@ ...@@ -1126,7 +1188,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/thirdlibs", "$(PROJECT_DIR)/Pods/BaiduNaviKit-All/BaiduNaviKit-All/MapSDK/thirdlibs",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice; PRODUCT_BUNDLE_IDENTIFIER = com.bendiyun.fastservice;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
......
...@@ -32,11 +32,21 @@ ...@@ -32,11 +32,21 @@
// 设置主窗口,并设置根控制器 // 设置主窗口,并设置根控制器
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
if ([AppConfig needLogin]) {
XVLoginViewController *loginVc = [[XVLoginViewController alloc]init];
XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:loginVc];
self.window.rootViewController = navi;
}else{
XVMainJobViewController *vc = [[XVMainJobViewController alloc]init]; XVMainJobViewController *vc = [[XVMainJobViewController alloc]init];
XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:vc]; XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:vc];
self.window.rootViewController = navi;
}
self.window.rootViewController = navi;
self.window.backgroundColor = [UIColor whiteColor]; self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "newPage@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "newPage@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
...@@ -11,15 +14,32 @@ ...@@ -11,15 +14,32 @@
<objects> <objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> <viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="newPage" translatesAutoresizingMaskIntoConstraints="NO" id="GG5-rm-jEg">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="GG5-rm-jEg" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="5Zt-If-T16"/>
<constraint firstItem="GG5-rm-jEg" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="FJD-BT-8vL"/>
<constraint firstItem="GG5-rm-jEg" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="Lh1-aU-tPx"/>
<constraint firstAttribute="bottom" secondItem="GG5-rm-jEg" secondAttribute="bottom" id="M2v-8x-dI0"/>
</constraints>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="53" y="375"/> <point key="canvasLocation" x="52.671755725190835" y="374.64788732394368"/>
</scene> </scene>
</scenes> </scenes>
<resources>
<image name="newPage" width="166.66667175292969" height="296"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document> </document>
...@@ -23,10 +23,19 @@ ...@@ -23,10 +23,19 @@
[self setNavigationBarsetBackgroundColor:[UIColor whiteColor]]; [self setNavigationBarsetBackgroundColor:[UIColor whiteColor]];
//ctrl + i 格式化
} }
- (void)back {
// 判断两种情况: push 和 present
if ((self.presentedViewController || self.presentingViewController) && self.childViewControllers.count == 1) {
[self dismissViewControllerAnimated:YES completion:nil];
}else{
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color { - (void)setNavigationBarsetBackgroundColor:(UIColor *)color {
......
//
// XVWebViewController.h
// fastservice
//
// Created by xuning on 5/6/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
#import <WebKit/WebKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVWebViewController : XVBaseViewController
@property (nonatomic, strong) WKWebView *wkWebView;
//设置加载进度条
@property (nonatomic,strong) UIProgressView *progressView;
@property (nonatomic, strong) NSString *titleName;
/**
加载纯外部链接网页
@param string URL地址
*/
- (void)loadWebURLSring:(NSString *)string;
@end
NS_ASSUME_NONNULL_END
//
// XVWebViewController.m
// fastservice
//
// Created by xuning on 5/6/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVWebViewController.h"
static void *WkwebBrowserContext = &WkwebBrowserContext;
@interface XVWebViewController ()<WKNavigationDelegate,WKUIDelegate,UINavigationControllerDelegate,UINavigationBarDelegate,WKScriptMessageHandler,UIScrollViewDelegate>
//保存的网址链接
@property (nonatomic, copy) NSString *URLString;
//保存POST请求体
@property (nonatomic, copy) NSString *postData;
@end
@implementation XVWebViewController
- (void)viewDidLoad {
[super viewDidLoad];
//添加到主控制器上
[self.view addSubview:self.wkWebView];
//添加进度条
[self.view addSubview:self.progressView];
self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"iconPark-left 1 Copy 1")];
}
- (void)back {
if ([self.wkWebView canGoBack]) {
[self.wkWebView goBack];
}else{
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)loadWebURLSring:(NSString *)string{
self.URLString = string;
//创建一个NSURLRequest 的对象
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.URLString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10];
//加载网页
[self.wkWebView loadRequest:request];
}
- (void)setTitleName:(NSString *)titleName {
self.navigationItem.title = titleName;
}
#pragma mark ================ WKNavigationDelegate ================
//这个是网页加载完成,导航的变化
-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
/*
主意:这个方法是当网页的内容全部显示(网页内的所有图片必须都正常显示)的时候调用(不是出现的时候就调用),,否则不显示,或则部分显示时这个方法就不调用。
*/
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}
//开始加载
-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
//开始加载的时候,让加载进度条显示
self.progressView.hidden = NO;
}
//内容返回时调用
-(void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{}
//服务器请求跳转的时候调用
-(void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation{}
//服务器开始请求的时候调用
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
decisionHandler(WKNavigationActionPolicyAllow);
}
// 内容加载失败时候调用
-(void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error{
}
//跳转失败的时候调用
-(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error{}
//进度条
-(void)webViewWebContentProcessDidTerminate:(WKWebView *)webView{}
#pragma mark ================ WKUIDelegate ================
// 获取js 里面的提示
-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
completionHandler();
}]];
[self presentViewController:alert animated:YES completion:NULL];
}
// js 信息的交流
-(void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL))completionHandler{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
completionHandler(YES);
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
completionHandler(NO);
}]];
[self presentViewController:alert animated:YES completion:NULL];
}
// 交互。可输入的文本。
-(void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * _Nullable))completionHandler{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"textinput" message:@"JS调用输入框" preferredStyle:UIAlertControllerStyleAlert];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.textColor = [UIColor redColor];
}];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
completionHandler([[alert.textFields lastObject] text]);
}]];
[self presentViewController:alert animated:YES completion:NULL];
}
//KVO监听进度条
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.wkWebView) {
[self.progressView setAlpha:1.0f];
BOOL animated = self.wkWebView.estimatedProgress > self.progressView.progress;
[self.progressView setProgress:self.wkWebView.estimatedProgress animated:animated];
// Once complete, fade out UIProgressView
if(self.wkWebView.estimatedProgress >= 1.0f) {
[UIView animateWithDuration:0.5f delay:0.5f options:UIViewAnimationOptionCurveEaseOut animations:^{
[self.progressView setAlpha:0.0f];
} completion:^(BOOL finished) {
[self.progressView setProgress:0.0f animated:NO];
}];
}
}else if ([keyPath isEqualToString:@"title"]){
// self.title = self.wkWebView.title;
}
else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
#pragma mark ================ WKScriptMessageHandler ================
//拦截执行网页中的JS方法
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
//服务器固定格式写法 window.webkit.messageHandlers.名字.postMessage(内容);
//客户端写法 message.name isEqualToString:@"名字"]
// if ([message.name isEqualToString:@"getToken"]) {
//
// NSString *inputValueJs = [NSString stringWithFormat:@"requestToken('%@')",[EMUserKeychain new].token];
// [self.wkWebView evaluateJavaScript:inputValueJs completionHandler:^(id _Nullable response, NSError * _Nullable error) {
// DLog(@"%@",response);
// DLog(@"%@",error.localizedDescription);
// }];
// }
}
#pragma mark ================ 懒加载 ================
- (WKWebView *)wkWebView{
if (!_wkWebView) {
//以下代码适配大小
NSString *jScript = @"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width,user-scalable=no,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,'); document.getElementsByTagName('head')[0].appendChild(meta);";
WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
WKUserContentController *wkUController = [[WKUserContentController alloc] init];
[wkUController addUserScript:wkUScript];
WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init];
wkWebConfig.userContentController = wkUController;
_wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight-KTOP_HEIGHT) configuration:wkWebConfig];
_wkWebView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
// 设置代理
_wkWebView.navigationDelegate = self;
_wkWebView.UIDelegate = self;
// _wkWebView.scrollView.bounces = NO;
_wkWebView.scrollView.delegate = self;
//kvo 添加进度监控
[_wkWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WkwebBrowserContext];
[_wkWebView sizeToFit];
}
return _wkWebView;
}
- (UIProgressView *)progressView{
if (!_progressView) {
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
_progressView.frame = CGRectMake(0, 0, self.view.bounds.size.width, 1);
// 设置进度条的色彩
_progressView.tintColor = COLOR_THEMEGRENN;
_progressView.trackTintColor = [UIColor whiteColor];
}
return _progressView;
}
//注意,观察的移除
-(void)dealloc{
if (_wkWebView) {
[self.wkWebView setNavigationDelegate:nil];
[self.wkWebView setUIDelegate:nil];
[self.wkWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
}
}
@end
//
// GroupList.h
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface GroupItem : NSObject
@property (nonatomic,copy) NSString * city;
@property (nonatomic,copy) NSString * district;
@property (nonatomic,assign) int group_id;
@property (nonatomic,assign) double lat;
@property (nonatomic,assign) double lng;
@property (nonatomic,copy) NSString * icon;
@property (nonatomic,copy) NSString * text;
@property (nonatomic,copy) NSString * fl;//首字母
@end
@interface Group : NSObject
@end
@interface GroupList : NSObject
@property (nonatomic,copy) NSString * kind;
@property (nonatomic, assign) int group_id;
@property (nonatomic, copy) NSString * msg;//提示消息
@property (nonatomic,strong) Group * data_o;
@property (nonatomic,strong) Group * data_c;
@property (nonatomic,copy) NSString * city;
@property (nonatomic,copy) NSString * district;
@end
NS_ASSUME_NONNULL_END
//
// GroupList.m
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "GroupList.h"
@implementation GroupItem
@end
@implementation Group
@end
@implementation GroupList
@end
...@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
//自定义经纬度 //自定义经纬度
@property (nonatomic, assign) int is_custom; //经纬度是否自定义 @property (nonatomic, assign) int is_custom; //经纬度是否自定义
@property (nonatomic,copy ) NSString * user_mob;//用户登录手机号 @property (nonatomic,copy ) NSString *user_mob;//用户登录手机号
@property(nonatomic, assign) BOOL closeVoice;//关闭声音 @property(nonatomic, assign) BOOL closeVoice;//关闭声音
......
...@@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign) int group_id;//商户认证时的group_id @property (nonatomic,assign) int group_id;//商户认证时的group_id
@property (nonatomic,assign) int m_s;//商户状态,0-未审核,1-已审核 @property (nonatomic,assign) int m_s;//商户状态,0-未审核,1-已审核
@property (nonatomic,copy) NSString *cate;//商户品类 @property (nonatomic,copy) NSString *cate;//商户品类
@property (nonatomic,assign) int *mul_f;//一取多发标志位,0-未开通,1-开通 @property (nonatomic,assign) int mul_f;//一取多发标志位,0-未开通,1-开通
@end @end
@interface UserInfo : NSObject @interface UserInfo : NSObject
......
...@@ -17,22 +17,20 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -17,22 +17,20 @@ NS_ASSUME_NONNULL_BEGIN
static NSString * const SS_SIGN = @"/flow/v1_0/user/signup"; static NSString * const SS_SIGN = @"/flow/v1_0/user/signup";
/** /**
* 验证码
*/
static NSString * const SS_SMS_CODE12 = @"/flow/v1_2/user/smscode";
/**
* 更新上传DeviceToken * 更新上传DeviceToken
*/ */
static NSString * const SS_SMS_CODEW = @"/flow/v1_1//user/smscodew"; 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_LOGINX = @"/flow/v1_1/user/login";
/**
* 退出
*/
static NSString * const SS_LOGOUT = @"/flow/v1_0/user/logout";
/** /**
...@@ -90,6 +88,27 @@ static NSString * const SS_BAIDU = @"https://www.baidu.com"; ...@@ -90,6 +88,27 @@ static NSString * const SS_BAIDU = @"https://www.baidu.com";
*/ */
static NSString *const SS_ONLINE_DURATION = @"/flow/v1_0/courier/onlineDuration"; static NSString *const SS_ONLINE_DURATION = @"/flow/v1_0/courier/onlineDuration";
/**
骑士协议
*/
static NSString *const SS_SERVICE_AGREEMENT = @"/flow/view/service_agreement";
/**
隐私协议
*/
static NSString *const SS_PRIVACY_COURIER = @"/flow/view/privacy_courier";
///完成单提示滚动条
static NSString *const HOME_OVERORDER_SHOW = @"/flow/v1_1/courier/message";
/**
* 获得分站列表group_id
*/
static NSString * const SS_GET_GINFO = @"/flow/v1_1/group/getGroupInfo";
/**
* 获取banner
*/
static NSString * const SS_GET_SMENU = @"/flow/v1_0/service/getSMenu";
@interface AFNetworkingClient : AFHTTPSessionManager @interface AFNetworkingClient : AFHTTPSessionManager
+ (instancetype)sharedClient; + (instancetype)sharedClient;
......
...@@ -253,7 +253,7 @@ static NSString * sg_privateNetworkBaseUrl = nil; ...@@ -253,7 +253,7 @@ static NSString * sg_privateNetworkBaseUrl = nil;
if ([pDic[@"respcd"] isEqualToString:@"2100"] && ![AppConfig needLogin] && ![AFNetworkingClient noMessageAlert:encoded error:error]) { if ([pDic[@"respcd"] isEqualToString:@"2100"] && ![AppConfig needLogin] && ![AFNetworkingClient noMessageAlert:encoded error:error]) {
[TestClient dicMobClickStatistics:@"respcd2100" url:encoded]; [TestClient dicMobClickStatistics:@"respcd2100" url:encoded];
showAlertMessage(@"登录已经过期,请重新登录!"); showAlertMessage(@"登录已经过期,请重新登录!");
// [[GlobalNetManager sharedGlobalNetManager] logout:nil]; [[GlobalNetManager sharedGlobalNetManager] logout:nil];
} }
if (success) { if (success) {
......
...@@ -21,6 +21,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -21,6 +21,10 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)setEnvironmentType:(int)type; + (void)setEnvironmentType:(int)type;
+ (int)getEnvironmentType; + (int)getEnvironmentType;
+ (void)setCurrentType:(UserCurrentType)type;
+ (UserCurrentType)getCurrentType;
+ (void)clearUserInfo; + (void)clearUserInfo;
...@@ -44,6 +48,21 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -44,6 +48,21 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude; + (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude;
+ (void)deleteCustomLocationCoordinate; + (void)deleteCustomLocationCoordinate;
+ (void)saveLocationName:(NSString * )name;
+ (void)saveDistrictName:(NSString *)name;
+ (NSString *)getLocationName;
+ (NSString *)getDistrictName;
+ (void)saveShowLocationName:(NSString * )name;
+ (void)saveShowDistrictName:(NSString *)name;
//获取选择城市信息
+ (NSString *)getShowLocationName;
+ (NSString *)getShowDistrictName;
+ (void)saveGroupID:(int )group_id;
+ (int)getGroupID;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -32,6 +32,21 @@ DEF_SINGLETION(AppConfig); ...@@ -32,6 +32,21 @@ DEF_SINGLETION(AppConfig);
return type; return type;
} }
/// 设置用户type
+ (void)setCurrentType:(UserCurrentType)type
{
[[NSUserDefaults standardUserDefaults] setInteger:type forKey:kAppPersonalType];
[[NSUserDefaults standardUserDefaults] synchronize];
}
/// 获取用户type
+ (UserCurrentType)getCurrentType
{
UserCurrentType type = (UserCurrentType)[[NSUserDefaults standardUserDefaults] integerForKey:kAppPersonalType] ;
return type;
}
+ (void)clearUserInfo{ + (void)clearUserInfo{
[AppConfig sharedAppConfig].user = nil; [AppConfig sharedAppConfig].user = nil;
[[NSUserDefaults standardUserDefaults]removeObjectForKey:kAppUserInfo]; [[NSUserDefaults standardUserDefaults]removeObjectForKey:kAppUserInfo];
...@@ -132,4 +147,50 @@ DEF_SINGLETION(AppConfig); ...@@ -132,4 +147,50 @@ DEF_SINGLETION(AppConfig);
} }
//城市
+ (void)saveLocationName:(NSString * )name{
[[NSUserDefaults standardUserDefaults] setObject:name forKey:kAppLocationName];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)saveDistrictName:(NSString *)name{
[[NSUserDefaults standardUserDefaults] setObject:name forKey:@"districtName"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (NSString *)getLocationName{
return [[NSUserDefaults standardUserDefaults] objectForKey:kAppLocationName];
}
+ (NSString *)getDistrictName{
return [[NSUserDefaults standardUserDefaults] objectForKey:@"districtName"];
}
+ (void)saveShowLocationName:(NSString * )name{
[[NSUserDefaults standardUserDefaults] setObject:name forKey:@"showLocationName"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)saveShowDistrictName:(NSString *)name{
[[NSUserDefaults standardUserDefaults] setObject:name forKey:@"showDistrictName"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (NSString *)getShowLocationName{
return [[NSUserDefaults standardUserDefaults] objectForKey:@"showLocationName"];
}
+ (NSString *)getShowDistrictName{
return [[NSUserDefaults standardUserDefaults] objectForKey:@"showDistrictName"];
}
+ (void)saveGroupID:(int)group_id{
[[NSUserDefaults standardUserDefaults] setObject:@(group_id) forKey:@"group_id"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (int)getGroupID{
return [[[NSUserDefaults standardUserDefaults] objectForKey:@"group_id"] intValue];
}
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "GroupList.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
...@@ -15,11 +15,20 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -15,11 +15,20 @@ NS_ASSUME_NONNULL_BEGIN
AS_SINGLETION(AppTools); AS_SINGLETION(AppTools);
@property (nonatomic,strong) NSMutableDictionary *cityDic;//城市列表数据
@property (nonatomic,strong) GroupItem *item;//城市选择的item
- (int)versionToIntValue; - (int)versionToIntValue;
//json串 unicode转中文 //json串 unicode转中文
+ (NSString *)replaceUnicode:(NSString *)unicodeStr; + (NSString *)replaceUnicode:(NSString *)unicodeStr;
+ (BOOL)isValidMobeilTelWithString:(NSString *)string;
+ (NSString *)kfwUUID;
+ (void)ccodeBase64Encode:(NSMutableDictionary *)pDic;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import "AppTools.h" #import "AppTools.h"
#import "CustomMethod.h"
@interface AppTools() @interface AppTools()
@property (nonatomic,assign) int version_int; @property (nonatomic,assign) int version_int;
...@@ -42,5 +43,55 @@ DEF_SINGLETION(AppTools); ...@@ -42,5 +43,55 @@ DEF_SINGLETION(AppTools);
} }
} }
//判断电话合法性
+ (BOOL)isValidMobeilTelWithString:(NSString *)string{
BOOL isValisMobeil = NO;
//手机号码
NSArray *mobeils = [CustomMethod addPhoneNumArr:string];
if (mobeils.count > 0 && [[mobeils firstObject] length] > 0) {
isValisMobeil = YES;
}else{
//电话号码正则
NSString * PHS = @"";
if ([string hasPrefix:@"400"]) {
PHS = @"^400[0-9]{7}";
}
else if ([string hasPrefix:@"800"]) {
PHS = @"^800[0-9]{7}";
}
else{
PHS = @"^(0[0-9]{2})\\d{8}$|^(0[0-9]{3}(\\d{7,8}))$";
}
NSPredicate *regextesTel = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", PHS];
if ([regextesTel evaluateWithObject:string]) {
isValisMobeil = YES;
}else{
showAlertMessage(S(@"电话号码不合法:%@",string));
isValisMobeil = NO;
}
}
return isValisMobeil;
}
+ (NSString *)kfwUUID{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
return uuidStr;
}
//获取验证码时 加密key
+ (void)ccodeBase64Encode:(NSMutableDictionary *)pDic {
NSString *ccode_key = @"kfw123456";
NSString *time_since = S(@"%d",(int)[[NSDate date] timeIntervalSince1970]);
NSString *ccode = S(@"%@%@",ccode_key,[time_since substringWithRange:NSMakeRange(time_since.length - 4, 4)]);
ccode = [ccode base64Encode];
[pDic setAnyObject:ccode forKey:@"ccode"];//key加时间 base 64
[pDic setAnyObject:time_since forKey:@"tcode"];
// DebugLog(@"ccode_key:%@",ccode_key);
}
@end @end
//
// GlobalNetManager.h
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface GlobalNetManager : NSObject
AS_SINGLETION(GlobalNetManager);
- (void)logout:(EventHandler)logoutBlock;
- (void)logout:(EventHandler)logoutBlock:(XVBaseViewController *)bvc;
// 位置上传定时器
- (void)setTimeInterval;
- (void)stopTimeInterval;
// 在线时长上传定时器
- (void)setOnlineTimerInterval;
- (void)stopOnlineTimerInterval;
@end
NS_ASSUME_NONNULL_END
//
// GlobalNetManager.m
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "GlobalNetManager.h"
#import "XVLoginViewController.h"
#import "XVNaviViewController.h"
@interface GlobalNetManager()
@property (nonatomic,strong) NSTimer *timer;
@property (nonatomic,assign) float timer_count;
// 骑士在线时长统计
@property (nonatomic,strong) NSTimer *onlineTimer;
@property (nonatomic,assign) float online_duration;
@property (nonatomic, strong) UserInfo *userInfo;
@end
@implementation GlobalNetManager
DEF_SINGLETION(GlobalNetManager);
- (instancetype)init{
self = [super init];
if (self) {
self.timer_count = 30000;
self.online_duration = 60000;
}
return self;
}
- (void)logout:(EventHandler)logoutBlock{
if (![AppConfig needLogin]) {
[AppConfig clearUserInfo];
[[NSNotificationCenter defaultCenter] postNotificationName:kAppUserLogout object:nil];
BlockCallWithOneArg(logoutBlock, @"logout");
[[AFNetworkingClient sharedClient]runPost:SS_LOGOUT parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
DebugLog(@"退出app成功");
}else{
DebugLog(@"退出app失败resperr:%@",responseObject[@"resperr"]);
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
DebugLog(@"退出app失败");
}];
// 重置登录页面
XVLoginViewController *loginVc = [[XVLoginViewController alloc]init];
XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:loginVc];
theApp().window.rootViewController = navi;
}
// if ([EMClient sharedClient].isLoggedIn) {
// [[EMClient sharedClient] logout:YES completion:^(EMError *aError) {
// if (aError) {
// DebugLog(@"环信退出失败:%@",aError.errorDescription);
// }else{
// DebugLog(@"环信退出成功:%@",aError.errorDescription);
// }
// }];
// }
}
- (void)logout:(EventHandler)logoutBlock:(XVBaseViewController *)bvc{
[self logout:logoutBlock];
}
@end
//
// MyNetWork.h
// fastservice
//
// Created by xuning on 5/6/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MyNetWork : NSObject
//环信登录
+ (void)checkEaseInfo;
//
+ (void)easeLoginWithUsername:(NSString *)name spw:(NSString *)spw;
//用户登录后 加载用户基本信息
+ (void)loginAfterLoadUserProfile:(EventHandler )myNetBlock;
/*
* 加载单个城市信息
*/
+ (void)loadGroupInfoWithGroupId:(int)group_id myNetBlock:(EventHandler )myNetBlock;
/*
* 网络请求时 城市和区域参数 提取
*/
+ (NSMutableDictionary *)parameterShowCityAndDistrict:(NSMutableDictionary *)pDic;
#pragma mark -服务器数据是否加载成功
+ (BOOL)isSuccessServerData:(id)responseObject;
#pragma mark -检查更新
+ (void)checkUpdate;
@end
NS_ASSUME_NONNULL_END
//
// MyNetWork.m
// fastservice
//
// Created by xuning on 5/6/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "MyNetWork.h"
@implementation MyNetWork
#pragma mark - -环信登录
+ (void)checkEaseInfo{
// if (![AppConfig needLogin] && ([AppConfig getUserInfo].hide_flag != 1)) {
// if (![[EMClient sharedClient] isLoggedIn]) {
// [MyNetWork easeLoginWithUsername:S(@"%d",[AppConfig getUserInfo].user_id) spw:[AppConfig getUserInfo].spw];
// }else{
// NSString *em_name = [[EMClient sharedClient] currentUsername];
// if (StringIsNullOrEmpty(em_name)) {
// return;
// }
// BOOL isMe = [em_name isEqualToString:S(@"%d",[AppConfig getUserInfo].user_id)];
// if (!isMe) {//非一人
// [MyNetWork easeLoginWithUsername:S(@"%d",[AppConfig getUserInfo].user_id) spw:[AppConfig getUserInfo].spw];
// }
// }
// }
}
+ (void)easeLoginWithUsername:(NSString *)name spw:(NSString *)spw{
// [[EMClient sharedClient] loginWithUsername:name password:spw completion:^(NSString *aUsername, EMError *aError) {
// if (!aError) {
// //设置是否自动登录
// [[EMClient sharedClient].options setIsAutoLogin:YES];
//
// //发送自动登陆状态通知
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@YES];
// //保存最近一次登录用户名
// // [self saveLastLoginUsername];
// DebugLog(@"环信登录成功:%@",aError.errorDescription);
// }else{
// DebugLog(@"环信登录失败:%@",aError.errorDescription);
//
// [MBProgressHUD showMessage:S(@"%@",aError.errorDescription) toView:nil];
//
// }
// }];
}
#pragma mark - -登录后加载
+ (void)loginAfterLoadUserProfile:(EventHandler )myNetBlock{
NSMutableDictionary *pDic = [[NSMutableDictionary alloc] init];
[pDic setObject:@([AppConfig getUserInfo].user_id) forKey:@"user_id"];
[[AFNetworkingClient sharedClient] runPost:SS_GET_USERPROFILE parameters:pDic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
UserInfo * ui = [UserInfo mj_objectWithKeyValues:responseObject[@"data"]];
UserInfo *userInfo = [AppConfig getUserInfo];
userInfo.b = ui.b;
userInfo.c = ui.c;
userInfo.m = ui.m;
[AppConfig setUser:userInfo];
BlockCallWithOneArg(myNetBlock, userInfo);
if (userInfo.c.c_s > 0) {
[AppConfig setCurrentType:UserCurrentTypeCourier];
}else{
[AppConfig setCurrentType:UserCurrentTypeCustom];
}
[[NSNotificationCenter defaultCenter] postNotificationName:kAppLoadProfileSuccess object:nil];
}else{
BlockCallWithOneArg(myNetBlock, nil);
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"] toView:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
BlockCallWithOneArg(myNetBlock, nil);
}];
}
+ (void)loadGroupInfoWithGroupId:(int)group_id myNetBlock:(EventHandler )myNetBlock{
//
NSMutableDictionary *pDic = [NSMutableDictionary dictionary];
//所在城市
[pDic setAnyObject:[AppConfig getLocationName] forKey:@"city"];
[pDic setAnyObject:[AppConfig getDistrictName] forKey:@"district"];
[pDic setObject:@(group_id) forKey:@"group_id"];
[[AFNetworkingClient sharedClient] runPost:SS_GET_GINFO parameters:pDic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
NSDictionary *dic = responseObject[@"data"];
[AppTools sharedAppTools].cityDic = [[NSMutableDictionary alloc] initWithDictionary:dic];
GroupItem *groupItem = [GroupItem mj_objectWithKeyValues:dic];
[AppConfig saveGroupID:groupItem.group_id];
[AppConfig saveShowLocationName:groupItem.city];
[AppConfig saveShowDistrictName:groupItem.district];
[AppTools sharedAppTools].item = groupItem;
BlockCallWithOneArg(myNetBlock, dic);
}else{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"] toView:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
+ (NSMutableDictionary *)parameterShowCityAndDistrict:(NSMutableDictionary *)pDic{
[pDic setAnyObject:[AppConfig getShowLocationName] forKey:@"city"];
[pDic setAnyObject:[AppConfig getShowDistrictName] forKey:@"district"];
return pDic;
}
#pragma mark -服务器数据是否加载成功
+ (BOOL)isSuccessServerData:(id)responseObject{
return StringNotNullAndEmpty([responseObject objectForKey:@"respcd"]) && [[responseObject objectForKey:@"respcd"] isEqualToString:@"0000"];
}
@end
//
// CustomMethod.h
// MessageList
//
// Created by 刘超 on 13-11-13.
// Copyright (c) 2013年 刘超. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RegexKitLite.h"
@interface CustomMethod : NSObject
+ (NSString *)escapedString:(NSString *)oldString;
+ (NSMutableArray *)addHttpArr:(NSString *)text;
+ (NSMutableArray *)addPhoneNumArr:(NSString *)text;
+ (NSMutableArray *)addEmailArr:(NSString *)text;
+ (NSString *)transformString:(NSString *)originalStr emojiDic:(NSDictionary *)_emojiDic;
@end
//
// CustomMethod.m
// MessageList
//
// Created by 刘超 on 13-11-13.
// Copyright (c) 2013年 刘超. All rights reserved.
//
#import "CustomMethod.h"
@implementation CustomMethod
+ (NSString *)escapedString:(NSString *)oldString
{
NSString *escapedString_lt = [oldString stringByReplacingOccurrencesOfString:@"<" withString:@"&lt"];
NSString *escapedString = [escapedString_lt stringByReplacingOccurrencesOfString:@">" withString:@"&gt"];
return escapedString;
}
#pragma mark - 正则匹配电话号码,网址链接,Email地址
+ (NSMutableArray *)addHttpArr:(NSString *)text{
//匹配网址链接
// NSString *regex_http = @"(https?|ftp|file)+://[^\\s]*";
NSString *regex_http =
@"((http[s]{0,1}|ftp)://[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})(:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)|(www.[a-zA-Z0-9\\.\\-]+\\.([a-zA-Z]{2,4})(:\\d+)?(/[a-zA-Z0-9\\.\\-~!@#$%^&*+?:_/=<>]*)?)";
NSArray *array_http = [text componentsMatchedByRegex:regex_http];
NSMutableArray *httpArr = [NSMutableArray arrayWithArray:array_http];
/*
NSError *error;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regex_http options:NSRegularExpressionCaseInsensitive error:&error];
NSArray *arrayOfAllMatches = [regex matchesInString:text options:0 range:NSMakeRange(0, [text length])];
for (NSTextCheckingResult *match in arrayOfAllMatches){
NSString* substringForMatch = [text substringWithRange:match.range];
NSLog(@"substringForMatch%@",substringForMatch);
}
*/
return httpArr;
}
+ (NSMutableArray *)addPhoneNumArr:(NSString *)text{
//匹配电话号码
NSString *regex_phonenum = @"((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)";
NSArray *array_phonenum = [text componentsMatchedByRegex:regex_phonenum];
NSMutableArray *phoneNumArr = [NSMutableArray arrayWithArray:array_phonenum];
return phoneNumArr;
}
+ (NSMutableArray *)addEmailArr:(NSString *)text{
//匹配Email地址
NSString *regex_email = @"\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*.\\w+([-.]\\w+)*";
NSArray *array_email = [text componentsMatchedByRegex:regex_email];
NSMutableArray *emailArr = [NSMutableArray arrayWithArray:array_email];
return emailArr;
}
+ (NSString *)transformString:(NSString *)originalStr emojiDic:(NSDictionary *)_emojiDic
{
//匹配表情,将表情转化为html格式
NSString *text = originalStr;
NSString *regex_emoji = @"\\[[a-zA-Z0-9\\u4e00-\\u9fa5]+\\]";
NSArray *array_emoji = [text componentsMatchedByRegex:regex_emoji];
if ([array_emoji count]) {
for (NSString *str in array_emoji) {
NSRange range = [text rangeOfString:str];
NSString *i_transCharacter = [_emojiDic objectForKey:str];
if (i_transCharacter) {
NSString *imageHtml = [NSString stringWithFormat:@"<img src='%@' width='16' height='16'>",i_transCharacter];
text = [text stringByReplacingCharactersInRange:NSMakeRange(range.location, [str length]) withString:imageHtml];
}
}
}
//返回转义后的字符串
return text;
}
@end
//
// RegexKitLite.h
// http://regexkit.sourceforge.net/
// Licensed under the terms of the BSD License, as specified below.
//
/*
Copyright (c) 2008-2010, John Engelhart
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Zang Industries nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __OBJC__
#import <Foundation/NSArray.h>
#import <Foundation/NSError.h>
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSString.h>
#endif // __OBJC__
#include <limits.h>
#include <stdint.h>
#include <sys/types.h>
#include <TargetConditionals.h>
#include <AvailabilityMacros.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef REGEXKITLITE_VERSION_DEFINED
#define REGEXKITLITE_VERSION_DEFINED
#define _RKL__STRINGIFY(b) #b
#define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a)
#define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b)
#define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b)
#define REGEXKITLITE_VERSION_MAJOR 4
#define REGEXKITLITE_VERSION_MINOR 0
#define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR)
#define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING
#endif // REGEXKITLITE_VERSION_DEFINED
#if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1)
#define RKL_BLOCKS 1
#endif
#if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
#define _RKL_BLOCKS_ENABLED 1
#endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
#if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
#warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors.
#endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
// For Mac OS X < 10.5.
#ifndef NSINTEGER_DEFINED
#define NSINTEGER_DEFINED
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
typedef long NSInteger;
typedef unsigned long NSUInteger;
#define NSIntegerMin LONG_MIN
#define NSIntegerMax LONG_MAX
#define NSUIntegerMax ULONG_MAX
#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
typedef int NSInteger;
typedef unsigned int NSUInteger;
#define NSIntegerMin INT_MIN
#define NSIntegerMax INT_MAX
#define NSUIntegerMax UINT_MAX
#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
#endif // NSINTEGER_DEFINED
#ifndef RKLREGEXOPTIONS_DEFINED
#define RKLREGEXOPTIONS_DEFINED
// These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html
enum {
RKLNoOptions = 0,
RKLCaseless = 2,
RKLComments = 4,
RKLDotAll = 32,
RKLMultiline = 8,
RKLUnicodeWordBoundaries = 256
};
typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type.
#endif // RKLREGEXOPTIONS_DEFINED
#ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED
#define RKLREGEXENUMERATIONOPTIONS_DEFINED
enum {
RKLRegexEnumerationNoOptions = 0UL,
RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9,
RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10,
RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11,
};
typedef NSUInteger RKLRegexEnumerationOptions;
#endif // RKLREGEXENUMERATIONOPTIONS_DEFINED
#ifndef _REGEXKITLITE_H_
#define _REGEXKITLITE_H_
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
#define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define RKL_DEPRECATED_ATTRIBUTE
#endif
#if defined(NS_REQUIRES_NIL_TERMINATION)
#define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION
#else // defined(NS_REQUIRES_NIL_TERMINATION)
#define RKL_REQUIRES_NIL_TERMINATION
#endif // defined(NS_REQUIRES_NIL_TERMINATION)
// This requires a few levels of rewriting to get the desired results.
#define _RKL_CONCAT_2(c,d) c ## d
#define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b)
#ifdef RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x)
#else // RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) x
#endif // RKL_PREPEND_TO_METHODS
// If it looks like low memory notifications might be available, add code to register and respond to them.
// This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for,
// UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym().
#if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0))
#define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1
#endif
#ifdef __OBJC__
// NSException exception name.
extern NSString * const RKLICURegexException;
// NSError error domains and user info keys.
extern NSString * const RKLICURegexErrorDomain;
extern NSString * const RKLICURegexEnumerationOptionsErrorKey;
extern NSString * const RKLICURegexErrorCodeErrorKey;
extern NSString * const RKLICURegexErrorNameErrorKey;
extern NSString * const RKLICURegexLineErrorKey;
extern NSString * const RKLICURegexOffsetErrorKey;
extern NSString * const RKLICURegexPreContextErrorKey;
extern NSString * const RKLICURegexPostContextErrorKey;
extern NSString * const RKLICURegexRegexErrorKey;
extern NSString * const RKLICURegexRegexOptionsErrorKey;
extern NSString * const RKLICURegexReplacedCountErrorKey;
extern NSString * const RKLICURegexReplacedStringErrorKey;
extern NSString * const RKLICURegexReplacementStringErrorKey;
extern NSString * const RKLICURegexSubjectRangeErrorKey;
extern NSString * const RKLICURegexSubjectStringErrorKey;
@interface NSString (RegexKitLiteAdditions)
+ (void)RKL_METHOD_PREPEND(clearStringCache);
// Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857.
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE;
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
//// >= 3.0
- (NSInteger)RKL_METHOD_PREPEND(captureCount);
- (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error;
- (BOOL)RKL_METHOD_PREPEND(isRegexValid);
- (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error;
- (void)RKL_METHOD_PREPEND(flushCachedRegexData);
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
//// >= 4.0
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
#ifdef _RKL_BLOCKS_ENABLED
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
#endif // _RKL_BLOCKS_ENABLED
@end
@interface NSMutableString (RegexKitLiteAdditions)
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
//// >= 4.0
#ifdef _RKL_BLOCKS_ENABLED
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
#endif // _RKL_BLOCKS_ENABLED
@end
#endif // __OBJC__
#endif // _REGEXKITLITE_H_
#ifdef __cplusplus
} // extern "C"
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,6 +6,22 @@ ...@@ -6,6 +6,22 @@
// Copyright © 2025 FastService. All rights reserved. // Copyright © 2025 FastService. All rights reserved.
// //
#define EnvironmentType0 0
#define EnvironmentType1 1
typedef enum{
UserCurrentTypeNone,
UserCurrentTypeCustom,
UserCurrentTypeCourier,
}UserCurrentType;
typedef enum {
StatusTypeWork = 2,
StatusTypeClose = 3,
} StatusType;
/** /**
* 当前用户Info * 当前用户Info
*/ */
......
...@@ -127,6 +127,15 @@ isPhoneX;\ ...@@ -127,6 +127,15 @@ isPhoneX;\
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self; #define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
/**
申明一个 block_self 的指针,指向自身,以用于在block中使用
*/
#if __has_feature(objc_arc)
#define IMP_BLOCK_SELF(type) __weak type *block_self=self;
#else
#define IMP_BLOCK_SELF(type) __block type *block_self=self;
#endif
typedef void(^EventHandler)(id sender); typedef void(^EventHandler)(id sender);
typedef void(^EventVoidHandler)(void); typedef void(^EventVoidHandler)(void);
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
#import "XVRegisterViewController.h" #import "XVRegisterViewController.h"
#import "XVPasswordViewController.h" #import "XVPasswordViewController.h"
#import "XVInputFieldView.h" #import "XVInputFieldView.h"
#import "XVNaviViewController.h"
#import "XVWebViewController.h"
#import "XVMainJobViewController.h"
@interface XVLoginViewController () @interface XVLoginViewController ()
...@@ -37,12 +40,15 @@ ...@@ -37,12 +40,15 @@
@property (nonatomic, strong) XVInputFieldView *smsCodeView; @property (nonatomic, strong) XVInputFieldView *smsCodeView;
@property (nonatomic,assign) BOOL privacy;
@end @end
@implementation XVLoginViewController @implementation XVLoginViewController
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self setNavigationBarsetBackgroundColor:COLOR_THEMEGRENN];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -148,8 +154,108 @@ ...@@ -148,8 +154,108 @@
- (void)agreeClick:(UIButton *)button { - (void)agreeClick:(UIButton *)button {
button.selected = !button.selected; button.selected = !button.selected;
self.privacy = button.selected;
} }
- (void)loginButtonClick {
// 如果是账号密码登录
if (self.changeLoginButton.selected) {
}else {
// 密码登录
if (StringIsNullOrEmpty(self.phoneView.textField.text)) {
[MBProgressHUD showMessage:@"请填入手机号"];
return;
}
if (![AppTools isValidMobeilTelWithString:self.phoneView.textField.text]) {
return;
}
if (StringIsNullOrEmpty(self.passwordView.textField.text)) {
[MBProgressHUD showMessage:@"请输入密码"];
return;
}
if (!self.privacy) {
[MBProgressHUD showMessage:@"请阅读并同意快服务骑士协议及隐私协议"];
return;
}
//缓存一份
LocalCache *localCache = [AppConfig getLocalCache];
localCache.user_mob = self.phoneView.textField.text;
[AppConfig saveLocalCache:localCache];
[self.view endEditing:YES];
NSMutableDictionary * pdic = [[NSMutableDictionary alloc]init];
[pdic setAnyObject:self.phoneView.textField.text forKey:@"mobile"];
[pdic setAnyObject:self.passwordView.textField.text forKey:@"password"];
[pdic setObject:@"" forKey:@"clientid"];
[pdic setAnyObject:[AppConfig getLocationName] forKey:@"city"];
[pdic setAnyObject:[AppConfig getDistrictName] forKey:@"district"];
[pdic setAnyObject:_S(@"%f",[AppConfig getLocationCoordinate].longitude) forKey:@"user_lng"];
[pdic setAnyObject:_S(@"%f",[AppConfig getLocationCoordinate].latitude) forKey:@"user_lat"];
showIndicator(YES, @"登录中", nil);
showFullView(YES, self);
IMP_BLOCK_SELF(XVLoginViewController)
[[AFNetworkingClient sharedClient]runPost:SS_LOGINX parameters:pdic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)task.response;
//一些cookie信息 -->>dictionary
NSDictionary *dictionary = [httpResponse allHeaderFields];
NSDictionary *dic = [responseObject objectForKey:@"data"];
UserInfo * userInfo = [UserInfo mj_objectWithKeyValues:dic];
//保存cookie信息
if (StringNotNullAndEmpty([dictionary objectForKey:@"Set-Cookie"])) {
userInfo.cookie = [dictionary objectForKey:@"Set-Cookie"];
}else{
[TestClient dicMobClickStatistics:@"respNoCookie"];
}
[AppConfig setUser:userInfo];
//环信登录
NSString *spw = responseObject[@"data"][@"spw"];
[MyNetWork easeLoginWithUsername:S(@"%d",userInfo.user_id) spw:spw];
// 设备别名
[[NSNotificationCenter defaultCenter] postNotificationName:kAppUserLogin object:nil];
[self loginSuccess];
showIndicator(NO, @"登录中", ^{
[MBProgressHUD showMessage:@"登录成功"];
});
}else{
showIndicator(NO, @"登录中", ^{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
});
}
showFullView(NO, block_self);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
showIndicator(NO, @"登录中", nil);
showFullView(NO, block_self);
}];
}
}
- (void)loginSuccess {
XVMainJobViewController *vc = [[XVMainJobViewController alloc]init];
XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:vc];
theApp().window.rootViewController = navi;
}
- (UIView *)containerView { - (UIView *)containerView {
if(_containerView == nil) { if(_containerView == nil) {
_containerView = [[UIView alloc]init]; _containerView = [[UIView alloc]init];
...@@ -217,7 +323,11 @@ ...@@ -217,7 +323,11 @@
WS(weakSelf); WS(weakSelf);
[_forgetButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { [_forgetButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
XVPasswordViewController *vc = [[XVPasswordViewController alloc]init]; XVPasswordViewController *vc = [[XVPasswordViewController alloc]init];
[weakSelf.navigationController pushViewController:vc animated:YES]; XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:vc];
navi.modalPresentationStyle = UIModalPresentationFullScreen;
[weakSelf presentViewController:navi animated:YES completion:nil];
}]; }];
} }
...@@ -231,7 +341,9 @@ ...@@ -231,7 +341,9 @@
[_registerButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) { [_registerButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
XVRegisterViewController *registerVc = [[XVRegisterViewController alloc]init]; XVRegisterViewController *registerVc = [[XVRegisterViewController alloc]init];
[weakSelf presentViewController:registerVc animated:YES completion:nil]; XVNaviViewController *navi = [[XVNaviViewController alloc]initWithRootViewController:registerVc];
navi.modalPresentationStyle = UIModalPresentationFullScreen;
[weakSelf presentViewController:navi animated:YES completion:nil];
}]; }];
} }
return _registerButton; return _registerButton;
...@@ -240,6 +352,7 @@ ...@@ -240,6 +352,7 @@
- (UIButton *)loginButton { - (UIButton *)loginButton {
if(_loginButton == nil) { if(_loginButton == nil) {
_loginButton = [[UIButton alloc]initWithTitle:@"登录" fontSize:16 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN]; _loginButton = [[UIButton alloc]initWithTitle:@"登录" fontSize:16 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_loginButton addTarget:self action:@selector(loginButtonClick) forControlEvents:(UIControlEventTouchUpInside)];
} }
return _loginButton; return _loginButton;
} }
...@@ -273,14 +386,15 @@ ...@@ -273,14 +386,15 @@
[text appendAttributedString:str1]; [text appendAttributedString:str1];
NSMutableAttributedString *str2 = [[NSMutableAttributedString alloc] initWithString:@"《快服务服务者合作协议》"]; NSMutableAttributedString *str2 = [[NSMutableAttributedString alloc] initWithString:@"快服务骑士协议"];
str2.font = font; str2.font = font;
str2.color = BLUE_COLOR; str2.color = BLUE_COLOR;
WS(weakSelf)
YYTextHighlight *highlight = [YYTextHighlight new]; YYTextHighlight *highlight = [YYTextHighlight new];
highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
[weakSelf toWebView:SS_SERVICE_AGREEMENT name:@"骑士协议"];
}; };
[str2 setTextHighlight:highlight range:str2.rangeOfAll]; [str2 setTextHighlight:highlight range:str2.rangeOfAll];
...@@ -294,14 +408,14 @@ ...@@ -294,14 +408,14 @@
[text appendAttributedString:str3]; [text appendAttributedString:str3];
NSMutableAttributedString *str4 = [[NSMutableAttributedString alloc] initWithString:@"《隐私协议》"]; NSMutableAttributedString *str4 = [[NSMutableAttributedString alloc] initWithString:@"隐私协议"];
str4.font = font; str4.font = font;
str4.color = BLUE_COLOR; str4.color = BLUE_COLOR;
YYTextHighlight *highlight1 = [YYTextHighlight new]; YYTextHighlight *highlight1 = [YYTextHighlight new];
highlight1.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { highlight1.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
[weakSelf toWebView:SS_PRIVACY_COURIER name:@"隐私协议"];
}; };
[str4 setTextHighlight:highlight1 range:str4.rangeOfAll]; [str4 setTextHighlight:highlight1 range:str4.rangeOfAll];
...@@ -315,4 +429,14 @@ ...@@ -315,4 +429,14 @@
return _protocolLabel; return _protocolLabel;
} }
- (void)toWebView:(NSString *)url name:(NSString *)name {
NSString * path = S(@"%@%@",[AFNetworkingClient baseURLString],url);
XVWebViewController *web = [[XVWebViewController alloc]init];
[web loadWebURLSring:path];
[self.navigationController pushViewController:web animated:YES];
}
@end @end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "XVPasswordViewController.h" #import "XVPasswordViewController.h"
#import "XVInputFieldView.h" #import "XVInputFieldView.h"
#import "XVWebViewController.h"
@interface XVPasswordViewController () @interface XVPasswordViewController ()
...@@ -15,14 +16,23 @@ ...@@ -15,14 +16,23 @@
// 手机号 // 手机号
@property (nonatomic, strong) XVInputFieldView *phoneView; @property (nonatomic, strong) XVInputFieldView *phoneView;
@property (nonatomic,copy) NSString *phone;
// 验证码 // 验证码
@property (nonatomic, strong) XVInputFieldView *smsCodeView; @property (nonatomic, strong) XVInputFieldView *smsCodeView;
// 图片验证码 // 图片验证码
@property (nonatomic, strong) XVInputFieldView *imgCodeView; @property (nonatomic, strong) XVInputFieldView *imgCodeView;
@property (nonatomic,copy) NSString *imgCode;
// 密码 // 密码
@property (nonatomic, strong) XVInputFieldView *passwordView; @property (nonatomic, strong) XVInputFieldView *passwordView;
@property (nonatomic, strong) UILabel *tipLabel; @property (nonatomic, copy) NSString *uuid; //
@property (nonatomic, strong) YYLabel *protocolLabel;
@property (nonatomic,strong ) NSTimer *timer;
@property (nonatomic, strong) UIButton *sureButton; @property (nonatomic, strong) UIButton *sureButton;
...@@ -38,8 +48,24 @@ ...@@ -38,8 +48,24 @@
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
[self setupUI]; [self setupUI];
[self loadPicVerfData];
[self updateDeviceToken];
[IQKeyboardManager sharedManager].enableAutoToolbar = YES;
//ctrl + i 格式化
self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"iconPark-left 1 Copy 1")];
}
- (void)back {
[self dismissViewControllerAnimated:YES completion:^{
[IQKeyboardManager sharedManager].enableAutoToolbar = NO;
}];
} }
- (void)setupUI { - (void)setupUI {
[self.view addSubview:self.titleLabel]; [self.view addSubview:self.titleLabel];
...@@ -53,38 +79,33 @@ ...@@ -53,38 +79,33 @@
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(29); make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(29);
make.left.mas_equalTo(self.view).mas_offset(30); make.left.mas_equalTo(self.view).mas_offset(30);
make.right.mas_equalTo(self.view).mas_offset(-30); make.right.mas_equalTo(self.view).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.view addSubview:self.imgCodeView];
[self.view addSubview:self.smsCodeView]; [self.imgCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
[self.smsCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.phoneView.mas_bottom).mas_offset(31); make.top.mas_equalTo(self.phoneView.mas_bottom).mas_offset(31);
make.left.mas_equalTo(self.view).mas_offset(30); make.left.mas_equalTo(self.view).mas_offset(30);
make.right.mas_equalTo(self.view).mas_offset(-30); make.right.mas_equalTo(self.view).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.view addSubview:self.imgCodeView]; [self.view addSubview:self.smsCodeView];
[self.imgCodeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.smsCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.smsCodeView.mas_bottom).mas_offset(31); make.top.mas_equalTo(self.imgCodeView.mas_bottom).mas_offset(31);
make.left.mas_equalTo(self.view).mas_offset(30); make.left.mas_equalTo(self.view).mas_offset(30);
make.right.mas_equalTo(self.view).mas_offset(-30); make.right.mas_equalTo(self.view).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.view addSubview:self.passwordView]; [self.view addSubview:self.passwordView];
[self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) { [self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.imgCodeView.mas_bottom).mas_offset(31); make.top.mas_equalTo(self.smsCodeView.mas_bottom).mas_offset(31);
make.left.mas_equalTo(self.view).mas_offset(30); make.left.mas_equalTo(self.view).mas_offset(30);
make.right.mas_equalTo(self.view).mas_offset(-30); make.right.mas_equalTo(self.view).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.view addSubview:self.tipLabel];
[self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(self.passwordView).mas_offset(8);
}];
[self.view addSubview:self.sureButton]; [self.view addSubview:self.sureButton];
[self.sureButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.sureButton mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -97,6 +118,155 @@ ...@@ -97,6 +118,155 @@
} }
- (void)loadPicVerfData{
self.uuid = [AppTools kfwUUID];
NSString *urlStr = S(@"%@%@?uu_id=%@",[AFNetworkingClient baseURLString],SS_SMS_PIC_CODE,self.uuid);
[self.imgCodeView.picCodeButton sd_setImageWithURL:URL(urlStr) forState:UIControlStateNormal placeholderImage:[UIImage new] options:SDWebImageRefreshCached];
}
//更新上传DeviceToken
- (void)updateDeviceToken{
[[AFNetworkingClient sharedClient] runPost:SS_SMS_CODEW parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
} failure:^(NSURLSessionDataTask *task, NSError *error){
}];
}
// 获取验证码逻辑
- (void)loadVerifycode:(int)voice{
if (StringIsNullOrEmpty(self.phone)) {
[MBProgressHUD showMessage:@"请填写手机号"];
return;
}
if (![AppTools isValidMobeilTelWithString:self.phone]) {
return;
}
if (StringIsNullOrEmpty(self.imgCode)) {
[MBProgressHUD showMessage:@"请输入图片验证码"];
return;
}
[self seconderyValidate:nil voice:voice];
}
//二次验证 发送验证码
- (void)seconderyValidate:(NSDictionary *)result voice:(int)voice{
NSMutableDictionary *pDic = [NSMutableDictionary dictionaryWithDictionary:result];
[pDic setAnyObject:self.phone forKey:@"mobile"];
[pDic setObject:@(1) forKey:@"type"]; //0 注册或者登陆 1 忘记密码
[pDic setObject:@(voice) forKey:@"voice"];
[AppTools ccodeBase64Encode:pDic];
[pDic setAnyObject:self.uuid forKey:@"uu_id"];
[pDic setAnyObject:self.imgCode forKey:@"imageCode"];
showIndicator(YES, @"获取中", nil);
IMP_BLOCK_SELF(XVPasswordViewController);
[[AFNetworkingClient sharedClient] runPost:SS_SMS_PIC_CODE parameters:pDic success:^(NSURLSessionDataTask *task, id responseObject) {
if (StringNotNullAndEmpty([responseObject objectForKey:@"respcd"]) &&[[responseObject objectForKey:@"respcd"] isEqualToString:@"0000"]) {
block_self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:block_self selector:@selector(verCodeAciton) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:block_self.timer forMode:NSRunLoopCommonModes];
[block_self.timer fire];
[MBProgressHUD showMessage:@"请查收"];
}else{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
}
showIndicator(NO, nil, nil);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
showAlertMessage(@"获取异常!");
showIndicator(NO, nil, nil);
}];
}
//六十秒倒计时
- (void)verCodeAciton{
static int a = 60;
self.smsCodeView.smsCodeButton.enabled = NO;
[self.smsCodeView.smsCodeButton setTitle:S(@"%ds",a) forState:UIControlStateNormal];
//语音标签
self.smsCodeView.voiceLabel.hidden = NO;
self.smsCodeView.voiceLabel.text = S(@"收不到验证码?%d秒后来个语音验证码吧",a);
a -= 1;
if (a == -1) {
[self.smsCodeView.smsCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
[self.timer invalidate];
self.smsCodeView.smsCodeButton.enabled = YES;
self.smsCodeView.smsCodeButton.backgroundColor = COLOR_THEMEGRENN;
a = 60;
self.smsCodeView.voiceLabel.userInteractionEnabled = YES;
self.smsCodeView.voiceLabel.text = @"收不到验证码?来个语音验证吧";
self.smsCodeView.voiceLabel.textColor = BLUE_COLOR;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lbVoiceTapClick:)];
[self.smsCodeView.voiceLabel addGestureRecognizer:tap];
}
}
//语音验证码
- (void)lbVoiceTapClick:(UITapGestureRecognizer *)tap{
//图形验证
[self loadVerifycode:1];
}
- (void)registerButtonClick {
NSMutableDictionary * pdic = [[NSMutableDictionary alloc]init];
if (StringIsNullOrEmpty(self.phoneView.textField.text)) {
[MBProgressHUD showMessage:@"请填入手机号"];
return;
}
if (![AppTools isValidMobeilTelWithString:self.phoneView.textField.text]) {
return;
}
if (StringIsNullOrEmpty(self.smsCodeView.textField.text)) {
[MBProgressHUD showMessage:@"请填入验证码"];
return;
}
if (StringIsNullOrEmpty(self.passwordView.textField.text)) {
[MBProgressHUD showMessage:@"请输入密码"];
return;
}
[pdic setAnyObject:self.phoneView.textField.text forKey:@"mobile"];
[pdic setAnyObject:@"" forKey:@"nickname"];
[pdic setAnyObject:self.passwordView.textField.text forKey:@"password"];
[pdic setAnyObject:self.smsCodeView.textField.text forKey:@"pin"];
NSLog(@"%@",pdic);
IMP_BLOCK_SELF(XVPasswordViewController);
showIndicator(YES, @"提交中", nil);
showFullView(YES, self);
NSURLSessionTask * task2 = [[AFNetworkingClient sharedClient] runPost:SS_FORGET_PWD parameters:pdic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
[block_self.navigationController popViewControllerAnimated:YES];
[block_self back];
[MBProgressHUD showMessage:@"提交成功"];
}else{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
}
showIndicator(NO, nil, nil);
showFullView(NO, block_self);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
showIndicator(NO, nil, nil);
showFullView(NO, block_self);
}];
}
- (UILabel *)titleLabel { - (UILabel *)titleLabel {
if(_titleLabel == nil) { if(_titleLabel == nil) {
...@@ -108,20 +278,48 @@ ...@@ -108,20 +278,48 @@
// //
- (XVInputFieldView *)phoneView { - (XVInputFieldView *)phoneView {
if(_phoneView == nil) { if(_phoneView == nil) {
_phoneView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入手机号"]; _phoneView = [[XVInputFieldView alloc]initWithType:InputTypeNumber placeholder:@"请输入手机号"];
IMP_BLOCK_SELF(XVPasswordViewController)
_phoneView.textEditingChanged = ^(NSString * _Nonnull obj) {
block_self.phone = obj;
if (StringIsNullOrEmpty(obj) || StringIsNullOrEmpty(block_self.imgCode)) {
[block_self.smsCodeView.smsCodeButton setBackgroundColor:BB_3_COLOR];
}else{
[block_self.smsCodeView.smsCodeButton setBackgroundColor:COLOR_THEMEGRENN];
}
};
} }
return _phoneView; return _phoneView;
} }
- (XVInputFieldView *)smsCodeView { - (XVInputFieldView *)smsCodeView {
if(_smsCodeView == nil) { if(_smsCodeView == nil) {
_smsCodeView = [[XVInputFieldView alloc]initWithType:InputTypeNumber placeholder:@"请输入验证码"]; _smsCodeView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入验证码"];
IMP_BLOCK_SELF(XVPasswordViewController)
[_smsCodeView.smsCodeButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
[block_self loadVerifycode:0];
}];
} }
return _smsCodeView; return _smsCodeView;
} }
- (XVInputFieldView *)imgCodeView { - (XVInputFieldView *)imgCodeView {
if(_imgCodeView == nil) { if(_imgCodeView == nil) {
_imgCodeView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入图片验证码"]; _imgCodeView = [[XVInputFieldView alloc]initWithType:InputTypePicCode placeholder:@"请输入图片验证码"];
IMP_BLOCK_SELF(XVPasswordViewController)
[_imgCodeView.picCodeButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
[block_self loadPicVerfData];
}];
_imgCodeView.textEditingChanged = ^(NSString * _Nonnull obj) {
block_self.imgCode = obj;
if (StringIsNullOrEmpty(obj) || StringIsNullOrEmpty(block_self.phone)) {
[block_self.smsCodeView.smsCodeButton setBackgroundColor:BB_3_COLOR];
}else{
[block_self.smsCodeView.smsCodeButton setBackgroundColor:COLOR_THEMEGRENN];
}
};
} }
return _imgCodeView; return _imgCodeView;
} }
...@@ -133,12 +331,8 @@ ...@@ -133,12 +331,8 @@
} }
return _passwordView; return _passwordView;
} }
- (UILabel *)tipLabel {
if(_tipLabel == nil) {
_tipLabel = [[UILabel alloc]initWithText:@"密码长度6-20位" textColor:BB_3_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:10];
}
return _tipLabel;
}
- (UIButton *)sureButton { - (UIButton *)sureButton {
if(_sureButton == nil) { if(_sureButton == nil) {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "XVRegisterViewController.h" #import "XVRegisterViewController.h"
#import "XVInputFieldView.h" #import "XVInputFieldView.h"
#import "XVWebViewController.h"
@interface XVRegisterViewController () @interface XVRegisterViewController ()
...@@ -21,31 +22,66 @@ ...@@ -21,31 +22,66 @@
// 手机号 // 手机号
@property (nonatomic, strong) XVInputFieldView *phoneView; @property (nonatomic, strong) XVInputFieldView *phoneView;
@property (nonatomic,copy) NSString *phone;
// 验证码 // 验证码
@property (nonatomic, strong) XVInputFieldView *smsCodeView; @property (nonatomic, strong) XVInputFieldView *smsCodeView;
// 图片验证码 // 图片验证码
@property (nonatomic, strong) XVInputFieldView *imgCodeView; @property (nonatomic, strong) XVInputFieldView *imgCodeView;
@property (nonatomic,copy) NSString *imgCode;
// 密码 // 密码
@property (nonatomic, strong) XVInputFieldView *passwordView; @property (nonatomic, strong) XVInputFieldView *passwordView;
@property (nonatomic, copy) NSString *uuid; //
@property (nonatomic, strong) YYLabel *protocolLabel; @property (nonatomic, strong) YYLabel *protocolLabel;
@property (nonatomic,strong ) NSTimer *timer;
@property (nonatomic,assign) BOOL privacy;
@end @end
@implementation XVRegisterViewController @implementation XVRegisterViewController
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self setNavigationBarsetBackgroundColor:COLOR_THEMEGRENN];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self setNavigationBarsetBackgroundColor:COLOR_THEMEGRENN];
self.view.backgroundColor = COLOR_THEMEGRENN; self.view.backgroundColor = COLOR_THEMEGRENN;
[self setupUI]; [self setupUI];
[self loadPicVerfData];
[self updateDeviceToken];
[IQKeyboardManager sharedManager].enableAutoToolbar = YES;
//ctrl + i 格式化
self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"iconPark-left 1 Copy 1")];
}
- (void)back {
[self dismissViewControllerAnimated:YES completion:^{
[IQKeyboardManager sharedManager].enableAutoToolbar = NO;
}];
}
- (BOOL)fd_interactivePopDisabled {
return YES;
} }
- (void)setupUI { - (void)setupUI {
[self.view addSubview:self.containerView]; [self.view addSubview:self.containerView];
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) { [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view).mas_offset(120*heightScale); make.top.mas_equalTo(self.view).mas_offset((120-KTOP_HEIGHT)*heightScale);
make.left.right.bottom.mas_equalTo(self.view); make.left.right.bottom.mas_equalTo(self.view);
}]; }];
[self.view layoutIfNeeded]; [self.view layoutIfNeeded];
...@@ -69,28 +105,30 @@ ...@@ -69,28 +105,30 @@
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(58*heightScale); make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(58*heightScale);
make.left.mas_equalTo(self.containerView).mas_offset(30); make.left.mas_equalTo(self.containerView).mas_offset(30);
make.right.mas_equalTo(self.containerView).mas_offset(-30); make.right.mas_equalTo(self.containerView).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.containerView addSubview:self.smsCodeView]; [self.containerView addSubview:self.imgCodeView];
[self.smsCodeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.imgCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.phoneView.mas_bottom).mas_offset(31*heightScale); make.top.mas_equalTo(self.phoneView.mas_bottom).mas_offset(31*heightScale);
make.left.mas_equalTo(self.containerView).mas_offset(30); make.left.mas_equalTo(self.containerView).mas_offset(30);
make.right.mas_equalTo(self.containerView).mas_offset(-30); make.right.mas_equalTo(self.containerView).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.containerView addSubview:self.imgCodeView]; [self.containerView addSubview:self.smsCodeView];
[self.imgCodeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.smsCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.smsCodeView.mas_bottom).mas_offset(31*heightScale); make.top.mas_equalTo(self.imgCodeView.mas_bottom).mas_offset(31*heightScale);
make.left.mas_equalTo(self.containerView).mas_offset(30); make.left.mas_equalTo(self.containerView).mas_offset(30);
make.right.mas_equalTo(self.containerView).mas_offset(-30); make.right.mas_equalTo(self.containerView).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(40);
}]; }];
[self.containerView addSubview:self.passwordView]; [self.containerView addSubview:self.passwordView];
[self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) { [self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.imgCodeView.mas_bottom).mas_offset(31*heightScale); make.top.mas_equalTo(self.smsCodeView.mas_bottom).mas_offset(31*heightScale);
make.left.mas_equalTo(self.containerView).mas_offset(30); make.left.mas_equalTo(self.containerView).mas_offset(30);
make.right.mas_equalTo(self.containerView).mas_offset(-30); make.right.mas_equalTo(self.containerView).mas_offset(-30);
make.height.mas_equalTo(30); make.height.mas_equalTo(30);
...@@ -118,8 +156,197 @@ ...@@ -118,8 +156,197 @@
} }
- (void)agreeClick:(UIButton *)button { - (void)agreeClick:(UIButton *)button {
button.selected = !button.selected; button.selected = !button.selected;
self.privacy = button.selected;
}
- (void)loadPicVerfData{
self.uuid = [AppTools kfwUUID];
NSString *urlStr = S(@"%@%@?uu_id=%@",[AFNetworkingClient baseURLString],SS_SMS_PIC_CODE,self.uuid);
[self.imgCodeView.picCodeButton sd_setImageWithURL:URL(urlStr) forState:UIControlStateNormal placeholderImage:[UIImage new] options:SDWebImageRefreshCached];
}
//更新上传DeviceToken
- (void)updateDeviceToken{
[[AFNetworkingClient sharedClient] runPost:SS_SMS_CODEW parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
} failure:^(NSURLSessionDataTask *task, NSError *error){
}];
}
// 获取验证码逻辑
- (void)loadVerifycode:(int)voice{
if (StringIsNullOrEmpty(self.phone)) {
[MBProgressHUD showMessage:@"请填写手机号"];
return;
}
if (![AppTools isValidMobeilTelWithString:self.phone]) {
return;
}
if (StringIsNullOrEmpty(self.imgCode)) {
[MBProgressHUD showMessage:@"请输入图片验证码"];
return;
}
[self seconderyValidate:nil voice:voice];
}
//二次验证 发送验证码
- (void)seconderyValidate:(NSDictionary *)result voice:(int)voice{
NSMutableDictionary *pDic = [NSMutableDictionary dictionaryWithDictionary:result];
[pDic setAnyObject:self.phone forKey:@"mobile"];
[pDic setObject:@(0) forKey:@"type"]; //0 注册或者登陆 1 忘记密码
[pDic setObject:@(voice) forKey:@"voice"];
[AppTools ccodeBase64Encode:pDic];
[pDic setAnyObject:self.uuid forKey:@"uu_id"];
[pDic setAnyObject:self.imgCode forKey:@"imageCode"];
showIndicator(YES, @"获取中", nil);
IMP_BLOCK_SELF(XVRegisterViewController);
[[AFNetworkingClient sharedClient] runPost:SS_SMS_PIC_CODE parameters:pDic success:^(NSURLSessionDataTask *task, id responseObject) {
if (StringNotNullAndEmpty([responseObject objectForKey:@"respcd"]) &&[[responseObject objectForKey:@"respcd"] isEqualToString:@"0000"]) {
block_self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:block_self selector:@selector(verCodeAciton) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:block_self.timer forMode:NSRunLoopCommonModes];
[block_self.timer fire];
[MBProgressHUD showMessage:@"请查收"];
}else{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
}
showIndicator(NO, nil, nil);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
showAlertMessage(@"获取异常!");
showIndicator(NO, nil, nil);
}];
}
//六十秒倒计时
- (void)verCodeAciton{
static int a = 60;
self.smsCodeView.smsCodeButton.enabled = NO;
[self.smsCodeView.smsCodeButton setTitle:S(@"%ds",a) forState:UIControlStateNormal];
//语音标签
self.smsCodeView.voiceLabel.hidden = NO;
self.smsCodeView.voiceLabel.text = S(@"收不到验证码?%d秒后来个语音验证码吧",a);
a -= 1;
if (a == -1) {
[self.smsCodeView.smsCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
[self.timer invalidate];
self.smsCodeView.smsCodeButton.enabled = YES;
self.smsCodeView.smsCodeButton.backgroundColor = COLOR_THEMEGRENN;
a = 60;
self.smsCodeView.voiceLabel.userInteractionEnabled = YES;
self.smsCodeView.voiceLabel.text = @"收不到验证码?来个语音验证吧";
self.smsCodeView.voiceLabel.textColor = BLUE_COLOR;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lbVoiceTapClick:)];
[self.smsCodeView.voiceLabel addGestureRecognizer:tap];
}
} }
//语音验证码
- (void)lbVoiceTapClick:(UITapGestureRecognizer *)tap{
//图形验证
[self loadVerifycode:1];
}
- (void)registerButtonClick {
NSMutableDictionary * pdic = [[NSMutableDictionary alloc]init];
if (StringIsNullOrEmpty(self.phoneView.textField.text)) {
[MBProgressHUD showMessage:@"请填入手机号"];
return;
}
if (![AppTools isValidMobeilTelWithString:self.phoneView.textField.text]) {
return;
}
if (StringIsNullOrEmpty(self.smsCodeView.textField.text)) {
[MBProgressHUD showMessage:@"请填入验证码"];
return;
}
if (StringIsNullOrEmpty(self.passwordView.textField.text)) {
[MBProgressHUD showMessage:@"请输入密码"];
return;
}
if (!self.privacy) {
[MBProgressHUD showMessage:@"请阅读并同意快服务骑士协议及隐私协议"];
return;
}
[pdic setAnyObject:self.phoneView.textField.text forKey:@"mobile"];
[pdic setAnyObject:@"" forKey:@"nickname"];
[pdic setAnyObject:self.passwordView.textField.text forKey:@"password"];
[pdic setAnyObject:self.smsCodeView.textField.text forKey:@"pin"];
[pdic setObject:S(@"%f", [AppConfig getLocationCoordinate].latitude) forKey:@"user_lat"];
[pdic setObject:S(@"%f", [AppConfig getLocationCoordinate].longitude) forKey:@"user_lng"];
[pdic setObject:@"" forKey:@"clientid"];
[pdic setAnyObject:[AppConfig getLocationName] forKey:@"city"];
[pdic setAnyObject:[AppConfig getDistrictName] forKey:@"district"];
NSLog(@"%@",pdic);
IMP_BLOCK_SELF(XVRegisterViewController);
showIndicator(YES, @"注册中", nil);
showFullView(YES, self);
NSURLSessionTask * task2 = [[AFNetworkingClient sharedClient] runPost:SS_SIGN parameters:pdic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)task.response;
NSDictionary *dictionary = [httpResponse allHeaderFields];
UserInfo * userInfo = [UserInfo mj_objectWithKeyValues:[responseObject objectForKey:@"data"]];
userInfo.mobile = block_self.phoneView.textField.text;
if (StringNotNullAndEmpty([dictionary objectForKey:@"Set-Cookie"])) {
userInfo.cookie = [dictionary objectForKey:@"Set-Cookie"];
}else{
[TestClient dicMobClickStatistics:@"respNoCookie"];
}
[AppConfig setUser:userInfo];
//环信登录
NSString *spw = responseObject[@"data"][@"spw"];
[MyNetWork easeLoginWithUsername:S(@"%d",userInfo.user_id) spw:spw];
[[NSNotificationCenter defaultCenter] postNotificationName:kAppUserLogin object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:kAppSigin object:nil];
[block_self back];
showIndicator(NO, @"登录中", ^{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
});
}else{
showIndicator(NO, @"登录中", ^{
[MBProgressHUD showMessage:[responseObject objectForKey:@"resperr"]];
});
}
showFullView(NO, block_self);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
showIndicator(NO, nil, nil);
showFullView(NO, block_self);
}];
}
- (UIView *)containerView { - (UIView *)containerView {
if(_containerView == nil) { if(_containerView == nil) {
_containerView = [[UIView alloc]init]; _containerView = [[UIView alloc]init];
...@@ -148,20 +375,48 @@ ...@@ -148,20 +375,48 @@
// //
- (XVInputFieldView *)phoneView { - (XVInputFieldView *)phoneView {
if(_phoneView == nil) { if(_phoneView == nil) {
_phoneView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入手机号"]; _phoneView = [[XVInputFieldView alloc]initWithType:InputTypeNumber placeholder:@"请输入手机号"];
IMP_BLOCK_SELF(XVRegisterViewController)
_phoneView.textEditingChanged = ^(NSString * _Nonnull obj) {
block_self.phone = obj;
if (StringIsNullOrEmpty(obj) || StringIsNullOrEmpty(block_self.imgCode)) {
[block_self.smsCodeView.smsCodeButton setBackgroundColor:BB_3_COLOR];
}else{
[block_self.smsCodeView.smsCodeButton setBackgroundColor:COLOR_THEMEGRENN];
}
};
} }
return _phoneView; return _phoneView;
} }
- (XVInputFieldView *)smsCodeView { - (XVInputFieldView *)smsCodeView {
if(_smsCodeView == nil) { if(_smsCodeView == nil) {
_smsCodeView = [[XVInputFieldView alloc]initWithType:InputTypeNumber placeholder:@"请输入验证码"]; _smsCodeView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入验证码"];
IMP_BLOCK_SELF(XVRegisterViewController)
[_smsCodeView.smsCodeButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
[block_self loadVerifycode:0];
}];
} }
return _smsCodeView; return _smsCodeView;
} }
- (XVInputFieldView *)imgCodeView { - (XVInputFieldView *)imgCodeView {
if(_imgCodeView == nil) { if(_imgCodeView == nil) {
_imgCodeView = [[XVInputFieldView alloc]initWithType:InputTypeSmsCode placeholder:@"请输入图片验证码"]; _imgCodeView = [[XVInputFieldView alloc]initWithType:InputTypePicCode placeholder:@"请输入图片验证码"];
IMP_BLOCK_SELF(XVRegisterViewController)
[_imgCodeView.picCodeButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
[block_self loadPicVerfData];
}];
_imgCodeView.textEditingChanged = ^(NSString * _Nonnull obj) {
block_self.imgCode = obj;
if (StringIsNullOrEmpty(obj) || StringIsNullOrEmpty(block_self.phone)) {
[block_self.smsCodeView.smsCodeButton setBackgroundColor:BB_3_COLOR];
}else{
[block_self.smsCodeView.smsCodeButton setBackgroundColor:COLOR_THEMEGRENN];
}
};
} }
return _imgCodeView; return _imgCodeView;
} }
...@@ -175,17 +430,11 @@ ...@@ -175,17 +430,11 @@
} }
- (UIButton *)registerButton { - (UIButton *)registerButton {
if(_registerButton == nil) { if(_registerButton == nil) {
_registerButton = [[UIButton alloc]initWithTitle:@"注册" fontSize:16 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN]; _registerButton = [[UIButton alloc]initWithTitle:@"注册" fontSize:16 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
WS(weakSelf);
[_registerButton addBlockForControlEvents:UIControlEventTouchUpInside block:^(id _Nonnull sender) {
}]; [_registerButton addTarget:self action:@selector(registerButtonClick) forControlEvents:UIControlEventTouchUpInside];
} }
return _registerButton; return _registerButton;
} }
...@@ -213,7 +462,7 @@ ...@@ -213,7 +462,7 @@
[text appendAttributedString: attachment]; [text appendAttributedString: attachment];
IMP_BLOCK_SELF(XVRegisterViewController)
NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc] initWithString:@" 我已阅读并同意"]; NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc] initWithString:@" 我已阅读并同意"];
str1.font = font; str1.font = font;
str1.color = color; str1.color = color;
...@@ -227,7 +476,7 @@ ...@@ -227,7 +476,7 @@
YYTextHighlight *highlight = [YYTextHighlight new]; YYTextHighlight *highlight = [YYTextHighlight new];
highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { highlight.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
[block_self toWebView:SS_SERVICE_AGREEMENT name:@"骑士协议"];
}; };
[str2 setTextHighlight:highlight range:str2.rangeOfAll]; [str2 setTextHighlight:highlight range:str2.rangeOfAll];
...@@ -241,14 +490,14 @@ ...@@ -241,14 +490,14 @@
[text appendAttributedString:str3]; [text appendAttributedString:str3];
NSMutableAttributedString *str4 = [[NSMutableAttributedString alloc] initWithString:@"《隐私协议》"]; NSMutableAttributedString *str4 = [[NSMutableAttributedString alloc] initWithString:@"隐私协议"];
str4.font = font; str4.font = font;
str4.color = BLUE_COLOR; str4.color = BLUE_COLOR;
YYTextHighlight *highlight1 = [YYTextHighlight new]; YYTextHighlight *highlight1 = [YYTextHighlight new];
highlight1.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) { highlight1.tapAction = ^(UIView *containerView, NSAttributedString *text, NSRange range, CGRect rect) {
[block_self toWebView:SS_PRIVACY_COURIER name:@"隐私协议"];
}; };
[str4 setTextHighlight:highlight1 range:str4.rangeOfAll]; [str4 setTextHighlight:highlight1 range:str4.rangeOfAll];
...@@ -262,5 +511,14 @@ ...@@ -262,5 +511,14 @@
return _protocolLabel; return _protocolLabel;
} }
- (void)toWebView:(NSString *)url name:(NSString *)name {
NSString * path = S(@"%@%@",[AFNetworkingClient baseURLString],url);
XVWebViewController *web = [[XVWebViewController alloc]init];
[web loadWebURLSring:path];
[self.navigationController pushViewController:web animated:YES];
}
@end @end
...@@ -13,7 +13,7 @@ typedef enum : NSUInteger { ...@@ -13,7 +13,7 @@ typedef enum : NSUInteger {
InputTypeNumber, InputTypeNumber,
InputTypeText, InputTypeText,
InputTypePassword, InputTypePassword,
InputTypeCode, InputTypePicCode,
InputTypeSmsCode, InputTypeSmsCode,
} InputType; } InputType;
...@@ -27,6 +27,11 @@ typedef enum : NSUInteger { ...@@ -27,6 +27,11 @@ typedef enum : NSUInteger {
@property (nonatomic, strong) UIButton *smsCodeButton; @property (nonatomic, strong) UIButton *smsCodeButton;
@property (nonatomic, strong) UIButton *picCodeButton;
@property (nonatomic, strong) UILabel *voiceLabel;
@property (nonatomic,copy) void(^textEditingChanged)(NSString *obj); @property (nonatomic,copy) void(^textEditingChanged)(NSString *obj);
/// 创建 /// 创建
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@interface XVInputFieldView()<UITextFieldDelegate> @interface XVInputFieldView()<UITextFieldDelegate>
@property (nonatomic, strong) UIView *lineView; @property (nonatomic, strong) UIView *lineView;
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic,assign) InputType type; @property (nonatomic,assign) InputType type;
...@@ -22,7 +22,9 @@ ...@@ -22,7 +22,9 @@
- (instancetype)initWithType:(InputType)type placeholder:(NSString *)placeholder { - (instancetype)initWithType:(InputType)type placeholder:(NSString *)placeholder {
if (self = [super init]) { if (self = [super init]) {
self.type = type; self.type = type;
self.textField.placeholder = placeholder; NSAttributedString *attr = [[NSAttributedString alloc]initWithString:placeholder attributes:@{NSForegroundColorAttributeName : kHexRGB(0x737272),NSFontAttributeName:[UIFont systemFontOfSize:14]}];
self.textField.attributedPlaceholder = attr;
[self setupUI]; [self setupUI];
} }
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
[self addSubview:self.lineView]; [self addSubview:self.lineView];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self); make.bottom.mas_equalTo(self);
make.height.mas_equalTo(0.5); make.height.mas_equalTo(1);
make.left.mas_equalTo(self).mas_offset(0); make.left.mas_equalTo(self).mas_offset(0);
make.right.mas_equalTo(self).mas_offset(0); make.right.mas_equalTo(self).mas_offset(0);
}]; }];
...@@ -60,6 +62,13 @@ ...@@ -60,6 +62,13 @@
make.right.mas_equalTo(self).mas_offset(-7); make.right.mas_equalTo(self).mas_offset(-7);
make.centerY.mas_equalTo(self.textField); make.centerY.mas_equalTo(self.textField);
}]; }];
self.voiceLabel.hidden = NO;
[self addSubview:self.voiceLabel];
self.voiceLabel.text = @"密码长度6-20位";
[self.voiceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.textField);
make.top.mas_equalTo(self.lineView.mas_bottom).mas_offset(5);
}];
} }
if(self.type == InputTypeSmsCode) { if(self.type == InputTypeSmsCode) {
...@@ -74,6 +83,28 @@ ...@@ -74,6 +83,28 @@
}]; }];
kViewBorderRadius(self.smsCodeButton, 4, 0, [UIColor clearColor]); kViewBorderRadius(self.smsCodeButton, 4, 0, [UIColor clearColor]);
[self addSubview:self.voiceLabel];
[self.voiceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.textField);
make.top.mas_equalTo(self.lineView.mas_bottom).mas_offset(5);
}];
}
if (self.type == InputTypePicCode) {
[self addSubview:self.picCodeButton];
[self.picCodeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).mas_offset(-7);
make.centerY.mas_equalTo(self.textField);
make.height.mas_equalTo(30);
make.width.mas_equalTo(70);
}];
} }
if(self.type == InputTypeNumber) { if(self.type == InputTypeNumber) {
...@@ -114,7 +145,7 @@ ...@@ -114,7 +145,7 @@
- (UIView *)lineView { - (UIView *)lineView {
if (_lineView == nil) { if (_lineView == nil) {
_lineView = [[UIView alloc]init]; _lineView = [[UIView alloc]init];
_lineView.backgroundColor = EF_3_COLOR; _lineView.backgroundColor = BB_3_COLOR;
} }
return _lineView; return _lineView;
} }
...@@ -138,11 +169,19 @@ ...@@ -138,11 +169,19 @@
return _smsCodeButton; return _smsCodeButton;
} }
- (UIImageView *)imageView { - (UIButton *)picCodeButton {
if (_imageView == nil) { if (_picCodeButton == nil) {
_imageView = [[UIImageView alloc]init]; _picCodeButton = [[UIButton alloc]init];
[_picCodeButton setBackgroundColor:BB_3_COLOR];
} }
return _imageView; return _picCodeButton;
} }
- (UILabel *)voiceLabel {
if (_voiceLabel == nil) {
_voiceLabel = [[UILabel alloc]initWithText:@"收不到验证码?来个语音验证码吧" textColor:F_BCBCBC_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:12];
_voiceLabel.hidden = YES;
}
return _voiceLabel;
}
@end @end
...@@ -45,8 +45,24 @@ ...@@ -45,8 +45,24 @@
[super viewDidLoad]; [super viewDidLoad];
[self setupUI]; [self setupUI];
[self getMarqueeData];
}
- (void)getMarqueeData {
[[AFNetworkingClient sharedClient] runGET:HOME_OVERORDER_SHOW parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
dispatch_async(dispatch_get_main_queue(), ^{
self.marqueeView.scrollTitle = responseObject[@"data"][@"msg"];
[self.marqueeView beginScrolling];
});
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
} }
- (void)setupUI { - (void)setupUI {
...@@ -76,7 +92,9 @@ ...@@ -76,7 +92,9 @@
[self.view addSubview:self.sortView]; [self.view addSubview:self.sortView];
CGFloat h = (SCREEN_HEIGHT - self.listContainerView.top) / 2; CGFloat top = KTOP_HEIGHT + 50 + 30 + 15;
CGFloat h = (SCREEN_HEIGHT - top) / 2;
self.dragView = [[WMDragView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-48, h, 48, 48)]; self.dragView = [[WMDragView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-48, h, 48, 48)];
...@@ -85,7 +103,7 @@ ...@@ -85,7 +103,7 @@
[self.view addSubview:self.dragView]; [self.view addSubview:self.dragView];
self.dragView.isKeepBounds = YES; self.dragView.isKeepBounds = YES;
self.dragView.freeRect = CGRectMake(SCREEN_WIDTH/2, self.listContainerView.top, SCREEN_WIDTH/2, h-100); self.dragView.freeRect = CGRectMake(SCREEN_WIDTH/2, top, SCREEN_WIDTH/2, h-100);
self.dragView.keepDirection = WMKeepDirectionInitialize; self.dragView.keepDirection = WMKeepDirectionInitialize;
WS(weakSelf) WS(weakSelf)
...@@ -230,8 +248,8 @@ ...@@ -230,8 +248,8 @@
_marqueeView.scrollSpace = 100; _marqueeView.scrollSpace = 100;
_marqueeView.backgroundColor = kHexRGB(0xDBDBDB); _marqueeView.backgroundColor = kHexRGB(0xDBDBDB);
_marqueeView.scrollTitleColor = [UIColor whiteColor]; _marqueeView.scrollTitleColor = [UIColor whiteColor];
_marqueeView.frame = CGRectMake(10, self.barView.height + self.categoryView.height, SCREEN_WIDTH-20, 31); _marqueeView.frame = CGRectMake(10, self.barView.height + 6 + self.categoryView.height, SCREEN_WIDTH-20, 31);
kViewBorderRadius(_marqueeView, 8, 0, kHexRGB(0xDBDBDB)); kViewBorderRadius(_marqueeView, 15, 0, kHexRGB(0xDBDBDB));
} }
return _marqueeView; return _marqueeView;
} }
......
...@@ -24,3 +24,130 @@ static NSString * const kAppServerError = @"kAppServerError"; ...@@ -24,3 +24,130 @@ static NSString * const kAppServerError = @"kAppServerError";
* 服务器慢通知 * 服务器慢通知
*/ */
static NSString * const kAppServerLow = @"kAppServerLow"; static NSString * const kAppServerLow = @"kAppServerLow";
/**
* 注册
*/
static NSString * const kAppSigin = @"kAppSigin";
/**
* 用户登录通知
*/
static NSString * const kAppUserLogin = @"kAppUserLogin" ;
/**
* 用户退出通知
*/
static NSString * const kAppUserLogout = @"kAppUserLogout" ;
/**
* 骑士认证通知
*/
static NSString * const kAppCourierCer = @"kAppCourierCer" ;
/**
* 定位成功后的通知
*/
static NSString * const kAppHasLocatonInfo = @"kAppHasLocatonInfo" ;
/**
* 定位成功后的通知,导航专用
*/
static NSString * const kAppNaviLocatonInfo = @"kAppNaviLocatonInfo" ;
/**
* 个推通知
*/
static NSString * const kAppGTNotification = @"kAppGTNotification" ;
/**
* 环信通知
*/
static NSString * const kAppHXNotification = @"kAppHXNotification" ;
/**
* 本地通知
*/
static NSString * const kAppBDNotification = @"kAppBDNotification" ;
/**
* 微信授权通知
*/
static NSString * const kAppWXAUTHNotification = @"kAppWXAUTHNotification" ;
/**
* 其他途径跳转到app传来参数
*/
static NSString * const kAppTOAPPNotification = @"kAppTOAPPNotification";
/**
* 切换城市
*/
static NSString * const kAppSCWPOINotification = @"selectCityWithPoiSearch";
/**
* 抢单成功
*/
static NSString * const kAppGetOrderSuccess = @"kAppGetOrderSuccess";
/**
* 检索 appkey error
*/
static NSString * const kAppKeyErrorNotification = @"kAppKeyErrorNotification";
/**
* 更新用户基本信息
*/
static NSString * const kUpdateUserinfoNotification = @"kUpdateUserinfoNotification";
/**
* 更新用户基本信息成功
*/
static NSString * const kAppLoadProfileSuccess = @"kAppLoadProfileSuccess";
/**
* 定位服务未开启
*/
static NSString * const kAppLocationServerNoOpen = @"locationServer";
/**
* 开启语音播报
*/
static NSString * const kAppSoundOFFON = @"kAppSoundOFFON";
/**
* app测试 推送测试
*/
static NSString * const kAppPushTest = @"kAppPushTest";
/**
* 通知定时屏蔽新订单弹框
*/
static NSString * const kNewOrderNotification = @"kNewOrderNotification";
/**
* 新订单消息
*/
static NSString * const kAppNewOrderMessage = @"kAppNewOrderMessage";
static NSString * const kAppOrderListClickMessage = @"kAppOrderListClickMessage";
/**
滑动抢单
*/
static NSString * const kAppOrderSliderMessage = @"kAppOrderSliderMessage";
/**
切换抢单模式
*/
static NSString * const kAppOrderSwitchSliderMessage = @"kAppOrderSwitchSliderMessage";
/**
添加新订单
*/
static NSString * const kAppOrderAdd2ListMessage = @"kAppOrderAdd2ListMessage";
/**
取消抢单
*/
static NSString * const kAppOrderCancleMessage = @"kAppOrderCancleMessage";
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
#import "XVVerticalButton.h" #import "XVVerticalButton.h"
#import "XVSettingViewController.h" #import "XVSettingViewController.h"
#import "XVMyViewController.h" #import "XVMyViewController.h"
#import "HomeBannerModel.h"
#import "XVWebViewController.h"
@interface XVPersonalViewController () @interface XVPersonalViewController ()<SDCycleScrollViewDelegate>
@property (nonatomic, strong) UIImageView *userImageView; @property (nonatomic, strong) UIImageView *userImageView;
...@@ -57,6 +59,10 @@ ...@@ -57,6 +59,10 @@
@property (nonatomic, strong) UIButton *serviceButton; @property (nonatomic, strong) UIButton *serviceButton;
@property (nonatomic, strong) UserInfo *userInfo;
@property (nonatomic, strong) NSArray<HomeBannerModel *>* bannerList;
@end @end
...@@ -66,6 +72,121 @@ ...@@ -66,6 +72,121 @@
[super viewDidLoad]; [super viewDidLoad];
self.w = SCREEN_WIDTH * 0.8 - 12; self.w = SCREEN_WIDTH * 0.8 - 12;
[self setupUI]; [self setupUI];
[self loadData];
[self loadMenuData];
}
- (void)loadData {
IMP_BLOCK_SELF(XVPersonalViewController);
[MyNetWork loginAfterLoadUserProfile:^(UserInfo *userInfo) {
[block_self setupViews:userInfo];
}];
}
//横幅banner
- (void)loadMenuData{
NSMutableDictionary * pDic = [NSMutableDictionary dictionary];
[pDic setObject:@([AppConfig getUserInfo].user_id) forKey: @"user_id"];
[pDic setObject:@([AppConfig getGroupID]) forKey: @"group_id"];
//参数 city 和 district
pDic = [MyNetWork parameterShowCityAndDistrict:pDic];
IMP_BLOCK_SELF(XVPersonalViewController);
NSURLSessionTask * task = [[AFNetworkingClient sharedClient] runPost:SS_GET_SMENU parameters:pDic success:^(NSURLSessionDataTask *task, id responseObject) {
if ([MyNetWork isSuccessServerData:responseObject]) {
NSArray<HomeBannerModel *>* bannerList = [HomeBannerModel mj_objectArrayWithKeyValuesArray:responseObject[@"data"][@"banner_data"]];
self.bannerList = bannerList;
NSMutableArray *imgGorup = [NSMutableArray arrayWithCapacity:bannerList.count];
for (HomeBannerModel *model in bannerList) {
[imgGorup addObject:model.banner_url];
}
block_self.cycleScrollView.imageURLStringsGroup = imgGorup;
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)setupViews:(UserInfo *)userInfo {
self.userInfo = userInfo;
if (StringIsNullOrEmpty(userInfo.headPortrait)) {
self.userImageView.image = userInfo.b.gender == 2 ? IMG(@"woman") : IMG(@"man");
}else{
self.userImageView.image = [UIImage imageNamed:userInfo.headPortrait];
}
self.nameLabel.text = userInfo.b.nickname;
NSString *phone = self.userInfo.b.mobile;
if (phone && phone.length > 7) {
phone = [phone stringByReplacingCharactersInRange:NSMakeRange(phone.length -8, 4) withString:@"****"];//防止号码有前缀所以使用倒数第8位开始替换
}
self.phoneLabel.text = phone;
// 实名认证状态
int flag = userInfo.c.c_s;
if (flag == 2 || flag == 3 || flag == 6) {
self.healthButton.selected = YES;
}else{
self.healthButton.selected = NO;
}
// 服务保障状态
self.idButton.selected = userInfo.c.g_s == 1;
//0=铁牌骑士,1=铜牌骑士,2=银牌骑士,3=金牌骑士,4=钻石骑士
switch (userInfo.c.l) {
case 0:
self.levelImageView.image = IMG(@"tiepai");
break;
case 1:
self.levelImageView.image = IMG(@"tongpai");
break;
case 2:
self.levelImageView.image = IMG(@"yinpai");
break;
case 3:
self.levelImageView.image = IMG(@"jinpai");
break;
case 4:
self.levelImageView.image = IMG(@"zuanshi");
break;
default:
self.levelImageView.image = IMG(@"zhuansong");
break;
}
}
- (void)eyeButtonClick {
self.eyeButton.selected = ! self.eyeButton.selected;
if (self.eyeButton.selected) {
self.phoneLabel.text = self.userInfo.b.mobile;
}else{
NSString *phone = self.userInfo.b.mobile;
if (phone && phone.length > 7) {
phone = [phone stringByReplacingCharactersInRange:NSMakeRange(phone.length -8, 4) withString:@"****"];//防止号码有前缀所以使用倒数第8位开始替换
}
self.phoneLabel.text = phone;
}
}
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
HomeBannerModel *model = self.bannerList[index];
XVWebViewController *web = [[XVWebViewController alloc]init];
[web loadWebURLSring:model.obj_url];;
web.titleName = model.title;
[self cw_pushViewController:web];
} }
- (void)setupUI { - (void)setupUI {
...@@ -81,6 +202,7 @@ ...@@ -81,6 +202,7 @@
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.userImageView.mas_right).mas_offset(13); make.left.mas_equalTo(self.userImageView.mas_right).mas_offset(13);
make.top.mas_equalTo(self.userImageView); make.top.mas_equalTo(self.userImageView);
make.width.mas_equalTo(70);
}]; }];
[self.view addSubview:self.levelImageView]; [self.view addSubview:self.levelImageView];
...@@ -246,7 +368,7 @@ ...@@ -246,7 +368,7 @@
- (UILabel *)nameLabel { - (UILabel *)nameLabel {
if(_nameLabel == nil) { if(_nameLabel == nil) {
_nameLabel = [[UILabel alloc]initWithText:@"骑士" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:26]; _nameLabel = [[UILabel alloc]initWithText:@"骑士" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
} }
return _nameLabel; return _nameLabel;
} }
...@@ -261,6 +383,7 @@ ...@@ -261,6 +383,7 @@
- (UIButton *)eyeButton { - (UIButton *)eyeButton {
if (_eyeButton == nil) { if (_eyeButton == nil) {
_eyeButton = [[UIButton alloc]initWithNormalImageName:@"closeeyes" selectedImgName:@"openeyes"]; _eyeButton = [[UIButton alloc]initWithNormalImageName:@"closeeyes" selectedImgName:@"openeyes"];
[_eyeButton addTarget:self action:@selector(eyeButtonClick) forControlEvents:UIControlEventTouchUpInside];
} }
return _eyeButton; return _eyeButton;
} }
...@@ -327,6 +450,7 @@ ...@@ -327,6 +450,7 @@
- (SDCycleScrollView *)cycleScrollView { - (SDCycleScrollView *)cycleScrollView {
if (_cycleScrollView == nil) { if (_cycleScrollView == nil) {
_cycleScrollView = [[SDCycleScrollView alloc]initWithFrame:CGRectMake(6, 99+9, self.w, 74)]; _cycleScrollView = [[SDCycleScrollView alloc]initWithFrame:CGRectMake(6, 99+9, self.w, 74)];
_cycleScrollView.delegate = self;
} }
return _cycleScrollView; return _cycleScrollView;
} }
......
//
// HomeBannerModel.h
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeBannerModel : NSObject
//banner
@property (nonatomic,copy) NSString *banner_url;
@property (nonatomic,copy) NSString *obj_url;
@property (nonatomic,copy) NSString *title;
//分享
@property (nonatomic,copy) NSString *content;
@property (nonatomic,copy) NSString *img_url;
@property (nonatomic,copy) NSString *share_title;
@end
NS_ASSUME_NONNULL_END
//
// HomeBannerModel.m
// fastservice
//
// Created by xuning on 5/8/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "HomeBannerModel.h"
@implementation HomeBannerModel
@end
...@@ -12,11 +12,13 @@ ...@@ -12,11 +12,13 @@
#import <YYKit.h> #import <YYKit.h>
#import "MJExtension.h" #import "MJExtension.h"
#import "UIImageView+WebCache.h" #import <UIImageView+WebCache.h>
#import <UIButton+WebCache.h>
#import <UIScrollView+EmptyDataSet.h> #import <UIScrollView+EmptyDataSet.h>
#import <MBProgressHUD.h> #import <MBProgressHUD.h>
#import <Masonry.h> #import <Masonry.h>
#import <MJRefresh/MJRefresh.h> #import <MJRefresh/MJRefresh.h>
#import <IQKeyboardManager/IQKeyboardManager.h>
//#import "WRNavigationBar.h" //#import "WRNavigationBar.h"
#import <LEEAlert.h> #import <LEEAlert.h>
#import "UINavigationController+FDFullscreenPopGesture.h" #import "UINavigationController+FDFullscreenPopGesture.h"
...@@ -46,6 +48,9 @@ ...@@ -46,6 +48,9 @@
#import "TestClient.h" #import "TestClient.h"
#import "XVAlertTools.h" #import "XVAlertTools.h"
#import "AppTools.h" #import "AppTools.h"
#import "AFNetworkingClient.h"
#import "MyNetWork.h"
#import "GlobalNetManager.h"
#endif #endif
......
...@@ -24,6 +24,9 @@ target 'fastservice' do ...@@ -24,6 +24,9 @@ target 'fastservice' do
pod 'SDCycleScrollView' pod 'SDCycleScrollView'
pod 'MBProgressHUD' pod 'MBProgressHUD'
pod 'LEEAlert' pod 'LEEAlert'
pod 'AvoidCrash' pod 'AvoidCrash'
...@@ -39,7 +42,14 @@ target 'fastservice' do ...@@ -39,7 +42,14 @@ target 'fastservice' do
pod 'CWLateralSlide', '~> 1.6.3' pod 'CWLateralSlide', '~> 1.6.3'
pod 'HWPanModal', '~> 0.9.9' pod 'HWPanModal', '~> 0.9.9'
# pod 'FloatingPanel'
pod 'HyphenateLite'
pod "Qiniu", "~> 8.3.1"
pod 'SobotKit'
pod 'Pingpp/Wx', '2.2.34'
pod 'Pingpp/Alipay', '2.2.34'
end end
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