diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 154ceae..b412864 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -19,6 +19,12 @@ 83346AD4212BFF6E0054D597 /* UserGuardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83346AD3212BFF6E0054D597 /* UserGuardViewController.m */; }; 83346AD7212C18F50054D597 /* GiGaAppGaurdVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83346AD6212C18F50054D597 /* GiGaAppGaurdVC.m */; }; 833DA7762122A62000A5C614 /* GiGaMaskTaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 833DA7752122A62000A5C614 /* GiGaMaskTaskViewController.m */; }; + 8340BF9E213E3846008F22E4 /* SHineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BF9D213E3846008F22E4 /* SHineLabel.m */; }; + 8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFA1213E60DD008F22E4 /* GIGAMBHUDHelper.m */; }; + 8340BFA6213E6514008F22E4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8340BFA5213E6514008F22E4 /* Localizable.strings */; }; + 8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8340BFA8213E65CA008F22E4 /* GIGACommonLocalizabe.strings */; }; + 8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8340BFAA213E665D008F22E4 /* GIGAUserLocalizable.strings */; }; + 8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */; }; 8342D9FD2131150200D16B1D /* 4481.wav in Resources */ = {isa = PBXBuildFile; fileRef = 8342D9FC2131150200D16B1D /* 4481.wav */; }; 8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */; }; 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 835060A1212D1225007E6220 /* GiGaMeViewController.m */; }; @@ -102,6 +108,7 @@ 83BFAE73213CDB58004EF801 /* GiSysSettingsVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BFAE72213CDB58004EF801 /* GiSysSettingsVC.m */; }; 83BFAE77213CDE91004EF801 /* GiGaSettingsViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BFAE75213CDE91004EF801 /* GiGaSettingsViewCell.m */; }; 83BFAE78213CDE91004EF801 /* GiGaSettingsViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83BFAE76213CDE91004EF801 /* GiGaSettingsViewCell.xib */; }; + 83BFAE7B213D3F3A004EF801 /* MaskTimeCircularProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BFAE7A213D3F3A004EF801 /* MaskTimeCircularProgressView.m */; }; 83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E40B2A21218B6F008149C4 /* GiGaExercisesViewController.m */; }; 83E40B2F21218BA0008149C4 /* GiGaUserViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E40B2E21218BA0008149C4 /* GiGaUserViewController.m */; }; /* End PBXBuildFile section */ @@ -144,6 +151,17 @@ 83346AD6212C18F50054D597 /* GiGaAppGaurdVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaAppGaurdVC.m; sourceTree = ""; }; 833DA7742122A62000A5C614 /* GiGaMaskTaskViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMaskTaskViewController.h; sourceTree = ""; }; 833DA7752122A62000A5C614 /* GiGaMaskTaskViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaMaskTaskViewController.m; sourceTree = ""; }; + 8340BF9C213E3846008F22E4 /* SHineLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SHineLabel.h; sourceTree = ""; }; + 8340BF9D213E3846008F22E4 /* SHineLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SHineLabel.m; sourceTree = ""; }; + 8340BFA0213E60DD008F22E4 /* GIGAMBHUDHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGAMBHUDHelper.h; sourceTree = ""; }; + 8340BFA1213E60DD008F22E4 /* GIGAMBHUDHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGAMBHUDHelper.m; sourceTree = ""; }; + 8340BFA3213E638A008F22E4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = ""; }; + 8340BFA4213E638A008F22E4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; }; + 8340BFA5213E6514008F22E4 /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; + 8340BFA8213E65CA008F22E4 /* GIGACommonLocalizabe.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = GIGACommonLocalizabe.strings; sourceTree = ""; }; + 8340BFAA213E665D008F22E4 /* GIGAUserLocalizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = GIGAUserLocalizable.strings; sourceTree = ""; }; + 8340BFAD213E739D008F22E4 /* GiGaNoNetWorkView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaNoNetWorkView.h; sourceTree = ""; }; + 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaNoNetWorkView.m; sourceTree = ""; }; 8342D9FC2131150200D16B1D /* 4481.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = 4481.wav; sourceTree = ""; }; 8349585A212511040064DB6C /* AppDelegate+ThirdParty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdParty.h"; sourceTree = ""; }; 8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+ThirdParty.m"; sourceTree = ""; }; @@ -292,6 +310,8 @@ 83BFAE74213CDE91004EF801 /* GiGaSettingsViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaSettingsViewCell.h; sourceTree = ""; }; 83BFAE75213CDE91004EF801 /* GiGaSettingsViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaSettingsViewCell.m; sourceTree = ""; }; 83BFAE76213CDE91004EF801 /* GiGaSettingsViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GiGaSettingsViewCell.xib; sourceTree = ""; }; + 83BFAE79213D3F3A004EF801 /* MaskTimeCircularProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeCircularProgressView.h; sourceTree = ""; }; + 83BFAE7A213D3F3A004EF801 /* MaskTimeCircularProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeCircularProgressView.m; sourceTree = ""; }; 83E40B2921218B6F008149C4 /* GiGaExercisesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaExercisesViewController.h; sourceTree = ""; }; 83E40B2A21218B6F008149C4 /* GiGaExercisesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaExercisesViewController.m; sourceTree = ""; }; 83E40B2D21218BA0008149C4 /* GiGaUserViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaUserViewController.h; sourceTree = ""; }; @@ -360,6 +380,34 @@ path = Source; sourceTree = ""; }; + 8340BF9F213E6080008F22E4 /* GIGAMBHUDHelper */ = { + isa = PBXGroup; + children = ( + 8340BFA0213E60DD008F22E4 /* GIGAMBHUDHelper.h */, + 8340BFA1213E60DD008F22E4 /* GIGAMBHUDHelper.m */, + ); + path = GIGAMBHUDHelper; + sourceTree = ""; + }; + 8340BFA7213E6532008F22E4 /* Localizable */ = { + isa = PBXGroup; + children = ( + 8340BFA5213E6514008F22E4 /* Localizable.strings */, + 8340BFA8213E65CA008F22E4 /* GIGACommonLocalizabe.strings */, + 8340BFAA213E665D008F22E4 /* GIGAUserLocalizable.strings */, + ); + path = Localizable; + sourceTree = ""; + }; + 8340BFAC213E7374008F22E4 /* Views */ = { + isa = PBXGroup; + children = ( + 8340BFAD213E739D008F22E4 /* GiGaNoNetWorkView.h */, + 8340BFAE213E739D008F22E4 /* GiGaNoNetWorkView.m */, + ); + path = Views; + sourceTree = ""; + }; 835060A6212D38BC007E6220 /* GiGaStartAdView */ = { isa = PBXGroup; children = ( @@ -429,6 +477,8 @@ 83A2270B212A97ED00B3E75C /* MaskViewBootomWaringView.m */, 83928FF82134D8F60077D2E8 /* GiGaFlyingCommitInputView.h */, 83928FF92134D8F60077D2E8 /* GiGaFlyingCommitInputView.m */, + 83BFAE79213D3F3A004EF801 /* MaskTimeCircularProgressView.h */, + 83BFAE7A213D3F3A004EF801 /* MaskTimeCircularProgressView.m */, ); path = View; sourceTree = ""; @@ -501,6 +551,7 @@ 8361B3D2212155C300238FEB /* Assets.xcassets */, 8361B3D4212155C300238FEB /* LaunchScreen.storyboard */, 8361B3D7212155C300238FEB /* Info.plist */, + 8340BFA7213E6532008F22E4 /* Localizable */, 8361B3D8212155C300238FEB /* main.m */, 8361B3FB21215BE900238FEB /* GIGA.pch */, ); @@ -528,6 +579,8 @@ 8361B3FC21215C7400238FEB /* Common */ = { isa = PBXGroup; children = ( + 8340BFAC213E7374008F22E4 /* Views */, + 8340BF9F213E6080008F22E4 /* GIGAMBHUDHelper */, 83928FFF2134F4230077D2E8 /* LXDanMuManager */, 83928FFB2134F37D0077D2E8 /* SocketRocketUtility */, 838388CB212FB7D700D14C53 /* JXTAlertManager */, @@ -571,6 +624,8 @@ 83835BCC212E856A001480F2 /* NSString+MD5.m */, 838500DA2137F3F7003514A3 /* GiGaAttributedLabel.h */, 838500DB2137F3F7003514A3 /* GiGaAttributedLabel.m */, + 8340BF9C213E3846008F22E4 /* SHineLabel.h */, + 8340BF9D213E3846008F22E4 /* SHineLabel.m */, ); path = Category; sourceTree = ""; @@ -1048,9 +1103,12 @@ 83346AD1212BF5B70054D597 /* useragreement.html in Resources */, 838388CA212FA00200D14C53 /* MaskTime.png in Resources */, 83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */, + 8340BFA9213E65CA008F22E4 /* GIGACommonLocalizabe.strings in Resources */, 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */, 8361B3D3212155C300238FEB /* Assets.xcassets in Resources */, + 8340BFA6213E6514008F22E4 /* Localizable.strings in Resources */, 8361B3D1212155C200238FEB /* Main.storyboard in Resources */, + 8340BFAB213E665D008F22E4 /* GIGAUserLocalizable.strings in Resources */, 8342D9FD2131150200D16B1D /* 4481.wav in Resources */, 83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, @@ -1155,6 +1213,7 @@ 8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */, 83BFAE73213CDB58004EF801 /* GiSysSettingsVC.m in Sources */, 838500DC2137F3F7003514A3 /* GiGaAttributedLabel.m in Sources */, + 83BFAE7B213D3F3A004EF801 /* MaskTimeCircularProgressView.m in Sources */, 8314D2112133ABE500B458BF /* WeiIXinApiManager.m in Sources */, 83835BCA212E8045001480F2 /* GIGAQuetionView.m in Sources */, 8361B3CE212155C200238FEB /* ViewController.m in Sources */, @@ -1186,9 +1245,11 @@ 838388C8212F9C4200D14C53 /* GiGaLocalNotificationManager.m in Sources */, 83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */, 83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */, + 8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */, 83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */, 8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */, 8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */, + 8340BF9E213E3846008F22E4 /* SHineLabel.m in Sources */, 8361B4352121836700238FEB /* GiGaBaseNavViewController.m in Sources */, 835060B3212D54C2007E6220 /* GiGaAdDetailViewController.m in Sources */, 83346AC0212BB50A0054D597 /* PassWordResetVC.m in Sources */, @@ -1206,6 +1267,7 @@ 83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */, 836EE5D42136454500F0ABB2 /* RegistGetSMSCodeRequest.m in Sources */, 8361B42E2121812000238FEB /* GiGaServerConfig.m in Sources */, + 8340BFAF213E739D008F22E4 /* GiGaNoNetWorkView.m in Sources */, 836EE5DA2136716100F0ABB2 /* NSTimer+Convenience.m in Sources */, 83A22712212A9EA900B3E75C /* UIView+Sizes.m in Sources */, 839290092134F4C40077D2E8 /* GiGaFlingCommitVC.m in Sources */, @@ -1252,6 +1314,7 @@ isa = PBXVariantGroup; children = ( 8361B3D0212155C200238FEB /* Base */, + 8340BFA3213E638A008F22E4 /* zh-Hans */, ); name = Main.storyboard; sourceTree = ""; @@ -1260,6 +1323,7 @@ isa = PBXVariantGroup; children = ( 8361B3D5212155C300238FEB /* Base */, + 8340BFA4213E638A008F22E4 /* zh-Hans */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -1271,6 +1335,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1329,6 +1394,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; diff --git a/GIGA/AppDelegate+GiGaConfig.m b/GIGA/AppDelegate+GiGaConfig.m index 4d3dca1..cb804fa 100644 --- a/GIGA/AppDelegate+GiGaConfig.m +++ b/GIGA/AppDelegate+GiGaConfig.m @@ -48,10 +48,11 @@ self.window.rootViewController = self.rootTabBarVC; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; - + } -(void)initTabItems{ + UITabBar *tabBar = self.rootTabBarVC.tabBar; UITabBarItem *item0 = [tabBar.items objectAtIndex:0]; UITabBarItem *item1 = [tabBar.items objectAtIndex:1]; @@ -69,7 +70,6 @@ ; item2.image = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; - } -(void)configEnvironment{ @@ -81,10 +81,11 @@ GiGaMaskTaskViewController *maskeVC = [[GiGaMaskTaskViewController alloc] init]; GiGaBaseNavViewController *maskNav =[[GiGaBaseNavViewController alloc] initWithRootViewController:maskeVC]; maskNav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]}; - maskeVC.title = @"面膜时间"; + [maskeVC addNavTitile:GIGALocalComm(@"masktime_nav_title")]; self.window.rootViewController = maskNav; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; + } -(void)creatAdView{ @@ -109,8 +110,6 @@ //授权 [[UIApplication sharedApplication] registerUserNotificationSettings:setings]; } - - } //接收本地通知 ios 8 @@ -121,7 +120,6 @@ [[GiGaLocalNotificationManager localNotifiationCenter] didResaveloaclNitification:notification]; } - } diff --git a/GIGA/AppDelegate+ThirdParty.m b/GIGA/AppDelegate+ThirdParty.m index 2ec64d6..5188787 100644 --- a/GIGA/AppDelegate+ThirdParty.m +++ b/GIGA/AppDelegate+ThirdParty.m @@ -40,7 +40,6 @@ apsForProduction:GIGA_PUSH_ENVIRONMENT advertisingIdentifier:nil]; - //微信 [WXApi registerApp:WXin_APPID]; //bugly diff --git a/GIGA/AppDelegate.m b/GIGA/AppDelegate.m index c2260b3..090da19 100644 --- a/GIGA/AppDelegate.m +++ b/GIGA/AppDelegate.m @@ -43,14 +43,12 @@ } - - (void)applicationDidEnterBackground:(UIApplication *)application { // 当 开启面膜时间 app长期保持后台模式 if (_isMasking) { [self creatBackGoundTask]; } - } -(void)creatBackGoundTask{ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/Contents.json b/GIGA/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d6..7057612 100644 --- a/GIGA/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/GIGA/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,93 +1,111 @@ { "images" : [ { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon_20pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon_20pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon_29pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon_29pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon_40pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon_40pt@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon_60pt@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon_60pt@3x.png", "scale" : "3x" }, { - "idiom" : "ipad", "size" : "20x20", + "idiom" : "ipad", + "filename" : "icon_20pt@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "20x20", + "idiom" : "ipad", + "filename" : "icon_20pt@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon_29pt@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon_29pt@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon_40pt@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon_40pt@2x-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon_76pt@1x.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon_76pt@2x.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "icon_83.5pt@2x.png", "scale" : "2x" }, { - "idiom" : "ios-marketing", "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "icon_appstore.png", "scale" : "1x" } ], diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@1x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@1x.png new file mode 100644 index 0000000..3fd7548 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@1x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png new file mode 100644 index 0000000..455a3b1 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png new file mode 100644 index 0000000..455a3b1 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png new file mode 100644 index 0000000..eda493e Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@1x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@1x.png new file mode 100644 index 0000000..50195f2 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@1x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png new file mode 100644 index 0000000..1829f28 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png new file mode 100644 index 0000000..1829f28 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png new file mode 100644 index 0000000..866a306 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@1x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@1x.png new file mode 100644 index 0000000..455a3b1 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@1x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png new file mode 100644 index 0000000..27cae6d Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png new file mode 100644 index 0000000..27cae6d Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png new file mode 100644 index 0000000..cc5047e Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png new file mode 100644 index 0000000..cc5047e Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png new file mode 100644 index 0000000..62b1352 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@1x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@1x.png new file mode 100644 index 0000000..19fe917 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@1x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png new file mode 100644 index 0000000..7ad394d Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_83.5pt@2x.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_83.5pt@2x.png new file mode 100644 index 0000000..4b95c79 Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_83.5pt@2x.png differ diff --git a/GIGA/Assets.xcassets/AppIcon.appiconset/icon_appstore.png b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_appstore.png new file mode 100644 index 0000000..8555c9e Binary files /dev/null and b/GIGA/Assets.xcassets/AppIcon.appiconset/icon_appstore.png differ diff --git a/GIGA/Assets.xcassets/hud/Contents.json b/GIGA/Assets.xcassets/hud/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/GIGA/Assets.xcassets/hud/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json new file mode 100644 index 0000000..fb96dc7 --- /dev/null +++ b/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "hud_error@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "hud_error@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@2x.png b/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@2x.png new file mode 100644 index 0000000..1869ed7 Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@2x.png differ diff --git a/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@3x.png b/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@3x.png new file mode 100644 index 0000000..a6f1b50 Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_error.imageset/hud_error@3x.png differ diff --git a/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json new file mode 100644 index 0000000..53ff50d --- /dev/null +++ b/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "hud_info@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "hud_info@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@2x.png b/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@2x.png new file mode 100644 index 0000000..b91e906 Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@2x.png differ diff --git a/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@3x.png b/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@3x.png new file mode 100644 index 0000000..5ce78b3 Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_info.imageset/hud_info@3x.png differ diff --git a/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json new file mode 100644 index 0000000..b505d19 --- /dev/null +++ b/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "hud_ok@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "hud_ok@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@2x.png b/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@2x.png new file mode 100644 index 0000000..5d6ae72 Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@2x.png differ diff --git a/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@3x.png b/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@3x.png new file mode 100644 index 0000000..5d3775e Binary files /dev/null and b/GIGA/Assets.xcassets/hud/hud_ok.imageset/hud_ok@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json new file mode 100644 index 0000000..cd24fc3 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "img_bg@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/img_bg.imageset/img_bg@2x.png b/GIGA/Assets.xcassets/maskTime/img_bg.imageset/img_bg@2x.png new file mode 100644 index 0000000..c050549 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/img_bg.imageset/img_bg@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json new file mode 100644 index 0000000..68c9dce --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "img_bg_head@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/img_bg_head@2x.png b/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/img_bg_head@2x.png new file mode 100644 index 0000000..fd073bb Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/img_bg_head@2x.png differ diff --git a/GIGA/Category/SHineLabel.h b/GIGA/Category/SHineLabel.h new file mode 100644 index 0000000..4712d89 --- /dev/null +++ b/GIGA/Category/SHineLabel.h @@ -0,0 +1,19 @@ +// +// SHineLabel.h +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface SHineLabel : UILabel +//外光 +@property(nonatomic,retain) UIColor *outLineColor; +//里光 +@property(nonatomic,retain) UIColor *oinsideColor; +//光晕 +@property(nonatomic,retain) UIColor *blurColor; + +@end diff --git a/GIGA/Category/SHineLabel.m b/GIGA/Category/SHineLabel.m new file mode 100644 index 0000000..745e952 --- /dev/null +++ b/GIGA/Category/SHineLabel.m @@ -0,0 +1,43 @@ +// +// SHineLabel.m +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "SHineLabel.h" + +@implementation SHineLabel + +- (instancetype)init +{ + self = [super init]; + if (self) { + + } + return self; +} + +-(void)drawRect:(CGRect)rect{ + + CGContextRef ctx = UIGraphicsGetCurrentContext(); + CGContextSetStrokeColorWithColor(ctx, self.outLineColor.CGColor); + CGContextSetFillColorWithColor(ctx, self.oinsideColor.CGColor); + CGContextSetLineWidth(ctx, self.font.pointSize /60.0); + CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), self.font.pointSize / 3 , self.blurColor.CGColor); + CGTextDrawingMode mode = !self.outLineColor ? kCGTextFill:(!self.oinsideColor ? kCGTextStroke:kCGTextFillStroke); + CGContextSetTextDrawingMode(ctx, mode); + NSMutableParagraphStyle *paragraStyle = [[NSMutableParagraphStyle alloc] init]; + paragraStyle.alignment = NSTextAlignmentCenter; + + [self.text drawInRect:self.bounds withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Semibold" size:22],NSForegroundColorAttributeName:[UIColor whiteColor],NSKernAttributeName:@(4),NSParagraphStyleAttributeName:paragraStyle}]; + +} +-(void)dealloc{ + self.outLineColor = nil; + self.oinsideColor = nil; + self.blurColor = nil; + +} +@end diff --git a/GIGA/Category/UINavigationBar+Custom.h b/GIGA/Category/UINavigationBar+Custom.h index d720c33..9e6448b 100644 --- a/GIGA/Category/UINavigationBar+Custom.h +++ b/GIGA/Category/UINavigationBar+Custom.h @@ -15,6 +15,6 @@ //设置透明导航 -(void)setClearNav; --(void)resetBackgroundImage; +-(void)setBackgroundImage; @end diff --git a/GIGA/Category/UINavigationBar+Custom.m b/GIGA/Category/UINavigationBar+Custom.m index a5f1ff7..7dc53c3 100644 --- a/GIGA/Category/UINavigationBar+Custom.m +++ b/GIGA/Category/UINavigationBar+Custom.m @@ -24,13 +24,14 @@ static char overlayKey; { if (!self.overlay) { [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; - self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)]; + self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -PhoneX_STATUBAR_H, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + PhoneX_STATUBAR_H)]; self.overlay.userInteractionEnabled = NO; - self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; + //self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; [self insertSubview:self.overlay atIndex:0]; } - self.overlay.backgroundColor = backgroundColor; + self.overlay.backgroundColor = [backgroundColor colorWithAlphaComponent:0.2]; + } - (void)cnReset @@ -54,11 +55,9 @@ static char overlayKey; } --(void)resetBackgroundImage{ +-(void)setBackgroundImage{ [self setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault]; - [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; - } diff --git a/GIGA/Common/BaseVC/GiGaBaseNavViewController.m b/GIGA/Common/BaseVC/GiGaBaseNavViewController.m index dd23cec..21aaec1 100644 --- a/GIGA/Common/BaseVC/GiGaBaseNavViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseNavViewController.m @@ -24,7 +24,7 @@ -(UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleDefault; + return UIStatusBarStyleLightContent; } -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.h b/GIGA/Common/BaseVC/GiGaBaseViewController.h index 2c47fd2..72484f9 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.h +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.h @@ -7,16 +7,17 @@ // #import +#import "GiGaNoNetWorkView.h" @interface GiGaBaseViewController : UIViewController { UIView *_emptyView; - UIView *_noNetWorkView; + GiGaNoNetWorkView *_noNetWorkView; UITableView *_tableView; } @property (nonatomic,strong) UIView * emptyView; -@property (nonatomic,strong) UIView * noNetWorkView; +@property (nonatomic,strong) GiGaNoNetWorkView * noNetWorkView; @property (nonatomic,strong) UITableView *tableView; @@ -26,9 +27,13 @@ @property (nonatomic, assign) AFNetworkReachabilityStatus currentNetworkStatus; - (void)showNoNetWorkView; -- (void)showEmptyView; +- (void)removeNoNetWorkView; --(void)addNavTitile:(NSString *)title; +- (void)showEmptyView; +- (void)removeEmtyView; + + +- (void)addNavTitile:(NSString *)title; @end diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.m b/GIGA/Common/BaseVC/GiGaBaseViewController.m index 4a70e72..6024b72 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.m @@ -24,6 +24,8 @@ [super viewDidLoad]; // Do any additional setup after loading the view. + + [self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)]; } @@ -33,8 +35,10 @@ } -(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; - //[self.navigationController.navigationBar cnSetBackgroundColor:GIGAUIColorFromRGB_A(0xD8D8D8, 0.2)]; + + } -(void)addNavTitile:(NSString *)title{ @@ -43,9 +47,13 @@ } -//没有网络返回 + - (void)showNoNetWorkView { + + + + // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // if (self.currentNetworkStatus < 1) { // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -55,8 +63,27 @@ // }); } +- (void)removeNoNetWorkView{ + + if (_noNetWorkView) { + [_noNetWorkView removeFromSuperview]; + _noNetWorkView = nil; + } +} +- (UIView *)noNetWorkView{ + if (!_noNetWorkView) { + _noNetWorkView = [GiGaNoNetWorkView new]; + } + return _noNetWorkView; +} + -(void)showEmptyView{ +} + +- (void)removeEmtyView{ + + } -(void)testNetworkStatus{ diff --git a/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h new file mode 100644 index 0000000..0c2928d --- /dev/null +++ b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.h @@ -0,0 +1,35 @@ +// +// GIGAMBHUDHelper.h +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import +#import "MBProgressHUD.h" + +@interface GIGAMBHUDHelper : NSObject +/** + * Paramas is hud, notic MBProgress message. + */ ++ (void)networkError:(MBProgressHUD *)hud; ++ (void)networkError:(MBProgressHUD *)hud + title:(NSString *)aTitle; ++ (void)networkSucc:(MBProgressHUD *)hud + title:(NSString *)aTitle; ++ (void)networkInfo:(MBProgressHUD *)hud + title:(NSString *)aTitle; +/** + * Paramas is view, notic MBProgress message in view. + */ ++ (void)networkErrorAddto:(UIView *)aView; ++ (void)networkErrorAddto:(UIView *)aView + title:(NSString *)aTitle; ++ (void)networkSuccAddto:(UIView *)aView + title:(NSString *)aTitle; ++ (void)networkInfoAddto:(UIView *)aView + title:(NSString *)aTitle; ++ (void)messageAddto:(UIView *)aView title:(NSString *)aTitle; + +@end diff --git a/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.m b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.m new file mode 100644 index 0000000..8543bf9 --- /dev/null +++ b/GIGA/Common/GIGAMBHUDHelper/GIGAMBHUDHelper.m @@ -0,0 +1,91 @@ +// +// GIGAMBHUDHelper.m +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GIGAMBHUDHelper.h" + +@implementation GIGAMBHUDHelper ++ (void)networkError:(MBProgressHUD *)hud +{ + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_error"]]; + hud.labelText = GIGALocalComm(@"toast_hud_net_error"); + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; + +} ++ (void)networkError:(MBProgressHUD *)hud + title:(NSString *)aTitle +{ + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_error"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)networkSucc:(MBProgressHUD *)hud + title:(NSString *)aTitle +{ + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_ok"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)networkInfo:(MBProgressHUD *)hud + title:(NSString *)aTitle +{ + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_info"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} + +/** + * Paramas is view, notic MBProgress message in view. + */ ++ (void)networkErrorAddto:(UIView *)aView +{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES]; + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_error"]]; + hud.labelText = GIGALocalComm(@""); + + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)networkErrorAddto:(UIView *)aView + title:(NSString *)aTitle +{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES]; + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_error"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)networkSuccAddto:(UIView *)aView + title:(NSString *)aTitle +{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES]; + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_ok"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)networkInfoAddto:(UIView *)aView + title:(NSString *)aTitle +{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES]; + hud.mode = MBProgressHUDModeCustomView; + hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hud_info"]]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:HUD_DISPLAY_DURATION]; +} ++ (void)messageAddto:(UIView *)aView title:(NSString *)aTitle +{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES]; + hud.labelText = aTitle; + [hud hide:YES afterDelay:1.0f]; +} + +@end diff --git a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m index a3f6c46..b00c4fe 100644 --- a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m +++ b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m @@ -14,7 +14,8 @@ { if (self = [super initWithFrame:frame]) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)]; - label.textColor = GIGAUIColorFromRGBA(0x777777); + //label.textColor = GIGAUIColorFromRGBA(0x777777); + label.textColor = [UIColor whiteColor]; label.text = str; label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f]; label.textAlignment = NSTextAlignmentCenter; diff --git a/GIGA/Common/Views/GiGaNoNetWorkView.h b/GIGA/Common/Views/GiGaNoNetWorkView.h new file mode 100644 index 0000000..cf07fe9 --- /dev/null +++ b/GIGA/Common/Views/GiGaNoNetWorkView.h @@ -0,0 +1,13 @@ +// +// GiGaNoNetWorkView.h +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaNoNetWorkView : UIView + +@end diff --git a/GIGA/Common/Views/GiGaNoNetWorkView.m b/GIGA/Common/Views/GiGaNoNetWorkView.m new file mode 100644 index 0000000..b8db64f --- /dev/null +++ b/GIGA/Common/Views/GiGaNoNetWorkView.m @@ -0,0 +1,23 @@ +// +// GiGaNoNetWorkView.m +// GIGA +// +// Created by lianxiang on 2018/9/4. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaNoNetWorkView.h" + +@implementation GiGaNoNetWorkView + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + + } + return self; +} + + +@end diff --git a/GIGA/Config/GIGA.h b/GIGA/Config/GIGA.h index 3e1ee97..7f03868 100644 --- a/GIGA/Config/GIGA.h +++ b/GIGA/Config/GIGA.h @@ -81,9 +81,23 @@ alpha:((float)(rgbValue & 0xFF))/255.0] #define GIGA_WIndowTost(__toast__) [[UIApplication sharedApplication].keyWindow makeToast:(__toast__) duration:1.5 position:CSToastPositionCenter]; //X +//底部工具栏需要为home indicator留出34pt边距 #define PhoneX_BottomMargin ([UIScreen mainScreen].bounds.size.height == 812.0 ? 34.0 :0.0) - +//状态栏高度由20pt变成44pt,导航栏以上变化64->88。 #define PhoneX_TopMargin ([UIScreen mainScreen].bounds.size.height == 812.0 ? 24.0 :0.0) +#define PhoneX_STATUBAR_H ([UIScreen mainScreen].bounds.size.height == 812.0 ? 44.0 :20.0) + +#define GIGA_FONTNAME @"PingFangSC-Medium" +#define GIGA_FONTBOLD @"PingFangSC-Semibold" + +//国际化 +#define GIGALocalComm(key) NSLocalizedStringFromTable(key, @"GIGACommonLocalizabe", nil) +//个人中心 +#define GIGALocalUser(key) NSLocalizedStringFromTable(key, @"GIGAUserLocalizable", nil) +//HUD +#define HUD_DISPLAY_DURATION 2 +#define HUD_TIMEOUT_DURATION 8 + #endif /* GIGA_h */ diff --git a/GIGA/Config/GiGaServerConfig.m b/GIGA/Config/GiGaServerConfig.m index 726b9b1..c9ac0d0 100644 --- a/GIGA/Config/GiGaServerConfig.m +++ b/GIGA/Config/GiGaServerConfig.m @@ -14,16 +14,18 @@ #if defined(DEBUG) || defined(RELEASE_VERTION_TEST) #endif + switch (type) { case 0://测试环境 { - [[NSUserDefaults standardUserDefaults] setValue:@"http://apiyts.s1.natapp.cc/v1/" forKey:@"MainUrl"]; - } break; + } + break; case 1: //生产环境 { [[NSUserDefaults standardUserDefaults] setValue:@"https://" forKey:@"MainUrl"]; - } break; + } + break; default: break; diff --git a/GIGA/Localizable/GIGACommonLocalizabe.strings b/GIGA/Localizable/GIGACommonLocalizabe.strings new file mode 100644 index 0000000..beeba25 --- /dev/null +++ b/GIGA/Localizable/GIGACommonLocalizabe.strings @@ -0,0 +1,8 @@ +/* + GIGACommonLocalizabe.strings + GIGA + + Created by lianxiang on 2018/9/4. + Copyright © 2018年 com.giga.ios. All rights reserved. +*/ +"masktime_nav_title" = "面膜时间"; diff --git a/GIGA/Localizable/GIGAUserLocalizable.strings b/GIGA/Localizable/GIGAUserLocalizable.strings new file mode 100644 index 0000000..7b3c949 --- /dev/null +++ b/GIGA/Localizable/GIGAUserLocalizable.strings @@ -0,0 +1,7 @@ +/* + GIGAUserLocalizable.strings + GIGA + + Created by lianxiang on 2018/9/4. + Copyright © 2018年 com.giga.ios. All rights reserved. +*/ diff --git a/GIGA/Localizable/Localizable.strings b/GIGA/Localizable/Localizable.strings new file mode 100644 index 0000000..e407f90 --- /dev/null +++ b/GIGA/Localizable/Localizable.strings @@ -0,0 +1,7 @@ +/* + Localizable.strings + GIGA + + Created by lianxiang on 2018/9/4. + Copyright © 2018年 com.giga.ios. All rights reserved. +*/ diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m index 3c53419..0c5f091 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m @@ -96,7 +96,7 @@ NSDictionary *param = @{ @"mobile":phoneNumber }; - GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/sendcode" method:RequestPostMethod parms:param]; + GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/registersendcode" method:RequestPostMethod parms:param]; [api requstDataWithResult:^(GiGaAPIResult *result) { [MBProgressHUD hideHUDForView:self.view animated:YES]; diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index d8059ed..08ae68a 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -27,7 +27,6 @@ @property (weak, nonatomic) IBOutlet UIButton *weiXinLoginBtn; @property (weak, nonatomic) IBOutlet UIButton *registBtn; -@property (weak, nonatomic) IBOutlet UIImageView *wexinbtnImageView; @property (weak, nonatomic) IBOutlet UIButton *secretBtn; @end @@ -36,7 +35,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - + self.automaticallyAdjustsScrollViewInsets = NO; // Do any additional setup after loading the view from its nib. [self setUpX]; [self textFieldUI]; diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib index d59e598..e147237 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib @@ -6,7 +6,6 @@ - @@ -28,139 +27,155 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.h b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.h index 922ad5b..a0bea5f 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.h +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.h @@ -7,7 +7,7 @@ // #import - -@interface GiGaMaskTaskViewController : UIViewController +#import "GiGaBaseViewController.h" +@interface GiGaMaskTaskViewController : GiGaBaseViewController @end diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index 2600051..cb118b7 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -25,42 +25,61 @@ #import "GiGaMeViewController.h" #import "GiGaFlyingCommitInputView.h" #import "GiGaFlingCommitVC.h" -@interface GiGaMaskTaskViewController () +#import "MaskTimeCircularProgressView.h" +#import "UINavigationBar+Custom.h" + +@interface GiGaMaskTaskViewController () { AVAudioPlayer *_musicPalyer; } + @property(nonatomic,strong)MaskViewBootomWaringView *waringView; -@property(nonatomic,strong)UILabel *countLabel; -@property (strong ,nonatomic) LXCountTimer *timer; +@property(nonatomic,strong)UILabel *descLabl; +@property(nonatomic,strong)UIView *descBackView; //@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView; @property(nonatomic,strong) UIImageView *maskImageView; @property(nonatomic,strong) UIImageView *faceView; //@property(nonatomic,strong) UIDynamicAnimator *animator; //@property(nonatomic,strong) UIAttachmentBehavior *attachmentBehavior; @property(nonatomic) CGPoint attachPoint; -//@property(nonatomic) UISnapBehavior *snapBehavior; +@property(nonatomic,strong) MaskTimeCircularProgressView *cicleProgressView; @end @implementation GiGaMaskTaskViewController -//倒计时label --(UILabel *)countLabel{ - if (!_countLabel) { - _countLabel = [[UILabel alloc] init]; - _countLabel.textColor = [UIColor redColor]; - _countLabel.text = @"00:00"; - _countLabel.textAlignment = NSTextAlignmentCenter; - +//提示label +- (UILabel *)descLabl{ + if(!_descLabl){ + _descLabl = [[UILabel alloc] init]; + _descLabl.text = @"请点击或按住面膜上滑敷到脸部开始倒计时"; + _descLabl.textAlignment = NSTextAlignmentCenter; + _descLabl.numberOfLines = 2; + _descLabl.textColor = GIGARGB(89, 216, 197, 1); + _descLabl.font = [UIFont fontWithName:GIGA_FONTNAME size:11]; } - return _countLabel; + return _descLabl; } + +- (UIView *)descBackView{ + + if(!_descBackView){ + _descBackView = [[UIView alloc] init]; + _descBackView.layer.borderWidth = 1; + _descBackView.layer.borderColor = GIGARGB(120, 217, 202, 1).CGColor; + _descBackView.layer.masksToBounds = YES; + _descBackView.layer.cornerRadius = 1; + } + return _descBackView; +} + //面膜 - (UIImageView *)maskImageView{ if (!_maskImageView) { _maskImageView = [[UIImageView alloc] init]; _maskImageView.userInteractionEnabled = YES; - _maskImageView.backgroundColor = [UIColor purpleColor]; + //_maskImageView.backgroundColor = [UIColor purpleColor]; + _maskImageView.image = [UIImage imageNamed:@"img_bg"]; UIPanGestureRecognizer *pangesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)]; [_maskImageView addGestureRecognizer:pangesture]; } @@ -70,12 +89,36 @@ - (UIImageView *)faceView{ if (!_faceView) { _faceView = [[UIImageView alloc] init]; - _faceView.backgroundColor = [UIColor lightGrayColor]; + //_faceView.backgroundColor = [UIColor lightGrayColor]; _faceView.userInteractionEnabled = YES; + _faceView.image = [UIImage imageNamed:@"img_bg_head"]; } return _faceView; } +//倒计时圆环 +- (MaskTimeCircularProgressView *)cicleProgressView{ + + if (!_cicleProgressView) { + + _cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 500, 136, 136) backColor:GIGARGB(22, 22, 22, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10]; + _cicleProgressView.delegate = self; + _cicleProgressView.hidden = YES; + + } + return _cicleProgressView; +} +//底部提示栏 +- (MaskViewBootomWaringView *)waringView{ + + if (!_waringView) { + self.waringView = [[MaskViewBootomWaringView alloc] init]; + self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame), self.view.frame.size.width, 60); + } + return _waringView; +} + +//弹幕 -(void)createInputView{ GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init]; @@ -89,32 +132,18 @@ } --(LXCountTimer *)timer{ - - if (!_timer) { - _timer = [[LXCountTimer alloc] init]; - } - return _timer; -} - //滑动手势 -(void)panGestureAction:(UIPanGestureRecognizer *)pan{ CGPoint panLocation = [pan locationInView:self.view]; NSLog(@"panlocation.y:%f",panLocation.y); if (pan.state == UIGestureRecognizerStateBegan) { - [self animaMask]; -// self.attachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.faceView attachedToAnchor:self.attachPoint]; -// [self.animator addBehavior: self.attachmentBehavior ]; - }else if (pan.state == UIGestureRecognizerStateChanged){ -// [self.snapBehavior setSnapPoint:self.attachPoint]; -// [self.attachmentBehavior setAnchorPoint:panLocation]; + }else if (pan.state == UIGestureRecognizerStateEnded){ -// [self.animator addBehavior:self.snapBehavior]; -// [self.animator removeBehavior:self.attachmentBehavior]; + }else{ } @@ -123,20 +152,21 @@ #pragma mark -开始面膜时间动画 -(void)animaMask{ + self.descLabl.hidden = YES; + self.descBackView.hidden = YES; + [self.view layoutIfNeeded]; [UIView animateWithDuration:1.0 animations:^{ [self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.attachPoint.y - 50); + make.top.mas_equalTo(self.attachPoint.y - 118); }]; [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.attachPoint.y - 50); - }]; - [self.countLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.attachPoint.y + 50 + 10); + make.top.mas_equalTo(self.attachPoint.y -174); }]; + [self.view layoutIfNeeded]; } completion:^(BOOL finished) { - self.countLabel.hidden = NO; + self.cicleProgressView.hidden = NO; self.maskImageView.userInteractionEnabled = NO; //开始面膜时间 [self startMaskTime]; @@ -146,28 +176,31 @@ #pragma mark 面膜时间结束复原动画 -(void)endMaskAnimation{ - self.countLabel.hidden = YES; + self.cicleProgressView.hidden = YES; + self.descLabl.hidden = NO; + self.descBackView.hidden = NO; + [self.view layoutIfNeeded]; [UIView animateWithDuration:1.0 animations:^{ [self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(100 + 100 + 200); + make.top.mas_equalTo(314 + PhoneX_TopMargin); }]; [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(100); + make.top.mas_equalTo(103 + PhoneX_TopMargin); }]; [self.view layoutIfNeeded]; } completion:^(BOOL finished) { self.maskImageView.userInteractionEnabled = YES; + }]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - } -(void)viewDidAppear:(BOOL)animated{ @@ -181,6 +214,7 @@ [self showAPPappGaurdView]; } } + -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { @@ -196,84 +230,83 @@ [self initUI]; [self addNotify]; [self creatBackGroundMusic]; + } -(void)initUI{ + self.view.backgroundColor = GIGARGB(56, 56, 56, 1); [self.view addSubview:self.maskImageView]; [self.view addSubview:self.faceView]; [self.view bringSubviewToFront:self.maskImageView]; - [self.view addSubview:self.countLabel]; - - //self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; + [self.view addSubview:self.descBackView]; + [self.view addSubview:self.cicleProgressView]; //face [self.faceView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.view.mas_top).offset(100); - make.left.mas_equalTo(self.view.mas_centerX).offset(-50); - make.size.mas_equalTo(CGSizeMake(100, 100)); - + make.top.mas_equalTo(self.view.mas_top).offset(103 + PhoneX_TopMargin); + make.left.mas_equalTo(self.view.mas_centerX).offset(-69); + make.size.mas_equalTo(CGSizeMake(138, 174)); }]; //mask [self.maskImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.view.mas_top).offset(100 + 100 + 200); - make.left.mas_equalTo(self.view.mas_centerX).offset(-50); - make.size.mas_equalTo(CGSizeMake(100, 100)); + make.top.mas_equalTo(self.view.mas_top).offset(314 + PhoneX_TopMargin); + make.left.mas_equalTo(self.view.mas_centerX).offset(-51); + make.size.mas_equalTo(CGSizeMake(102, 118)); }]; - [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.view.mas_top).offset(200); - make.width.and.height.mas_equalTo(100); + //描述 + + [self.descBackView mas_makeConstraints:^(MASConstraintMaker *make){ + make.top.mas_equalTo(500 + PhoneX_TopMargin); + make.width.mas_equalTo(149); + make.height.mas_equalTo(45); make.centerX.mas_equalTo(self.view.mas_centerX); - }]; - self.countLabel.hidden = YES; - - UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [testBtn setTitle:@"测试肤质" forState:UIControlStateNormal]; - [testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - testBtn.backgroundColor = [UIColor blueColor]; - [testBtn addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside]; - testBtn.layer.masksToBounds = YES; - testBtn.layer.cornerRadius = 4; - - [self.view addSubview:testBtn]; - [testBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self.view.mas_centerX); - make.width.mas_equalTo(150); - make.height.mas_equalTo(40); - make.bottom.mas_equalTo(self.view.mas_bottom).offset(-130); + }]; + [self.descBackView addSubview:self.descLabl]; + + [self.descLabl mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(121); + make.height.mas_equalTo(32); + make.center.mas_equalTo(self.descBackView.center); + + }]; + + +// UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom]; +// [testBtn setTitle:@"测试肤质" forState:UIControlStateNormal]; +// [testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; +// testBtn.backgroundColor = [UIColor blueColor]; +// [testBtn addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside]; +// testBtn.layer.masksToBounds = YES; +// testBtn.layer.cornerRadius = 4; +// [self.view addSubview:testBtn]; +// +// [testBtn mas_makeConstraints:^(MASConstraintMaker *make) { +// make.centerX.mas_equalTo(self.view.mas_centerX); +// make.width.mas_equalTo(150); +// make.height.mas_equalTo(40); +// make.bottom.mas_equalTo(self.view.mas_bottom).offset(-130); +// }]; + + [self.view layoutIfNeeded]; - CGFloat Y = CGRectGetMinY(self.maskImageView.frame) - 100; + CGFloat Y = CGRectGetMaxY(self.faceView.frame) + (CGRectGetMaxY(self.maskImageView.frame) - CGRectGetMaxY(self.faceView.frame)) / 2; CGFloat X = CGRectGetMidX(self.view.frame); + // 下巴合并位置 CGPoint anchorPoint = CGPointMake(X, Y); self.attachPoint = anchorPoint; -// self.snapBehavior = [[UISnapBehavior alloc] initWithItem:self.maskImageView snapToPoint:self.attachPoint]; -} - -#pragma mark 开始计时 - --(void)countTimeBegain:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second{ - - long nowTimestamp = [GiGaHelper getNowDateTimestamp]; - long futrueTimestamp = [GiGaHelper getFutureTimetstamp:hour minute:minute second:second]; - weakify(self); - [self.timer countDownWithStratTimeStamp:nowTimestamp finishTimeStamp:futrueTimestamp completeBlock:^(NSInteger day, NSInteger hour, NSInteger minute, NSInteger second) { - [weakSelf refreshTimeCount:hour minute:minute second:second]; + [self.cicleProgressView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(Y + 68); + make.height.and.width.mas_equalTo(136); + make.centerX.mas_equalTo(self.view.mas_centerX); }]; -} - --(void)refreshTimeCount:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second{ - self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second]; - if (hour == 0 && minute == 0 && second == 0) { - //面膜结束 - [self maskTimeEnd]; - } } #pragma mark 面膜时间背景音乐 @@ -286,14 +319,14 @@ _musicPalyer = player; [[AVAudioSession sharedInstance] setActive:YES error:nil]; //设置后台模式和锁屏模式下依然能够播放 - //[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; - [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; + } #pragma mark 开始面膜时间 -(void)startMaskTime{ - [self createInputView]; //出现弹幕 + //[self createInputView]; //出现弹幕 AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; if (delegate.isMasking) { return; @@ -303,17 +336,12 @@ [self setBackGroundPlayingInfo];//锁屏音频信息 //总时间隔 s - NSTimeInterval timeInterVal = 61; - NSString *timeformat = [GiGaHelper stringWithNSTimerinterval:timeInterVal]; - NSArray *timesArr = [timeformat componentsSeparatedByString:@":"]; - NSString *hour = timesArr[0]; - NSString *min = timesArr[1]; - NSString *sec = timesArr[2]; - [self countTimeBegain:hour.integerValue minute:min.integerValue second:sec.integerValue]; + NSTimeInterval timeInterVal = 10; + [self.cicleProgressView startWith:timeInterVal]; + //底部弹窗 [self showWaringView]; - return; //app 前台时收到本地通知showAlert 后台时通知提醒 [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"本地推送" fireTimeInterval:timeInterVal alertAction:@"测试面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND]; @@ -368,7 +396,7 @@ AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; delegate.isMasking = NO; [_musicPalyer stop]; - [self.timer destoryTimer]; + //复原动画 [self endMaskAnimation]; } @@ -390,8 +418,6 @@ } } - - -(void)addNotify{ NC_ADD_TARGET_NAME_OBJECT(self, @selector(guardViewDissmiss), USER_GUARD_DISSMISS, nil) ; @@ -465,6 +491,8 @@ [rightBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal]; [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; + + [self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)]; } #pragma mark 消息 action @@ -494,29 +522,22 @@ #pragma mark -bottomView -(void)showWaringView{ - [UIView animateWithDuration:0.4 animations:^{ - self.waringView.frame = CGRectMake(0,self.view.frame.size.height - 60, self.view.frame.size.width, 60); - }]; - [self.view addSubview:self.waringView]; - weakify(self); - [self.waringView.dismissBtn initWithBlock:^(UIButton *btn) { - NSLog(@"GIGAdismissBtn"); - [UIView animateWithDuration:0.4 animations:^{ - weakSelf.waringView.frame = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.height, 60); - } completion:^(BOOL finished) { - [weakSelf.waringView removeFromSuperview]; - }]; - - } for:UIControlEventTouchUpInside ]; + [UIView animateWithDuration:0.4 animations:^{ + self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame) - 60, self.view.frame.size.width, 60); + }]; + [self.waringView showView]; } -- (MaskViewBootomWaringView *)waringView{ +#pragma mark - MaskCirCularProGressViewDelegate - if (!_waringView) { - self.waringView = [[MaskViewBootomWaringView alloc] initWithFrame: CGRectMake(0, self.view.frame.size.height, self.view.frame.size.height, 60)]; - } - return _waringView; +- (void)updateProgressViewWith:(NSTimeInterval)timeInterval{ + +} + +- (void)progressDidFish{ + NSLog(@"结束"); + [self maskTimeEnd]; } - (void)didReceiveMemoryWarning { diff --git a/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.h b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.h new file mode 100644 index 0000000..cb602f3 --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.h @@ -0,0 +1,39 @@ +// +// MaskTimeCircularProgressView.h +// GIGA +// +// Created by lianxiang on 2018/9/3. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import +#import +#import "SHineLabel.h" +@protocol MaskCirCularProGressViewDelegate +@optional +-(void)updateProgressViewWith:(NSTimeInterval)timeInterval; +-(void)updateProgress; +-(void)progressDidFish; +@end + +@interface MaskTimeCircularProgressView : UIView +@property(nonatomic,weak) iddelegate; +@property(nonatomic) UIColor *backColor; +@property(nonatomic) UIColor *progressColor; +@property(nonatomic,strong) UILabel *countDownLabel; +@property(nonatomic) NSTimeInterval timeinterval; +@property(nonatomic) CGFloat lineWidth; +@property(nonatomic) BOOL isMoving; +@property (nonatomic,strong) SHineLabel *countLabel; + +-(id)initWithFrame:(CGRect)frame + backColor:(UIColor *)backColor + progressColor:(UIColor *)progressColor + lineWidth:(CGFloat)lineWidth + timeinterval:(NSTimeInterval)timeinterval; + +-(void)startWith:(NSTimeInterval)time; +-(void)stop; +-(void)pasuse; + +@end diff --git a/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m new file mode 100644 index 0000000..2aca781 --- /dev/null +++ b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m @@ -0,0 +1,261 @@ +// +// MaskTimeCircularProgressView.m +// GIGA +// +// Created by lianxiang on 2018/9/3. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "MaskTimeCircularProgressView.h" +#import "LXCountTimer.h" +#import "SHineLabel.h" + +@interface MaskTimeCircularProgressView() +@property (nonatomic) CADisplayLink *displayLink; +@property (nonatomic) CAShapeLayer *progressLayer; +@property (nonatomic) float progress; +@property (nonatomic) CGFloat angle; +@property (nonatomic) NSTimeInterval currentTimeinterval; +@property (nonatomic,strong) LXCountTimer *timer; +@property (nonatomic,strong) NSTimer *playTimer; + + +@end + +@implementation MaskTimeCircularProgressView +- (id)initWithFrame:(CGRect)frame backColor:(UIColor *)backColor progressColor:(UIColor *)progressColor lineWidth:(CGFloat)lineWidth timeinterval:(NSTimeInterval)timeinterval +{ + self = [super initWithFrame:frame]; + if (self) { + _backColor = backColor; + _progressColor = progressColor; + self.lineWidth = lineWidth; + self.timeinterval = timeinterval; + + [self setUP]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + self = [super initWithCoder:aDecoder]; + if (self) { + [self setUP]; + } + return self; +} + +-(void)setUP{ + + self.backgroundColor = [UIColor clearColor]; + _currentTimeinterval = 0; + _isMoving = NO; + self.countLabel.frame = CGRectMake(_lineWidth, self.frame.size.height /2 - 15 , self.frame.size.width - _lineWidth*2, 30); + [self addSubview:self.countLabel]; + +} + +-(LXCountTimer *)timer{ + + if (!_timer) { + _timer = [[LXCountTimer alloc] init]; + } + return _timer; +} + +- (NSTimer *)playTimer{ + if (!_playTimer) { + _playTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(payCircular) userInfo:nil repeats:YES]; + } + return _playTimer; +} + +//倒计时label +-(SHineLabel *)countLabel{ + + if (!_countLabel) { + _countLabel = [[SHineLabel alloc] init]; + _countLabel.outLineColor = [UIColor whiteColor]; + _countLabel.blurColor = [UIColor whiteColor]; + _countLabel.oinsideColor = [UIColor whiteColor]; + + _countLabel.text = @"00:00"; + _countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22]; + + } + return _countLabel; +} + +- (void)setLineWidth:(CGFloat)lineWidth{ + CAShapeLayer *backgroundLayer = [self createRingLayerWithCenter:CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) radius:CGRectGetWidth(self.bounds) / 2 - lineWidth / 2 lineWidth:lineWidth color:self.backColor]; + _lineWidth = lineWidth; + [self.layer addSublayer:backgroundLayer]; + _progressLayer = [self createRingLayerWithCenter:CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) radius:CGRectGetWidth(self.bounds) / 2 - lineWidth / 2 lineWidth:lineWidth color:self.progressColor]; + _progressLayer.strokeEnd = 0; + [self.layer addSublayer:_progressLayer]; + + //渐变色 + CGFloat width = self.frame.size.width; + CGFloat height = self.frame.size.height; + + CALayer *gradientLayer = [CALayer layer]; + gradientLayer.frame = self.bounds; + + CAGradientLayer *gradientLayer1 = [CAGradientLayer layer]; + gradientLayer1.frame = CGRectMake(0, 0, width, height); + gradientLayer1.colors = @[(__bridge id) [UIColor colorWithRed:151/255.0 green:253/255.0 blue:255/255.0 alpha:1/1.0].CGColor,(__bridge id)[UIColor colorWithRed:165/255.0 green:81/255.0 blue:216/255.0 alpha:1/1.0].CGColor]; + + //纵向变化 + gradientLayer1.startPoint = CGPointMake(0.5, 0); + gradientLayer1.endPoint = CGPointMake(0.5, 1); + [gradientLayer addSublayer:gradientLayer1]; + [self.layer addSublayer:gradientLayer]; + gradientLayer.mask = _progressLayer ; + + +} + +- (CAShapeLayer *)createRingLayerWithCenter:(CGPoint)center radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth color:(UIColor *)color { + UIBezierPath *smoothedPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(radius, radius) radius:radius startAngle:- M_PI_2 endAngle:(M_PI + M_PI_2) clockwise:YES]; + CAShapeLayer *slice = [CAShapeLayer layer]; + slice.contentsScale = [[UIScreen mainScreen] scale]; + slice.frame = CGRectMake(center.x - radius, center.y - radius, radius * 2, radius * 2); + slice.fillColor = [UIColor clearColor].CGColor; + slice.strokeColor = color.CGColor; + slice.lineWidth = lineWidth; + slice.lineCap = kCALineJoinRound; + slice.lineJoin = kCALineJoinBevel; + slice.path = smoothedPath.CGPath; + + return slice; +} + +- (void)setProgress:(float)progress{ + + if (progress == 0) { + self.progressLayer.hidden = YES; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.progressLayer.strokeEnd = 0; + }); + }else { + self.progressLayer.hidden = NO; + self.progressLayer.strokeEnd = progress; + } +} + +- (void)updateProgressCircle{ + //update progress value + self.progress = (float) (self.currentTimeinterval / self.timeinterval); + + if (self.delegate && [self.delegate conformsToProtocol:@protocol(MaskCirCularProGressViewDelegate)]) { + //self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second]; + [self.delegate updateProgressViewWith:self.currentTimeinterval]; + } +} + +-(void)payCircular{ + + self.currentTimeinterval += 0.01; +} + +- (void)startWith:(NSTimeInterval)time{ + + self.timeinterval = time; + [self countDown:time]; + [self start]; +} + +-(void)start{ + + [[NSRunLoop mainRunLoop] addTimer:self.playTimer forMode:NSRunLoopCommonModes]; + if (!self.isMoving) { + if (!self.displayLink) { + self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateProgressCircle)]; + [self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + }else { + self.displayLink.paused = NO; + } + self.isMoving = YES; + } +} + +-(void)countDown:(NSTimeInterval)timeInterVal{ + + NSString *timeformat = [GiGaHelper stringWithNSTimerinterval:timeInterVal]; + NSArray *timesArr = [timeformat componentsSeparatedByString:@":"]; + NSString *hour = timesArr[0]; + NSString *min = timesArr[1]; + NSString *sec = timesArr[2]; + [self countTimeBegain:hour.integerValue minute:min.integerValue second:sec.integerValue]; + +} + +#pragma mark 开始计时 +-(void)countTimeBegain:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second{ + + long nowTimestamp = [GiGaHelper getNowDateTimestamp]; + long futrueTimestamp = [GiGaHelper getFutureTimetstamp:hour minute:minute second:second]; + weakify(self); + [self.timer countDownWithStratTimeStamp:nowTimestamp finishTimeStamp:futrueTimestamp completeBlock:^(NSInteger day, NSInteger hour, NSInteger minute, NSInteger second) { + [weakSelf refreshTimeCount:hour minute:minute second:second]; + }]; +} + +-(void)refreshTimeCount:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second{ + + self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second]; + if (hour == 0 && minute == 0 && second == 0) { + //面膜结束 + //[self maskTimeEnd]; + [self.timer destoryTimer]; + [self.playTimer invalidate]; + self.playTimer = nil; + [self stop]; + + if (self.delegate && [self.delegate conformsToProtocol:@protocol(MaskCirCularProGressViewDelegate)]) { + [self.delegate progressDidFish]; + } + } +} + +-(void)pasuse{ + if (self.isMoving) { + self.displayLink.paused = YES; + self.isMoving = NO; + } +} + +-(void)stop{ + self.isMoving = NO; + self.progress = 0 ; + self.currentTimeinterval = 0; + [self.displayLink invalidate]; + self.displayLink = nil; +} + +//calculate angle between start to point +- (CGFloat)angleFromStartToPoint:(CGPoint)point{ + CGFloat angle = [self angleBetweenLinesWithLine1Start:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2) + Line1End:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2 - 1) + Line2Start:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2) + Line2End:point]; + if (CGRectContainsPoint(CGRectMake(0, 0, CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame)), point)) { + angle = 2 * M_PI - angle; + } + return angle; +} + +//calculate angle between 2 lines +- (CGFloat)angleBetweenLinesWithLine1Start:(CGPoint)line1Start + Line1End:(CGPoint)line1End + Line2Start:(CGPoint)line2Start + Line2End:(CGPoint)line2End{ + CGFloat a = line1End.x - line1Start.x; + CGFloat b = line1End.y - line1Start.y; + CGFloat c = line2End.x - line2Start.x; + CGFloat d = line2End.y - line2Start.y; + return acos(((a * c) + (b * d)) / ((sqrt(a * a + b * b)) * (sqrt(c * c + d * d)))); +} + + +@end diff --git a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.h b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.h index 2d5dec9..cdbce18 100644 --- a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.h +++ b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.h @@ -11,5 +11,6 @@ @interface MaskViewBootomWaringView : UIView @property(nonatomic,strong) GiGaBlockButton *dismissBtn; +-(void)showView; @end diff --git a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m index 04aa178..fe29b77 100644 --- a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m +++ b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m @@ -38,12 +38,13 @@ waringLabel.text = @"亲爱滴,请您务必要开启手机声音哦"; waringLabel.textColor = [UIColor whiteColor]; waringLabel.textAlignment = NSTextAlignmentCenter; - waringLabel.font = [UIFont systemFontOfSize:16]; - [waringLabel sizeToFit]; + waringLabel.font = [UIFont systemFontOfSize:12]; + [self addSubview:waringLabel]; [waringLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(iconImg.mas_right).offset(10); + make.left.mas_equalTo(self.mas_left).offset(40); + make.right.mas_equalTo(self.mas_right).offset(-40); make.centerY.mas_equalTo(self.mas_centerY); }]; @@ -61,5 +62,20 @@ }]; } +-(void)showView{ + + [self.dismissBtn initWithBlock:^(UIButton *btn) { + + [UIView animateWithDuration:0.4 animations:^{ + + self.frame = CGRectMake(0, KMainH, KMainW, 60); + + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; + + } for:UIControlEventTouchUpInside ]; + +} @end diff --git a/GIGA/Modules/Me/Controller/GiGaMeViewController.m b/GIGA/Modules/Me/Controller/GiGaMeViewController.m index a5f2e93..a29b39a 100644 --- a/GIGA/Modules/Me/Controller/GiGaMeViewController.m +++ b/GIGA/Modules/Me/Controller/GiGaMeViewController.m @@ -12,6 +12,7 @@ #import "GiGaMineInfoViewCell.h" #import "GiSysSettingsVC.h" #import "GiMaskTimeHistoryVC.h" +#import "UINavigationBar+Custom.h" @interface GiGaMeViewController () @@ -20,8 +21,8 @@ @implementation GiGaMeViewController - (void)viewDidLoad { - [super viewDidLoad]; - + [super viewDidLoad]; + [self addNavTitile:@"我的"]; // Do any additional setup after loading the view. [self.view addSubview:self.tableView]; diff --git a/GIGA/zh-Hans.lproj/LaunchScreen.strings b/GIGA/zh-Hans.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/GIGA/zh-Hans.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/GIGA/zh-Hans.lproj/Main.strings b/GIGA/zh-Hans.lproj/Main.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/GIGA/zh-Hans.lproj/Main.strings @@ -0,0 +1 @@ +