diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index b412864..3d18081 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 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 */; }; + 8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */ = {isa = PBXBuildFile; fileRef = 8345C13521414D3B00051717 /* NSString+Unicode.m */; }; 8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */ = {isa = PBXBuildFile; fileRef = 8349585B212511040064DB6C /* AppDelegate+ThirdParty.m */; }; 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 835060A1212D1225007E6220 /* GiGaMeViewController.m */; }; 835060A5212D3536007E6220 /* AppDelegate+GiGaConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361B40A21217B2100238FEB /* AppDelegate+GiGaConfig.m */; }; @@ -163,6 +164,8 @@ 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 = ""; }; + 8345C13421414D3B00051717 /* NSString+Unicode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Unicode.h"; sourceTree = ""; }; + 8345C13521414D3B00051717 /* NSString+Unicode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Unicode.m"; 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 = ""; }; 835060A0212D1225007E6220 /* GiGaMeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMeViewController.h; sourceTree = ""; }; @@ -626,6 +629,8 @@ 838500DB2137F3F7003514A3 /* GiGaAttributedLabel.m */, 8340BF9C213E3846008F22E4 /* SHineLabel.h */, 8340BF9D213E3846008F22E4 /* SHineLabel.m */, + 8345C13421414D3B00051717 /* NSString+Unicode.h */, + 8345C13521414D3B00051717 /* NSString+Unicode.m */, ); path = Category; sourceTree = ""; @@ -1246,6 +1251,7 @@ 83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */, 83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */, 8340BFA2213E60DD008F22E4 /* GIGAMBHUDHelper.m in Sources */, + 8345C13621414D3B00051717 /* NSString+Unicode.m in Sources */, 83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */, 8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */, 8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */, @@ -1461,10 +1467,7 @@ ); INFOPLIST_FILE = GIGA/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -1491,10 +1494,7 @@ ); INFOPLIST_FILE = GIGA/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.gigamask.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; @@ -1509,11 +1509,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = GIGATests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1527,11 +1523,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = GIGATests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGATests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1544,11 +1536,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = GIGAUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1561,11 +1549,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = GIGAUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = lianxiang.GIGAUITests; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json index fb96dc7..083b9ff 100644 --- a/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json +++ b/GIGA/Assets.xcassets/hud/hud_error.imageset/Contents.json @@ -1,5 +1,9 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "hud_error@2x.png", diff --git a/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json index 53ff50d..cdce65d 100644 --- a/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json +++ b/GIGA/Assets.xcassets/hud/hud_info.imageset/Contents.json @@ -1,5 +1,9 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "hud_info@2x.png", diff --git a/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json b/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json index b505d19..e4df689 100644 --- a/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json +++ b/GIGA/Assets.xcassets/hud/hud_ok.imageset/Contents.json @@ -1,5 +1,9 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "hud_ok@2x.png", diff --git a/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/Contents.json new file mode 100644 index 0000000..d5f2bc5 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "bg_img_face.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "bg_img_face@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "bg_img_face@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face.png b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face.png new file mode 100644 index 0000000..983d64f Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face.png differ diff --git a/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@2x.png b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@2x.png new file mode 100644 index 0000000..331ca01 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@3x.png b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@3x.png new file mode 100644 index 0000000..e34250e Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_img_face.imageset/bg_img_face@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/Contents.json similarity index 78% rename from GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json rename to GIGA/Assets.xcassets/maskTime/bg_logo.imageset/Contents.json index cd24fc3..87dc634 100644 --- a/GIGA/Assets.xcassets/maskTime/img_bg.imageset/Contents.json +++ b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/Contents.json @@ -6,11 +6,12 @@ }, { "idiom" : "universal", - "filename" : "img_bg@2x.png", + "filename" : "bg_logo@2x.png", "scale" : "2x" }, { "idiom" : "universal", + "filename" : "bg_logo@3x.png", "scale" : "3x" } ], diff --git a/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@2x.png b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@2x.png new file mode 100644 index 0000000..a03c696 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@3x.png b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@3x.png new file mode 100644 index 0000000..5dcb977 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_logo.imageset/bg_logo@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/Contents.json similarity index 78% rename from GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json rename to GIGA/Assets.xcassets/maskTime/bg_name.imageset/Contents.json index 68c9dce..2da6549 100644 --- a/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/Contents.json +++ b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/Contents.json @@ -6,11 +6,12 @@ }, { "idiom" : "universal", - "filename" : "img_bg_head@2x.png", + "filename" : "bg_name@2x.png", "scale" : "2x" }, { "idiom" : "universal", + "filename" : "bg_name@3x.png", "scale" : "3x" } ], diff --git a/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@2x.png b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@2x.png new file mode 100644 index 0000000..c92e232 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@3x.png b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@3x.png new file mode 100644 index 0000000..8c4e5ae Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/bg_name.imageset/bg_name@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_more.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/Contents.json new file mode 100644 index 0000000..2bb61b2 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "btn_more@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "btn_more@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@2x.png b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@2x.png new file mode 100644 index 0000000..7efe545 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@3x.png b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@3x.png new file mode 100644 index 0000000..4cf5cd9 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_more.imageset/btn_more@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/Contents.json new file mode 100644 index 0000000..b098447 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "btn_start_mask@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "btn_start_mask@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@2x.png b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@2x.png new file mode 100644 index 0000000..58ec0cf Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@3x.png b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@3x.png new file mode 100644 index 0000000..85dd0a4 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_start_mask.imageset/btn_start_mask@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/Contents.json new file mode 100644 index 0000000..c476acd --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "btn_start_test@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "btn_start_test@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@2x.png b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@2x.png new file mode 100644 index 0000000..ccc925d Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@3x.png b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@3x.png new file mode 100644 index 0000000..929da81 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/btn_start_test.imageset/btn_start_test@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/ic_love.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/Contents.json new file mode 100644 index 0000000..271c7c8 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_love.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_love@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_love@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love.png b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love.png new file mode 100644 index 0000000..efffddc Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love.png differ diff --git a/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@2x.png b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@2x.png new file mode 100644 index 0000000..6ee1c9f Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@3x.png b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@3x.png new file mode 100644 index 0000000..7ab4d4c Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/ic_love.imageset/ic_love@3x.png differ 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 deleted file mode 100644 index c050549..0000000 Binary files a/GIGA/Assets.xcassets/maskTime/img_bg.imageset/img_bg@2x.png and /dev/null differ 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 deleted file mode 100644 index fd073bb..0000000 Binary files a/GIGA/Assets.xcassets/maskTime/img_bg_head.imageset/img_bg_head@2x.png and /dev/null differ diff --git a/GIGA/Assets.xcassets/maskTime/img_mask.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/Contents.json new file mode 100644 index 0000000..67cb6db --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "img_mask.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "img_mask@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "img_mask@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask.png b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask.png new file mode 100644 index 0000000..51ae75f Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@2x.png b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@2x.png new file mode 100644 index 0000000..63eaaa9 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@3x.png b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@3x.png new file mode 100644 index 0000000..6512443 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/img_mask.imageset/img_mask@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/Contents.json new file mode 100644 index 0000000..ba7e94d --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "mask_bg_up@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "mask_bg_up@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@2x.png b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@2x.png new file mode 100644 index 0000000..9c1b609 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@3x.png b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@3x.png new file mode 100644 index 0000000..4835dd6 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/mask_bg_up.imageset/mask_bg_up@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/Contents.json index a3523a7..e120fbc 100644 --- a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/Contents.json +++ b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/Contents.json @@ -2,15 +2,16 @@ "images" : [ { "idiom" : "universal", - "filename" : "maske_dismiss_waring.png", "scale" : "1x" }, { "idiom" : "universal", + "filename" : "maske_dismiss_waring@2x.png", "scale" : "2x" }, { "idiom" : "universal", + "filename" : "maske_dismiss_waring@3x.png", "scale" : "3x" } ], diff --git a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring.png b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring.png deleted file mode 100644 index 07cc16e..0000000 Binary files a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring.png and /dev/null differ diff --git a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@2x.png b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@2x.png new file mode 100644 index 0000000..e17fb40 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@3x.png b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@3x.png new file mode 100644 index 0000000..2e271d8 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/maske_dismiss_waring.imageset/maske_dismiss_waring@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/Contents.json new file mode 100644 index 0000000..d88958b --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "nav_circle_avatar@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "nav_circle_avatar@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@2x.png b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@2x.png new file mode 100644 index 0000000..d0054f0 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@3x.png b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@3x.png new file mode 100644 index 0000000..615d3da Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/nav_circle_avatar.imageset/nav_circle_avatar@3x.png differ diff --git a/GIGA/Base.lproj/LaunchScreen.storyboard b/GIGA/Base.lproj/LaunchScreen.storyboard index fa689fa..8db0a91 100644 --- a/GIGA/Base.lproj/LaunchScreen.storyboard +++ b/GIGA/Base.lproj/LaunchScreen.storyboard @@ -1,11 +1,12 @@ - + + @@ -13,18 +14,60 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + diff --git a/GIGA/Category/NSString+Unicode.h b/GIGA/Category/NSString+Unicode.h new file mode 100644 index 0000000..7d9031a --- /dev/null +++ b/GIGA/Category/NSString+Unicode.h @@ -0,0 +1,16 @@ +// +// NSString+Unicode.h +// GIGA +// +// Created by lianxiang on 2018/9/6. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface NSString (Unicode) + +- (NSString *)replaceUnicode:(NSString *)unicodeStr; +- (NSString *)htmlEntityDecode:(NSString *)string; + +@end diff --git a/GIGA/Category/NSString+Unicode.m b/GIGA/Category/NSString+Unicode.m new file mode 100644 index 0000000..a96665e --- /dev/null +++ b/GIGA/Category/NSString+Unicode.m @@ -0,0 +1,39 @@ +// +// NSString+Unicode.m +// GIGA +// +// Created by lianxiang on 2018/9/6. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "NSString+Unicode.h" + +@implementation NSString (Unicode) +- (NSString *)replaceUnicode:(NSString *)unicodeStr { + + NSString *tempStr1 = [unicodeStr stringByReplacingOccurrencesOfString:@"\\u"withString:@"\\U"]; + NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\""withString:@"\\\""]; + NSString *tempStr3 = [[@"\""stringByAppendingString:tempStr2]stringByAppendingString:@"\""]; + NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding]; + NSString* returnStr = [NSPropertyListSerialization propertyListFromData:tempData + mutabilityOption:NSPropertyListImmutable + format:NULL + errorDescription:NULL]; + + return [returnStr stringByReplacingOccurrencesOfString:@"\\r\\n"withString:@"\n"]; +} + +//将 < 等类似的字符转化为HTML中的“<”等 +- (NSString *)htmlEntityDecode:(NSString *)string +{ + string = [string stringByReplacingOccurrencesOfString:@""" withString:@"\""]; + string = [string stringByReplacingOccurrencesOfString:@"'" withString:@"'"]; + string = [string stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; + string = [string stringByReplacingOccurrencesOfString:@">" withString:@">"]; + string = [string stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; // Do this last so that, e.g. @"&lt;" goes to @"<" not @"<" + + return string; +} + + +@end diff --git a/GIGA/Category/UINavigationBar+Custom.m b/GIGA/Category/UINavigationBar+Custom.m index 7dc53c3..de5a2ce 100644 --- a/GIGA/Category/UINavigationBar+Custom.m +++ b/GIGA/Category/UINavigationBar+Custom.m @@ -26,7 +26,7 @@ static char overlayKey; [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 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]; } diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.m b/GIGA/Common/BaseVC/GiGaBaseViewController.m index 6024b72..4893918 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.m @@ -24,8 +24,7 @@ [super viewDidLoad]; // Do any additional setup after loading the view. - - [self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)]; + //[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)]; } diff --git a/GIGA/Common/GiGaHelper.h b/GIGA/Common/GiGaHelper.h index 7f234f5..24ed16f 100644 --- a/GIGA/Common/GiGaHelper.h +++ b/GIGA/Common/GiGaHelper.h @@ -53,5 +53,10 @@ */ +(BOOL)isPhoneNumber:(NSString*)mobileNumber; ++(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space; + ++(NSString *)convertToJsonData:(NSDictionary *)dict; ++(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString; + @end diff --git a/GIGA/Common/GiGaHelper.m b/GIGA/Common/GiGaHelper.m index 86d310b..ca66880 100644 --- a/GIGA/Common/GiGaHelper.m +++ b/GIGA/Common/GiGaHelper.m @@ -171,7 +171,76 @@ return NO; } +} ++(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space +{ + NSMutableParagraphStyle *paragraStyle = [[NSMutableParagraphStyle alloc] init]; + paragraStyle.alignment = NSTextAlignmentCenter; + + NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:color,NSKernAttributeName:@(space),NSParagraphStyleAttributeName:paragraStyle}]; + + return attributedString; + + +} + ++(NSString *)convertToJsonData:(NSDictionary *)dict + +{ + + NSError *error; + + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error]; + + NSString *jsonString; + + if (!jsonData) { + + NSLog(@"%@",error); + + }else{ + + jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding]; + + } + + NSMutableString *mutStr = [NSMutableString stringWithString:jsonString]; + + NSRange range = {0,jsonString.length}; + + //去掉字符串中的空格 + + [mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range]; + + NSRange range2 = {0,mutStr.length}; + + //去掉字符串中的换行符 + + [mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:range2]; + + return mutStr; + +} + ++(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString +{ + if (jsonString == nil) { + return nil; + } + + NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; + + NSError *err; + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData + options:NSJSONReadingMutableContainers + error:&err]; + if(err) + { + NSLog(@"json解析失败:%@",err); + return nil; + } + return dic; } @end diff --git a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m index b00c4fe..2724d3e 100644 --- a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m +++ b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m @@ -14,7 +14,6 @@ { if (self = [super initWithFrame:frame]) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)]; - //label.textColor = GIGAUIColorFromRGBA(0x777777); label.textColor = [UIColor whiteColor]; label.text = str; label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f]; diff --git a/GIGA/Config/GIGA.h b/GIGA/Config/GIGA.h index 7f03868..3c0ddfd 100644 --- a/GIGA/Config/GIGA.h +++ b/GIGA/Config/GIGA.h @@ -60,7 +60,7 @@ colorWithRed:((float)((rgbValue & 0xFF000000) >> 24))/255.0 \ green:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ blue:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ alpha:((float)(rgbValue & 0xFF))/255.0] - +#define GIGA_MAIN_BGCOLOR [UIColor colorWithRed:131/255.0f green:10/255.0f blue:10/255.0f alpha:1] #define SCREEN [UIScreen mainScreen] #define WIDTH self.view.frame.size.width @@ -91,6 +91,10 @@ alpha:((float)(rgbValue & 0xFF))/255.0] #define GIGA_FONTNAME @"PingFangSC-Medium" #define GIGA_FONTBOLD @"PingFangSC-Semibold" +#define GIGA_TEXTFONTBOLD(font) [UIFont fontWithName:GIGA_FONTBOLD size:font] + +#define GIGA_TEXTFONTMEDIUM(font) [UIFont fontWithName:GIGA_FONTNAME size:font] + //国际化 #define GIGALocalComm(key) NSLocalizedStringFromTable(key, @"GIGACommonLocalizabe", nil) //个人中心 diff --git a/GIGA/Localizable/GIGACommonLocalizabe.strings b/GIGA/Localizable/GIGACommonLocalizabe.strings index beeba25..45b53f7 100644 --- a/GIGA/Localizable/GIGACommonLocalizabe.strings +++ b/GIGA/Localizable/GIGACommonLocalizabe.strings @@ -6,3 +6,5 @@ Copyright © 2018年 com.giga.ios. All rights reserved. */ "masktime_nav_title" = "面膜时间"; +"masktime_adview_passadtitle" = "跳过广告"; +"masktime_adview_desc" = "一款独具匠心的优质面膜"; diff --git a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m index ea716fc..98a346e 100644 --- a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m +++ b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m @@ -9,6 +9,7 @@ #import "GiGaStartAdView.h" #import "GiGaFileNanager.h" #import "UIImageView+WebCache.h" +#import "GiGaHelper.h" @interface GiGaStartAdView() @@ -17,6 +18,7 @@ @property (nonatomic,assign) int count; @end + static int const showTime = 5; @implementation GiGaStartAdView @@ -40,50 +42,124 @@ static int const showTime = 5; } -(void)initUIWithFrame:(CGRect)frame{ - self.backgroundColor = [UIColor whiteColor]; + self.backgroundColor = GIGARGB(131, 10,10, 1); _adView = [[UIImageView alloc] initWithFrame:frame]; _adView.userInteractionEnabled = YES; _adView.contentMode = UIViewContentModeScaleAspectFill; _adView.clipsToBounds = YES; //广告点击手势 - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoAd)]; - [_adView addGestureRecognizer:tap]; - CGFloat btnW = 60; - CGFloat btnH = 30; - _countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24, btnH + 10, btnW, btnH)]; +// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoAd)]; +// [_adView addGestureRecognizer:tap]; + CGFloat btnW = 80; + CGFloat btnH = 26; + _countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24,PhoneX_STATUBAR_H + 10, btnW, btnH)]; [_countBtn addTarget:self action:@selector(removeAdView) forControlEvents:UIControlEventTouchUpInside]; - [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",showTime] forState:UIControlStateNormal]; - _countBtn.titleLabel.font = [UIFont systemFontOfSize:15]; - [_countBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _countBtn.backgroundColor = GIGARGB(38, 38, 38, 0.6) ; +// [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",showTime] forState:UIControlStateNormal]; + [_countBtn setTitle:GIGALocalComm(@"masktime_adview_passadtitle") forState:UIControlStateNormal]; + + _countBtn.titleLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:14]; + + [_countBtn setTitleColor:GIGARGB(144, 25, 31, 1) forState:UIControlStateNormal]; + _countBtn.backgroundColor = GIGARGB(235,234,234,1) ; _countBtn.layer.masksToBounds = YES; - _countBtn.layer.cornerRadius = 4; + _countBtn.layer.cornerRadius = _countBtn.frame.size.height / 2 ; [self addSubview:_adView]; [self addSubview:_countBtn]; + UIImageView *imageViewlogo = [[UIImageView alloc] init]; + imageViewlogo.image = [UIImage imageNamed:@"bg_logo"]; + + + UIImageView *imageView27Mask = [[UIImageView alloc] init]; + imageView27Mask.image = [UIImage imageNamed:@"bg_name"]; + imageView27Mask.contentMode = UIViewContentModeScaleAspectFit; + + + UILabel *detailLabel = [[UILabel alloc] init]; + detailLabel.attributedText = [GiGaHelper stringWithText:GIGALocalComm(@"masktime_adview_desc") textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(14) leterSpace:2]; + + UIButton *moreinfoBtn = [UIButton buttonWithType:UIButtonTypeCustom]; +// [moreinfoBtn setImage:[UIImage imageNamed:@"btn_more"] forState:UIControlStateNormal]; + [moreinfoBtn setBackgroundImage:[UIImage imageNamed:@"btn_more"] forState:UIControlStateNormal]; + [moreinfoBtn addTarget:self action:@selector(gotoAd:) forControlEvents:UIControlEventTouchUpInside]; + NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:@"了解更多" attributes:@{NSFontAttributeName:[UIFont fontWithName:GIGA_FONTNAME size:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [moreinfoBtn setAttributedTitle:title forState:UIControlStateNormal]; + + UILabel *year = [[UILabel alloc] init]; + year.textColor = [UIColor whiteColor]; + year.font = GIGA_TEXTFONTBOLD(10); + year.text = @"2018"; + + [self addSubview:imageViewlogo]; + [self addSubview:imageView27Mask]; + [self addSubview:detailLabel]; + [self addSubview:moreinfoBtn]; + [self addSubview:year]; + [imageViewlogo mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.mas_top).offset(131); + make.height.and.width.mas_equalTo(95); + make.centerX.mas_equalTo(self.mas_centerX); + }]; + [imageView27Mask mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.mas_top).offset(271); + make.width.mas_equalTo(120); + make.height.mas_equalTo(70); + make.centerX.mas_equalTo(self.mas_centerX); + + }]; + [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.mas_top).offset(362); + make.width.mas_equalTo(180); + make.height.mas_equalTo(21); + make.centerX.mas_equalTo(self.mas_centerX); + + }]; + + [moreinfoBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.mas_top).offset(478); + make.width.mas_equalTo(135); + make.height.mas_equalTo(35); + make.centerX.mas_equalTo(self.mas_centerX); + }]; + + [year mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.mas_bottom).offset(-(10 + PhoneX_BottomMargin)); + + make.width.mas_equalTo(31); + make.height.mas_equalTo(14); + make.left.mas_equalTo(20); + }]; + } -(void)removeAdView{ [self.countTimer invalidate]; self.countTimer = nil; - [UIView animateWithDuration:0.3f animations:^{ + self.transform = CGAffineTransformMakeScale(1, 1); + [UIView animateWithDuration:0.6f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ + self.transform = CGAffineTransformMakeScale(1.4, 1.4); self.alpha = 0.f; } completion:^(BOOL finished) { [self removeFromSuperview]; }]; + } --(void)gotoAd{ - [self removeAdView]; +-(void)gotoAd:(UIButton *)btn{ + + btn.userInteractionEnabled = NO; NC_POST_NAME_OBJECT(APP_PUSHTO_DETAILVIEW, nil); + + [NSTimer scheduledTimerWithTimeInterval:0.6 target:self selector:@selector(removeAdView) userInfo:nil repeats:NO]; + //[self removeAdView]; } -(void)countDown{ _count --; - [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",_count] forState:UIControlStateNormal]; + //[_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",_count] forState:UIControlStateNormal]; if (_count == 0) { [self removeAdView]; } @@ -92,7 +168,7 @@ static int const showTime = 5; -(void)show{ - [self loadImage]; + //[self loadImage]; UIWindow *window = [UIApplication sharedApplication].keyWindow; [window addSubview:self]; //[self startTimer]; @@ -135,7 +211,7 @@ static int const showTime = 5; }else{ dispatch_async(dispatch_get_main_queue(), ^{ - [weakSelf.countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal]; + //[weakSelf.countBtn setTitle:[NSString stringWithFormat:@"跳过%d",timeout] forState:UIControlStateNormal]; }); timeout--; diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m index 0c5f091..ff73de4 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m @@ -31,11 +31,11 @@ @implementation GiGaRegistViewController + - (void)viewDidLoad { [super viewDidLoad]; //self.title = @"注册"; - [self addNavTitile:@"注册"]; - + //[self addNavTitile:@"注册"]; _time = 60; // Do any additional setup after loading the view from its nib. [self confirmUI]; @@ -44,6 +44,12 @@ [self.checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside]; } + +-(void)viewDidAppear:(BOOL)animated{ + [super viewDidAppear:animated]; + +} + -(void)dealloc{ if (_timer) { [_timer unfireTimer]; diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib index 60c09be..dea3d3a 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib @@ -1,12 +1,12 @@ - + - + @@ -27,130 +27,145 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.h b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.h index 239beb3..1371491 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.h +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.h @@ -7,7 +7,8 @@ // #import "GiGaBaseNavViewController.h" +#import "GiGaBaseViewController.h" -@interface GiGaUserLoginVC : UIViewController +@interface GiGaUserLoginVC : GiGaBaseViewController @end diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index 08ae68a..8fffe50 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -48,10 +48,16 @@ NC_ADD_TARGET_NAME_OBJECT(self, @selector(WeiXinLongIn:), kWeiXinAuthrization_Success, nil) NC_ADD_TARGET_NAME_OBJECT(self, @selector(userRegistSuccsessNoti:), kUserRegistSucccess, nil) -// if (![WXApi isWXAppInstalled]) { -// self.weiXinLoginBtn.hidden = YES; -// } + if (![WXApi isWXAppInstalled]) { + self.weiXinLoginBtn.hidden = YES; + } +} + +-(void)viewWillAppear:(BOOL)animated{ + + [super viewWillAppear:animated]; + [self.navigationController.navigationBar setClearNav]; } @@ -110,12 +116,6 @@ [self dismissViewControllerAnimated:YES completion:nil]; } --(void)viewWillAppear:(BOOL)animated{ - - [super viewWillAppear:animated]; - [self.navigationController.navigationBar setClearNav]; -} - -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { @@ -133,7 +133,6 @@ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. } - (IBAction)forgetPassBtn:(id)sender { @@ -167,13 +166,11 @@ GIGA_ShowToast(@"密码不能为空"); return; } -// if (self.passwordTextField.text.length < =6) { -// GIGA_ShowToast(@"密码长度不能小于六位字符"); -// return; -// } + if (self.passwordTextField.text.length <= 6) { + GIGA_ShowToast(@"密码长度不能小于六位字符"); + return; + } - - // [self dismissViewControllerAnimated:YES completion:nil]; [self loginWithAction:btn]; } @@ -184,17 +181,7 @@ @"username":self.acountTextField.text, @"password":self.passwordTextField.text }; -// GiGaBaseAPiRequest *loginApi = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/login" method:RequestPostMethod parms:params]; - //weakify(self); -// [loginApi requstDataWithResult:^(GiGaAPIResult *result) { -// GILog(@"**登陆***\n resultDic:%ld\n code:%@\n *******\n",(long)result.code,result.dic); -// if (result.success) { -// GILog(@"****登陆成功****"); -// [self saveUserData]; -// [self dismissViewControllerAnimated:YES completion:nil]; -// } -// }]; - + [self.view makeToastActivity:CSToastPositionCenter]; NSString *url = [NSString stringWithFormat:@"%@sys/v1/login",[GiGaServerConfig getMainUrl]]; [GiGaNetManager userLoginrequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) { @@ -225,7 +212,6 @@ //埋点 [MobClick endEvent:MobClick_UserLogin]; [GiGaUserDefault saveUserId:@"123"]; - } #pragma mark - 微信登录 @@ -281,9 +267,6 @@ } - - - //接收注册成功通知 -(void)userRegistSuccsessNoti:(NSNotification *)noti{ @@ -292,6 +275,7 @@ //密码加密按钮 -(void)secretBtnAction:(UIButton *)btn{ + btn.selected = !btn.selected; if (btn.selected) { //秘文 @@ -301,7 +285,6 @@ self.passwordTextField.secureTextEntry = NO; [btn setImage:[UIImage imageNamed:@"btn_tab_desplay"] forState:UIControlStateNormal]; } - } @end diff --git a/GIGA/Modules/LogIn/Controller/GiGaWebViewController.h b/GIGA/Modules/LogIn/Controller/GiGaWebViewController.h index fbaacff..41614a0 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaWebViewController.h +++ b/GIGA/Modules/LogIn/Controller/GiGaWebViewController.h @@ -7,7 +7,7 @@ // #import - +#import "GiGaBaseViewController.h" typedef NS_ENUM(NSInteger,WebSourceType) { WebSourceTypeLoacalHtml, @@ -15,7 +15,7 @@ typedef NS_ENUM(NSInteger,WebSourceType) }; -@interface GiGaWebViewController : UIViewController +@interface GiGaWebViewController : GiGaBaseViewController @property (nonatomic,strong) NSString *url; @property (nonatomic,assign) WebSourceType souceType; diff --git a/GIGA/Modules/LogIn/Controller/PassWordResetVC.m b/GIGA/Modules/LogIn/Controller/PassWordResetVC.m index a05f9a3..eaa5385 100644 --- a/GIGA/Modules/LogIn/Controller/PassWordResetVC.m +++ b/GIGA/Modules/LogIn/Controller/PassWordResetVC.m @@ -80,6 +80,7 @@ [self startTimer:btn]; [self requstCode:btn]; } + //计时 -(void)startTimer:(UIButton *)btn{ @@ -165,8 +166,8 @@ GIGA_WIndowTost(result.message); [self.navigationController popViewControllerAnimated:YES]; } - }]; + } - (void)didReceiveMemoryWarning { @@ -175,11 +176,11 @@ } -(void)dealloc{ + if (_timer) { [_timer unfireTimer]; [_timer invalidate]; _timer = nil; - } } diff --git a/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib b/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib index 3d6f52a..05d6bd0 100644 --- a/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib +++ b/GIGA/Modules/LogIn/Controller/PassWordResetVC.xib @@ -41,9 +41,9 @@ - + - + @@ -63,18 +63,6 @@ - - + - + @@ -115,7 +115,7 @@ - + diff --git a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m index 16930bf..d4c650d 100644 --- a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m @@ -13,71 +13,131 @@ #import "GiGaCommentModel.h" #import "LXDanMuManagerConfig.h" #import "IQKeyboardManager.h" +#import +#import "NSString+Unicode.h" //弹幕控制器 @interface GiGaFlingCommitVC () @property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView; +@property (nonatomic,strong) SocketIOClient *client; +@property (nonatomic,strong) SocketManager *manager; + @end @implementation GiGaFlingCommitVC -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. - NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil); - [self.view addSubview: self.commitInputView]; - self.commitInputView.SendCommentHandler = ^(NSString *content) { - GILog(@"发送->:%@",content); - }; - [[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:self.view.frame.size.height / 4 trackWidth:self.view.frame.size.width showInView:self.view]; - [[LXDanMuManager shareInstance] start]; - - [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(danmuAction) userInfo:nil repeats:YES]; - - -} - --(void)danmuAction{ - - [self showFlyingCommit]; -} - -- (GiGaFlyingCommitInputView *)commitInputView{ - - if (!_commitInputView) { -// _commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:CGRectMake(0,self.view.frame.size.height - 60 , KMainW, 60)]; - _commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds]; - [_commitInputView setPalceholderText:@"请输入弹幕"]; - } - return _commitInputView; -} -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; + NC_ADD_TARGET_NAME_OBJECT(self, @selector(maskTimeEnd), kUserNoti_MASKEND, nil); [IQKeyboardManager sharedManager].enable = NO; [[IQKeyboardManager sharedManager] setEnableAutoToolbar:NO]; } - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; + NC_REMOVE_NAME(self, kUserNoti_MASKEND, nil); [IQKeyboardManager sharedManager].enable = YES; [[IQKeyboardManager sharedManager] setEnableAutoToolbar:YES]; } --(void)showFlyingCommit{ - NSArray *classArray = @[@"GiGaCommentView",@"GiGaCommentView"]; - NSArray *nameArray = @[@"mc子龙",@"小明",@"赵四",@"狂小狗",@"葬爱"]; - NSArray *msgArray = @[@"老铁666",@"主播,多少礼物给卡黄啊?",@"文明观球,大家有秩序排队观看,不要着急",@"主播,我报警啦",@"就是个萨比,还扮滴酷酷滴aaaaa"]; - NSArray *avatarArray = @[@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color",@"home_login_qq_color"]; - int classRandomIndex = arc4random() % 2; - int nameRandomIndex = arc4random() % 5; - int msgRandomIndex = arc4random() % 5; - int avatarRandomIndex = arc4random() % 5; +- (void)viewDidLoad { - GiGaCommentModel *model = [[GiGaCommentModel alloc]init]; - model.userName = nameArray[nameRandomIndex]; - model.msg = msgArray[msgRandomIndex]; - model.userAvatar = avatarArray[avatarRandomIndex]; + [super viewDidLoad]; + + // Do any additional setup after loading the view. + [self.view addSubview: self.commitInputView]; + weakify(self); + + self.commitInputView.SendCommentHandler = ^(NSString *content) { + GILog(@"发送->:%@",content); + NSArray *arr = @[@{ + @"content":content, + @"room":@"", + @"sendUserName":@"lianxiang" + }]; + + [weakSelf.client emit:@"talk" with:arr]; + + }; + + //开启弹幕 + + [[LXDanMuManager shareInstance] createDanmuWithTrackSpeedArray:@[@1.00,@1.00,@3.00,@4.00] centerY:KMainH / 4 trackWidth:KMainW showInView:self.view]; + [[LXDanMuManager shareInstance] start]; + //socket + [self connetction]; + +} + +-(void)connetction{ + + NSURL* url = [[NSURL alloc] initWithString:@"http://wsyts.s1.natapp.cc"]; +// NSDictionary* headers = @{@"EncodeUTF8":@YES}; + SocketManager *manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES,@"connectParams":@{@"token":@""},@"doubleEncodeUTF8":@YES}]; + + + _manager = manager; + _client = manager.defaultSocket; + + [self.manager connect]; + weakify(self); + [self.client on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) { + NSLog(@"*************\n\niOS客户端上线\n\n*************"); + }]; + + [self.client on:@"connectedSocket" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) { + NSLog(@"connectedSocket:%@",event); + }]; + + [self.client on:@"onTalk" callback:^(NSArray * _Nonnull envent, SocketAckEmitter * _Nonnull ack) { + + NSString *json =envent[0]; + NSLog(@"callback json***:%@",json); + NSDictionary *dic = [GiGaHelper dictionaryWithJsonString:json]; + + if (dic == nil) { + NSLog(@"解析失败"); + }else{ + GiGaCommentModel *commentModel = [[GiGaCommentModel alloc] initWithDictionary:dic error:nil]; + GILog(@"接收->:%@",[dic[@"content"] replaceUnicode:dic[@"content"]]); + [weakSelf showDanMuWith:commentModel]; + } + }]; + + [self.client on:@"disconnect" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) { + NSLog(@"*************\n\niOS客户端下线\n\n*************%@",event?event[0]:@""); + }]; + + [self.client on:@"error" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) { +// NSString *htmlString =event[0]; +// htmlString = [self htmlEntityDecode:htmlString]; +// +// UIWebView * webView = [[UIWebView alloc]initWithFrame:CGRectMake(20, 300, self.view.frame.size.width - 40, 400)]; +// [webView loadHTMLString:htmlString baseURL:nil]; +// [self.view addSubview:webView]; +// +// NSLog(@"*************\n\n%@\n\n*************",event?event[0]:@""); + GILog(@"请求超时"); + + }]; +} + +- (GiGaFlyingCommitInputView *)commitInputView{ + + if (!_commitInputView) { + _commitInputView = [[GiGaFlyingCommitInputView alloc] initWithFrame:self.view.bounds]; + [_commitInputView setPalceholderText:@"请输入弹幕"]; + } + return _commitInputView; +} + + +//弹幕插入 +-(void)showDanMuWith:(GiGaCommentModel *)model{ + + NSArray *classArray = @[@"GiGaCommentView",@"GiGaCommentView"]; + int classRandomIndex = arc4random() % 2; GiGaCommentView *customView = [[NSClassFromString(classArray[classRandomIndex]) alloc] initWithMsgModel:model height:TRACK_HEIGHT]; [[LXDanMuManager shareInstance] appendDanMuWithCustomView:customView toTrackIndex:-1]; } @@ -90,11 +150,19 @@ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. } -(void)dealloc{ - NC_REMOVE_NAME(self, kUserNoti_MASKEND, nil); + NSLog(@"dealloc"); +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + [self.manager disconnectSocket:self.client]; + [self.manager disconnect]; + [self.client disconnect]; + self.client = nil; + self.manager = nil; + [self dismissViewControllerAnimated:YES completion:nil]; } @end diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index cb118b7..7da2025 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -34,64 +34,45 @@ } @property(nonatomic,strong)MaskViewBootomWaringView *waringView; -@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,strong) MaskTimeCircularProgressView *cicleProgressView; +@property(nonatomic,strong) UIImageView *swipeGaurdimagView; +@property(nonatomic,strong) UIButton *startMaskButton; +@property(nonatomic,strong) UIButton *startTestButton; @end @implementation GiGaMaskTaskViewController -//提示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 _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; -} - +#pragma mark - property //面膜 - (UIImageView *)maskImageView{ if (!_maskImageView) { _maskImageView = [[UIImageView alloc] init]; _maskImageView.userInteractionEnabled = YES; //_maskImageView.backgroundColor = [UIColor purpleColor]; - _maskImageView.image = [UIImage imageNamed:@"img_bg"]; - UIPanGestureRecognizer *pangesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)]; - [_maskImageView addGestureRecognizer:pangesture]; + _maskImageView.image = [UIImage imageNamed:@"img_mask"]; + + UISwipeGestureRecognizer * upSwipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(maskupSwipeGesture)]; + [upSwipeGesture setDirection:(UISwipeGestureRecognizerDirectionUp)]; + [_maskImageView addGestureRecognizer:upSwipeGesture]; + + UITapGestureRecognizer *tapgesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(maskTapAction)]; + [_maskImageView addGestureRecognizer:tapgesture]; + } return _maskImageView; } + //人脸 - (UIImageView *)faceView{ if (!_faceView) { _faceView = [[UIImageView alloc] init]; //_faceView.backgroundColor = [UIColor lightGrayColor]; _faceView.userInteractionEnabled = YES; - _faceView.image = [UIImage imageNamed:@"img_bg_head"]; + _faceView.image = [UIImage imageNamed:@"bg_img_face"]; } return _faceView; } @@ -107,6 +88,40 @@ } return _cicleProgressView; } +//⬆️ +- (UIImageView *)swipeGaurdimagView{ + if (!_swipeGaurdimagView) { + _swipeGaurdimagView = [[UIImageView alloc] init]; + _swipeGaurdimagView.image = [UIImage imageNamed:@"mask_bg_up"]; + } + return _swipeGaurdimagView; +} + +//开始面膜 +- (UIButton *)startMaskButton{ + + if (!_startMaskButton) { + _startMaskButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_startMaskButton setBackgroundImage:[UIImage imageNamed:@"btn_start_mask"] forState:UIControlStateNormal]; + NSAttributedString *title = [GiGaHelper stringWithText:@"开始敷面膜" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0]; + [_startMaskButton setAttributedTitle:title forState:UIControlStateNormal]; + [_startMaskButton addTarget:self action:@selector(startMaskButtonAction) forControlEvents:UIControlEventTouchUpInside]; + + } + return _startMaskButton; +} + +//开始测试 +- (UIButton *)startTestButton{ + if (!_startTestButton) { + _startTestButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_startTestButton setBackgroundImage:[UIImage imageNamed:@"btn_start_test"] forState:UIControlStateNormal]; + NSAttributedString *title = [GiGaHelper stringWithText:@"测试肤质" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTBOLD(18) leterSpace:0]; + [_startTestButton setAttributedTitle:title forState:UIControlStateNormal]; + [_startTestButton addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside]; + } + return _startTestButton; +} //底部提示栏 - (MaskViewBootomWaringView *)waringView{ @@ -127,80 +142,14 @@ }else{ GiGaFlingVC.modalPresentationStyle = UIModalPresentationCurrentContext; } - GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; + GiGaFlingVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3]; [self presentViewController:GiGaFlingVC animated:NO completion:nil]; } -//滑动手势 --(void)panGestureAction:(UIPanGestureRecognizer *)pan{ - - CGPoint panLocation = [pan locationInView:self.view]; - NSLog(@"panlocation.y:%f",panLocation.y); - if (pan.state == UIGestureRecognizerStateBegan) { - [self animaMask]; - }else if (pan.state == UIGestureRecognizerStateChanged){ - - - }else if (pan.state == UIGestureRecognizerStateEnded){ - - }else{ - - } -} - -#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 - 118); - }]; - [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.attachPoint.y -174); - }]; - - [self.view layoutIfNeeded]; - } completion:^(BOOL finished) { - self.cicleProgressView.hidden = NO; - self.maskImageView.userInteractionEnabled = NO; - //开始面膜时间 - [self startMaskTime]; - }]; -} - -#pragma mark 面膜时间结束复原动画 --(void)endMaskAnimation{ - - 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(314 + PhoneX_TopMargin); - }]; - - [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(103 + PhoneX_TopMargin); - }]; - - [self.view layoutIfNeeded]; - - } completion:^(BOOL finished) { - self.maskImageView.userInteractionEnabled = YES; - - }]; -} - +#pragma mark - 生命周期 -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; - } -(void)viewDidAppear:(BOOL)animated{ @@ -233,49 +182,121 @@ } +#pragma mark - 响应事件 + +#pragma mark 上滑动手势 +-(void)maskupSwipeGesture{ + [self animaMask]; +} +#pragma mark 点击手势 +-(void)maskTapAction{ + [self animaMask]; +} +#pragma mark 点击测试按钮 +-(void)startMaskButtonAction{ + [self animaMask]; +} + +#pragma mark - 开始面膜时间动画 +-(void)animaMask{ + + + self.swipeGaurdimagView.hidden = YES; + self.startMaskButton.hidden = YES; + self.startTestButton.hidden = YES; + [self.view layoutIfNeeded]; + [UIView animateWithDuration:1.0 animations:^{ + [self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.attachPoint.y - 87); + }]; + [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.attachPoint.y -124); + }]; + + [self.view layoutIfNeeded]; + } completion:^(BOOL finished) { + self.cicleProgressView.hidden = NO; + self.maskImageView.userInteractionEnabled = NO; + //开始面膜时间 + [self startMaskTime]; + }]; +} + +#pragma mark 面膜时间结束复原动画 +-(void)endMaskAnimation{ + + self.cicleProgressView.hidden = YES; + self.swipeGaurdimagView.hidden = NO; + self.startMaskButton.hidden = NO; + self.startTestButton.hidden = NO; + + [self.view layoutIfNeeded]; + [UIView animateWithDuration:1.0 animations:^{ + [self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(254 + PhoneX_TopMargin); + }]; + + [self.faceView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(91 + PhoneX_TopMargin); + }]; + + [self.view layoutIfNeeded]; + + } completion:^(BOOL finished) { + self.maskImageView.userInteractionEnabled = YES; + + }]; +} + +#pragma mark 布局 -(void)initUI{ - self.view.backgroundColor = GIGARGB(56, 56, 56, 1); + self.view.backgroundColor = GIGA_MAIN_BGCOLOR; [self.view addSubview:self.maskImageView]; [self.view addSubview:self.faceView]; [self.view bringSubviewToFront:self.maskImageView]; - [self.view addSubview:self.descBackView]; + [self.view addSubview:self.swipeGaurdimagView]; + [self.view addSubview:self.startMaskButton]; + [self.view addSubview:self.startTestButton]; [self.view addSubview:self.cicleProgressView]; //face + [self.faceView mas_makeConstraints:^(MASConstraintMaker *make) { - 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)); + make.top.mas_equalTo(self.view.mas_top).offset(91 + PhoneX_TopMargin); + make.size.mas_equalTo(CGSizeMake(99, 124)); + make.centerX.mas_equalTo(self.view.mas_centerX); }]; //mask [self.maskImageView mas_makeConstraints:^(MASConstraintMaker *make) { - 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.descBackView mas_makeConstraints:^(MASConstraintMaker *make){ - make.top.mas_equalTo(500 + PhoneX_TopMargin); - make.width.mas_equalTo(149); - make.height.mas_equalTo(45); + make.top.mas_equalTo(self.view.mas_top).offset(254 + PhoneX_TopMargin); + make.size.mas_equalTo(CGSizeMake(72, 87)); make.centerX.mas_equalTo(self.view.mas_centerX); }]; - [self.descBackView addSubview:self.descLabl]; + //up + [self.swipeGaurdimagView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.view.mas_top).offset(368); + make.width.and.height.mas_equalTo(20); + make.centerX.mas_equalTo(self.view.mas_centerX); - [self.descLabl mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(121); - make.height.mas_equalTo(32); - make.center.mas_equalTo(self.descBackView.center); + }]; + //startMask + [self.startMaskButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.view.mas_top).offset(412); + make.size.mas_equalTo(CGSizeMake(117, 25)); + make.centerX.mas_equalTo(self.view.mas_centerX); + }]; + //startTest + [self.startTestButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.view.mas_top).offset(486); + make.size.mas_equalTo(CGSizeMake(132, 41)); + make.centerX.mas_equalTo(self.view.mas_centerX); + }]; - }]; // UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -403,6 +424,8 @@ #pragma mark 开始测试 -(void)testBtnAcion:(UIButton *)btn{ + [self createInputView]; + return; BOOL isUserLogin = [GiGaUserDefault isUserLogin]; @@ -478,17 +501,18 @@ #pragma mark - setUpNav -(void)setUpNav{ //leftItem - UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - leftBtn.frame = CGRectMake(0, 0, 40, 40); - leftBtn.backgroundColor = [UIColor redColor]; - [leftBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal]; - [leftBtn addTarget:self action:@selector(leftBtnAction) forControlEvents:UIControlEventTouchUpInside]; - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn]; +// UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom]; +// leftBtn.frame = CGRectMake(0, 0, 40, 40); +// leftBtn.backgroundColor = [UIColor redColor]; +// [leftBtn setImage:[UIImage imageNamed:@"btn_back"] forState:UIControlStateNormal]; +// [leftBtn addTarget:self action:@selector(leftBtnAction) forControlEvents:UIControlEventTouchUpInside]; +// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn]; + //rightItem UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; rightBtn.frame = CGRectMake(0, 0, 40, 40); - rightBtn.backgroundColor = [UIColor blueColor]; - [rightBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal]; + //rightBtn.backgroundColor = [UIColor blueColor]; + [rightBtn setImage:[UIImage imageNamed:@"nav_circle_avatar"] forState:UIControlStateNormal]; [rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn]; diff --git a/GIGA/Modules/Mask/Controller/UserGuardViewController.m b/GIGA/Modules/Mask/Controller/UserGuardViewController.m index 788cc92..88ecbdd 100644 --- a/GIGA/Modules/Mask/Controller/UserGuardViewController.m +++ b/GIGA/Modules/Mask/Controller/UserGuardViewController.m @@ -18,7 +18,6 @@ - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. //self.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1]; [self creatUI]; diff --git a/GIGA/Modules/Mask/Model/GiGaCommentModel.h b/GIGA/Modules/Mask/Model/GiGaCommentModel.h index c683e4d..a7dc294 100644 --- a/GIGA/Modules/Mask/Model/GiGaCommentModel.h +++ b/GIGA/Modules/Mask/Model/GiGaCommentModel.h @@ -10,9 +10,10 @@ #import "JSONModel.h" @interface GiGaCommentModel :JSONModel -@property (nonatomic,copy) NSString *userName; -@property (nonatomic,copy) NSString *userLevel; -@property (nonatomic,copy) NSString *msg; -@property (nonatomic,copy) NSString *userAvatar; +@property (nonatomic,copy) NSString *color; +@property (nonatomic,copy) NSString *content; +@property (nonatomic,copy) NSString *room; +@property (nonatomic,copy) NSString *sendUserHeadImg; +@property (nonatomic,copy) NSString *sendUserName; @end diff --git a/GIGA/Modules/Mask/View/GiGaCommentView.m b/GIGA/Modules/Mask/View/GiGaCommentView.m index 68f3c87..21de34f 100644 --- a/GIGA/Modules/Mask/View/GiGaCommentView.m +++ b/GIGA/Modules/Mask/View/GiGaCommentView.m @@ -8,6 +8,9 @@ #import "GiGaCommentView.h" #import "Masonry.h" +#import "UIImageView+WebCache.h" +#import "NSString+Unicode.h" + @interface GiGaCommentView() @property(nonatomic,strong) UILabel *userName; @property(nonatomic,strong) UIImageView *userAvtar; @@ -38,12 +41,10 @@ -(void)initUI{ UIImageView *avatar = [[UIImageView alloc] init]; - avatar.image = [UIImage imageNamed:@"home_login_qq_color"]; - //avatar.frame = CGRectMake(3, 3, self.frame.size.height - 6, self.frame.size.height - 6); avatar.layer.masksToBounds = YES; avatar.layer.cornerRadius = 15; [self addSubview:avatar]; - avatar.image = [UIImage imageNamed:_msgModel.userAvatar]; + [avatar sd_setImageWithURL:[NSURL URLWithString:_msgModel.sendUserHeadImg] placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]]; self.userAvtar = avatar; [self.userAvtar mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(30); @@ -57,7 +58,10 @@ namelabel.font = [UIFont systemFontOfSize:14]; namelabel.textColor = [UIColor blackColor]; //namelabel.frame= CGRectMake(CGRectGetMaxX(avatar.frame) + 5, 4, namelabel.frame.size.width, namelabel.frame.size.height); - namelabel.text = _msgModel.userName; + namelabel.text = @"用户名"; + if (_msgModel.sendUserName && _msgModel.sendUserName.length > 0) { + namelabel.text = [_msgModel.sendUserName replaceUnicode:_msgModel.sendUserName]; + } [namelabel sizeToFit]; self.userName = namelabel; [self addSubview:self.userName]; @@ -73,7 +77,10 @@ msglabel.textColor = [UIColor blackColor]; //msglabel.frame= CGRectMake(namelabel.frame.origin.x, CGRectGetMaxY(avatar.frame) - msglabel.frame.size.height - namelabel.frame.origin.y, msglabel.frame.size.width, msglabel.frame.size.height); - msglabel.text = _msgModel.msg; + msglabel.text = @"信息内容"; + if (_msgModel.content && _msgModel.content.length > 0) { + msglabel.text = [_msgModel.content replaceUnicode:_msgModel.content]; + } self.msg = msglabel; [msglabel sizeToFit]; [self addSubview:self.msg]; diff --git a/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m index 2aca781..6ddf4fa 100644 --- a/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m +++ b/GIGA/Modules/Mask/View/MaskTimeCircularProgressView.m @@ -81,7 +81,6 @@ _countLabel.text = @"00:00"; _countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22]; - } return _countLabel; } diff --git a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m index fe29b77..4274f19 100644 --- a/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m +++ b/GIGA/Modules/Mask/View/MaskViewBootomWaringView.m @@ -15,7 +15,7 @@ self = [super initWithFrame:frame]; if (self) { - self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8]; + self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.2]; [self setUpUI]; } @@ -24,26 +24,17 @@ -(void)setUpUI{ - UIImageView *iconImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]]; - iconImg.backgroundColor = [UIColor redColor]; - [self addSubview:iconImg]; - [iconImg mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.and.height.mas_equalTo(40); - make.left.mas_equalTo(10); - make.centerY.mas_equalTo(self.mas_centerY); - - }]; UILabel *waringLabel = [[UILabel alloc] init]; - waringLabel.text = @"亲爱滴,请您务必要开启手机声音哦"; + waringLabel.text = @"♥️ 亲,请您务必要开启手机声音哦~"; waringLabel.textColor = [UIColor whiteColor]; waringLabel.textAlignment = NSTextAlignmentCenter; - waringLabel.font = [UIFont systemFontOfSize:12]; + waringLabel.font = GIGA_TEXTFONTMEDIUM(14); [self addSubview:waringLabel]; [waringLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.mas_left).offset(40); + make.left.mas_equalTo(self.mas_left).offset(10); make.right.mas_equalTo(self.mas_right).offset(-40); make.centerY.mas_equalTo(self.mas_centerY); }]; diff --git a/GIGA/ViewController.m b/GIGA/ViewController.m index 6f0f30e..644305a 100644 --- a/GIGA/ViewController.m +++ b/GIGA/ViewController.m @@ -16,9 +16,8 @@ @implementation ViewController - (void)viewDidLoad { - [super viewDidLoad]; - self.view.backgroundColor = [UIColor purpleColor]; + [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } @@ -29,5 +28,8 @@ // Dispose of any resources that can be recreated. } +- (UIStatusBarStyle)preferredStatusBarStyle{ + return UIStatusBarStyleLightContent; +} @end