From d0230f55ed29abc041d067c3343a180cc1f985dd Mon Sep 17 00:00:00 2001 From: lianxiang <13052344590@163.com> Date: Wed, 26 Sep 2018 00:33:06 +0800 Subject: [PATCH] add --- GIGA.xcodeproj/project.pbxproj | 46 ++++ GIGA/AppDelegate+ThirdParty.m | 7 +- GIGA/AppDelegate.m | 3 + .../maskTime/btn_talk.imageset/Contents.json | 13 ++ .../btn_talk.imageset/btn_talk@2x.png | Bin 0 -> 739 bytes .../bg_moreandmore_red.imageset/Contents.json | 8 + .../history_heart.imageset/Contents.json | 21 ++ .../history_heart@2x.png | Bin 0 -> 680 bytes .../history_rule.imageset/Contents.json | 21 ++ .../history_rule.imageset/history_rule@2x.png | Bin 0 -> 1122 bytes .../img_camera.imageset/Contents.json | 8 + .../img_holder.imageset/Contents.json | 8 + .../tab_indicator.imageset/Contents.json | 21 ++ .../tab_indicator@2x.png | Bin 0 -> 498 bytes GIGA/Category/UIImage+LogoQrCode.h | 16 ++ GIGA/Category/UIImage+LogoQrCode.m | 52 +++++ GIGA/Category/UIImage+ShotImage.h | 15 ++ GIGA/Category/UIImage+ShotImage.m | 39 ++++ GIGA/Common/GiGaHelper.h | 2 + GIGA/Common/GiGaHelper.m | 13 ++ GIGA/Common/GiGaNetTool/GiGaNetManager.h | 2 +- GIGA/Common/GiGaNetTool/GiGaNetManager.m | 41 +++- GIGA/Common/GiGaNetTool/WeiIXinApiManager.h | 2 + GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h | 1 + GIGA/Common/GiGaUserDB/GiGaUserManager.h | 6 + GIGA/Common/GiGaUserDB/GiGaUserManager.m | 9 + GIGA/Config/ApiRequestConfig.h | 18 +- GIGA/GIGA.pch | 1 + .../Controller/GiGaWebViewController.xib | 4 +- .../Mask/Controller/GiGaFlingCommitVC.m | 4 + .../Controller/GiGaMaskTaskViewController.m | 71 ++++++- .../Mask/Controller/ShareViewController.m | 82 ++++++-- .../Exercises/Controller/GiGaQuestionVC.m | 77 ++++--- .../Exercises/Controller/MaskTestResultVC.h | 1 + .../Exercises/Controller/MaskTestResultVC.m | 113 ++++++---- .../Mask/Exercises/Model/MaskTestResult.h | 7 +- .../Mask/Exercises/View/GIGaQuestionSlider.m | 57 ++++- .../View/MaskResultViews/MaskResultCandView.h | 5 + .../View/MaskResultViews/MaskResultCandView.m | 25 +++ .../MaskResultViews/MaskResultMinViewCell.m | 10 +- .../MaskResultViews/MaskResultShareViewCell.h | 7 +- .../MaskResultViews/MaskResultShareViewCell.m | 18 +- .../View/NYSliderPopover/NYSliderPopover.m | 59 ++++++ .../Mask/View/GiGaFlyingCommitInputView.m | 2 +- .../MaskShareBoootomViewCell.m | 8 +- GIGA/Modules/Me/Controller/GIGaAboutUsVC.xib | 17 +- GIGA/Modules/Me/Controller/GIGaChangePassVC.m | 24 ++- .../Me/Controller/GiGaChangePhoneNumberVC.m | 62 +++++- .../Controller/GiGaFeedBackViewController.m | 73 ++++--- .../Me/Controller/GiGaMeViewController.m | 9 +- .../Me/Controller/GiGaUserViewController.m | 20 +- .../Me/Controller/GiMaskTimeHistoryVC.m | 197 +++++++++++++++++- GIGA/Modules/Me/Controller/GiSysSettingsVC.m | 18 +- GIGA/Modules/Me/Model/GIGaFeedKind.h | 2 + GIGA/Modules/Me/Model/MaskHistryRecord.h | 40 ++++ GIGA/Modules/Me/Model/MaskHistryRecord.m | 36 ++++ .../View/FeedViews/GIGaFeedPhontosViewCell.m | 9 +- .../Me/View/FeedViews/GiGaFeedBackKindView.h | 5 +- .../Me/View/FeedViews/GiGaFeedBackKindView.m | 19 +- .../HistoryView/MasHistoryFirstViewCell.h | 19 ++ .../HistoryView/MasHistoryFirstViewCell.m | 56 +++++ .../HistoryView/MasHistoryFirstViewCell.xib | 113 ++++++++++ .../HistoryView/MaskHistoryListViewCell.h | 19 ++ .../HistoryView/MaskHistoryListViewCell.m | 48 +++++ .../HistoryView/MaskHistoryListViewCell.xib | 90 ++++++++ .../userInfoView/GIGaUserChangeMobleCell.h | 4 + .../userInfoView/GIGaUserChangeMobleCell.m | 1 + .../userInfoView/GIGaUserChangeMobleCell.xib | 4 +- 68 files changed, 1599 insertions(+), 209 deletions(-) create mode 100644 GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/maskTime/btn_talk.imageset/btn_talk@2x.png create mode 100644 GIGA/Assets.xcassets/userCenter/history_heart.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/history_heart.imageset/history_heart@2x.png create mode 100644 GIGA/Assets.xcassets/userCenter/history_rule.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/history_rule.imageset/history_rule@2x.png create mode 100644 GIGA/Assets.xcassets/userCenter/tab_indicator.imageset/Contents.json create mode 100644 GIGA/Assets.xcassets/userCenter/tab_indicator.imageset/tab_indicator@2x.png create mode 100644 GIGA/Category/UIImage+LogoQrCode.h create mode 100644 GIGA/Category/UIImage+LogoQrCode.m create mode 100644 GIGA/Category/UIImage+ShotImage.h create mode 100644 GIGA/Category/UIImage+ShotImage.m create mode 100644 GIGA/Modules/Me/Model/MaskHistryRecord.h create mode 100644 GIGA/Modules/Me/Model/MaskHistryRecord.m create mode 100644 GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.h create mode 100644 GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.m create mode 100644 GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.xib create mode 100644 GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.h create mode 100644 GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.m create mode 100644 GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.xib diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 28092b6..ece2243 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -224,6 +224,13 @@ 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 */; }; + 83C78A0F215872F80083DDD9 /* MasHistoryFirstViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A0D215872F80083DDD9 /* MasHistoryFirstViewCell.m */; }; + 83C78A10215872F80083DDD9 /* MasHistoryFirstViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83C78A0E215872F80083DDD9 /* MasHistoryFirstViewCell.xib */; }; + 83C78A14215873170083DDD9 /* MaskHistoryListViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A12215873170083DDD9 /* MaskHistoryListViewCell.m */; }; + 83C78A15215873170083DDD9 /* MaskHistoryListViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83C78A13215873170083DDD9 /* MaskHistoryListViewCell.xib */; }; + 83C78A192159D74D0083DDD9 /* UIImage+LogoQrCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A182159D74D0083DDD9 /* UIImage+LogoQrCode.m */; }; + 83C78A1C2159DD920083DDD9 /* UIImage+ShotImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C78A1B2159DD920083DDD9 /* UIImage+ShotImage.m */; }; + 83D3832D215A2CF5009E8669 /* MaskHistryRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 83D3832C215A2CF5009E8669 /* MaskHistryRecord.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 */ @@ -632,6 +639,18 @@ 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 = ""; }; + 83C78A0C215872F80083DDD9 /* MasHistoryFirstViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasHistoryFirstViewCell.h; sourceTree = ""; }; + 83C78A0D215872F80083DDD9 /* MasHistoryFirstViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasHistoryFirstViewCell.m; sourceTree = ""; }; + 83C78A0E215872F80083DDD9 /* MasHistoryFirstViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MasHistoryFirstViewCell.xib; sourceTree = ""; }; + 83C78A11215873170083DDD9 /* MaskHistoryListViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskHistoryListViewCell.h; sourceTree = ""; }; + 83C78A12215873170083DDD9 /* MaskHistoryListViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskHistoryListViewCell.m; sourceTree = ""; }; + 83C78A13215873170083DDD9 /* MaskHistoryListViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskHistoryListViewCell.xib; sourceTree = ""; }; + 83C78A172159D74D0083DDD9 /* UIImage+LogoQrCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+LogoQrCode.h"; sourceTree = ""; }; + 83C78A182159D74D0083DDD9 /* UIImage+LogoQrCode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LogoQrCode.m"; sourceTree = ""; }; + 83C78A1A2159DD920083DDD9 /* UIImage+ShotImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+ShotImage.h"; sourceTree = ""; }; + 83C78A1B2159DD920083DDD9 /* UIImage+ShotImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ShotImage.m"; sourceTree = ""; }; + 83D3832B215A2CF5009E8669 /* MaskHistryRecord.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskHistryRecord.h; sourceTree = ""; }; + 83D3832C215A2CF5009E8669 /* MaskHistryRecord.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskHistryRecord.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 = ""; }; @@ -997,6 +1016,10 @@ 8345C13521414D3B00051717 /* NSString+Unicode.m */, 83773FC021479FED0014EE4C /* UIColor+HexColor.h */, 83773FC121479FED0014EE4C /* UIColor+HexColor.m */, + 83C78A172159D74D0083DDD9 /* UIImage+LogoQrCode.h */, + 83C78A182159D74D0083DDD9 /* UIImage+LogoQrCode.m */, + 83C78A1A2159DD920083DDD9 /* UIImage+ShotImage.h */, + 83C78A1B2159DD920083DDD9 /* UIImage+ShotImage.m */, ); path = Category; sourceTree = ""; @@ -1075,6 +1098,8 @@ 8342FD852150FD5200D141F4 /* VersionModel.m */, 83A1DDB021574807006DE881 /* GIGaFeedKind.h */, 83A1DDB121574807006DE881 /* GIGaFeedKind.m */, + 83D3832B215A2CF5009E8669 /* MaskHistryRecord.h */, + 83D3832C215A2CF5009E8669 /* MaskHistryRecord.m */, ); path = Model; sourceTree = ""; @@ -1082,6 +1107,7 @@ 8361B42A212180A100238FEB /* View */ = { isa = PBXGroup; children = ( + 83C78A0B215872740083DDD9 /* HistoryView */, 8382DFA3215622C600BBA5A5 /* FeedViews */, 8342FD7E2150F94F00D141F4 /* AppVerionDescCells */, 838762CF214B9CAA0039D241 /* userInfoView */, @@ -1600,6 +1626,19 @@ path = NYSliderPopover; sourceTree = ""; }; + 83C78A0B215872740083DDD9 /* HistoryView */ = { + isa = PBXGroup; + children = ( + 83C78A0C215872F80083DDD9 /* MasHistoryFirstViewCell.h */, + 83C78A0D215872F80083DDD9 /* MasHistoryFirstViewCell.m */, + 83C78A0E215872F80083DDD9 /* MasHistoryFirstViewCell.xib */, + 83C78A11215873170083DDD9 /* MaskHistoryListViewCell.h */, + 83C78A12215873170083DDD9 /* MaskHistoryListViewCell.m */, + 83C78A13215873170083DDD9 /* MaskHistoryListViewCell.xib */, + ); + path = HistoryView; + sourceTree = ""; + }; 83E40B2C21218B7E008149C4 /* LogIn */ = { isa = PBXGroup; children = ( @@ -1764,6 +1803,7 @@ 83BFAE6D213CD0E3004EF801 /* GiGaMineInfoViewCell.xib in Resources */, 8382DFA82156247F00BBA5A5 /* GiGaFeedLeiIingViewCell.xib in Resources */, 8376B82E2154A35100AB79F8 /* MaskTimeTimeViewCell.xib in Resources */, + 83C78A10215872F80083DDD9 /* MasHistoryFirstViewCell.xib in Resources */, 8361B3D6212155C300238FEB /* LaunchScreen.storyboard in Resources */, 838762E3214B9F580039D241 /* GiGaUserSexViewCell.xib in Resources */, 838388DA2130046D00D14C53 /* emojizone.mp4 in Resources */, @@ -1803,6 +1843,7 @@ 8382DFB221562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib in Resources */, 8338F6B12142182200B4780B /* MaskTime.png in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, + 83C78A15215873170083DDD9 /* MaskHistoryListViewCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1961,6 +2002,7 @@ 83835BA0212E43BD001480F2 /* GiGaMasssagesVC.m in Sources */, 8357ADCD2123C091000816F2 /* GiGaNetManager.m in Sources */, 838388D4212FB7D700D14C53 /* JXTAlertView.m in Sources */, + 83D3832D215A2CF5009E8669 /* MaskHistryRecord.m in Sources */, 83901178214E20B2004CA790 /* LYSDatePickerItem.m in Sources */, 8342FD8A2151095100D141F4 /* AppVersionLogoCell.m in Sources */, 8384F0EB21533542002C19F0 /* MaskResultMinViewCell.m in Sources */, @@ -1969,6 +2011,7 @@ 8382DFEE21564A1F00BBA5A5 /* SJPhotoPickerManager.m in Sources */, 83A1DDB221574807006DE881 /* GIGaFeedKind.m in Sources */, 83901172214E20B2004CA790 /* LYSDatePickerTypeDayAndTimeDelegate.m in Sources */, + 83C78A1C2159DD920083DDD9 /* UIImage+ShotImage.m in Sources */, 835060A9212D38EE007E6220 /* GiGaStartAdView.m in Sources */, 83928FFA2134D8F60077D2E8 /* GiGaFlyingCommitInputView.m in Sources */, 8390116D214E20B2004CA790 /* LYSDateBaseViewController.m in Sources */, @@ -1986,6 +2029,7 @@ 83773FBF214791E10014EE4C /* GIGaQuestionSlider.m in Sources */, 83901179214E20B2004CA790 /* LYSDatePickerTypeBase.m in Sources */, 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */, + 83C78A192159D74D0083DDD9 /* UIImage+LogoQrCode.m in Sources */, 8361B3CB212155C200238FEB /* AppDelegate.m in Sources */, 8382DFB92156389200BBA5A5 /* GIGaFeedImagsCollectionCell.m in Sources */, 8351474621521CC500B25A88 /* GiGaChangePhoneNumberVC.m in Sources */, @@ -2021,6 +2065,7 @@ 833DE8E52150169F009D4329 /* JYAddressPicker.m in Sources */, 834127212152AEFB001DDB36 /* GIGaMaskTimeUseRecordVC.m in Sources */, 83901171214E20B2004CA790 /* LYSDatePickerLabel.m in Sources */, + 83C78A14215873170083DDD9 /* MaskHistoryListViewCell.m in Sources */, 838762E2214B9F580039D241 /* GiGaUserSexViewCell.m in Sources */, 8382DFAC215626CE00BBA5A5 /* GiGaFeedContentViewCell.m in Sources */, 839290052134F4240077D2E8 /* LXDanMuTrackView.m in Sources */, @@ -2049,6 +2094,7 @@ 83BFAE70213CDB29004EF801 /* GiMaskTimeHistoryVC.m in Sources */, 8382DFEA21564A1F00BBA5A5 /* SJPhotoAlbumsController.m in Sources */, 83A22718212ABDFF00B3E75C /* GiGaBlockButton.m in Sources */, + 83C78A0F215872F80083DDD9 /* MasHistoryFirstViewCell.m in Sources */, 8382DFED21564A1F00BBA5A5 /* SJPhotoPickerNavController.m in Sources */, 83928FFE2134F37D0077D2E8 /* GiGaSocketRocketUtility.m in Sources */, 83A2270C212A97ED00B3E75C /* MaskViewBootomWaringView.m in Sources */, diff --git a/GIGA/AppDelegate+ThirdParty.m b/GIGA/AppDelegate+ThirdParty.m index 5188787..0d34295 100644 --- a/GIGA/AppDelegate+ThirdParty.m +++ b/GIGA/AppDelegate+ThirdParty.m @@ -42,6 +42,11 @@ //微信 [WXApi registerApp:WXin_APPID]; + + [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) { + NSLog(@"%@",log); + + }]; //bugly [Bugly startWithAppId:nil]; //友盟统计 @@ -62,7 +67,7 @@ //WXApiDelegate - (void)onReq:(BaseReq *)req{ - + } - (void)onResp:(BaseResp *)resp{ diff --git a/GIGA/AppDelegate.m b/GIGA/AppDelegate.m index d0212e2..cd83dd5 100644 --- a/GIGA/AppDelegate.m +++ b/GIGA/AppDelegate.m @@ -44,6 +44,9 @@ [[GiGaUserManager shareUser] synsisUserInfo:nil userErrorMsgBlock:^(NSDictionary *errorCodemsg) { if ([errorCodemsg[@"code"] integerValue] == 401) { + + [[GiGaUserManager shareUser] loginOut]; + NC_POST_NAME_OBJECT(kUserLogOutNotify, nil); //token失效 [GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self.window.rootViewController]; } diff --git a/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json new file mode 100644 index 0000000..745e8c3 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "btn_talk@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/btn_talk@2x.png b/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/btn_talk@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..04bdae659449519502d1ccd826fb7d9a46ffe66d GIT binary patch literal 739 zcmV<90v!E`P)Px%ok>JNRA>d|+OclaKo|#bf0sxk5sE;T7%EZ3)bI)^ED;$X3}t9}3dDfKLm)9! zeG59!fh-thf#wz3P8AGALaIPfm86oBlIXUGhtOpi=R0nC!+OUr8#$dCR4v zR_i&CFSXW>a7KB#vr;eRi^vxscGh~m56gVof5C_C_PR5fyalwmOoi7~2JpU9D!plV z-u_i>_$OFzZkCQtPu~Ih>Z%H|_8#EdYp(lRc6TR>+O`mUys>d>JQ%#k+-xs8Df9mm z@hbKD*8RP`-|@E2fr&jI4EpHV2l2vr%A=>{`=C`r-{jZ_-3iDFR<%hwy_un4It*0=;I3#2a$rPdx;m08cG_6galm{#^M7w>i?SQQ?%FtqJRv~o!Qu!9RNtco!r zTfnp`2E=Ru)5G}3BTOX%vI!hi@|?FmNgaa9h20(m{s0LzQ`mP-Uo93%CN*yp;Z(X)$o9q5|_2k3_DKFQ;p zHgnc>pT@UX=wh1PmM*gMf34Xrjnl2!5Rbzd)@Af>D)RU`fAXNT{#>b6KPLUj!ynsc V5LU?uz03dr002ovPDHLkV1fvkY-|7k literal 0 HcmV?d00001 diff --git a/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json index 21974b7..6c00c76 100644 --- a/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json +++ b/GIGA/Assets.xcassets/userCenter/bg_moreandmore_red.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "bg_moreandmore_red@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Assets.xcassets/userCenter/history_heart.imageset/Contents.json b/GIGA/Assets.xcassets/userCenter/history_heart.imageset/Contents.json new file mode 100644 index 0000000..c03708f --- /dev/null +++ b/GIGA/Assets.xcassets/userCenter/history_heart.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "history_heart@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/userCenter/history_heart.imageset/history_heart@2x.png b/GIGA/Assets.xcassets/userCenter/history_heart.imageset/history_heart@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6ee1c9f42a0f7bb185c080e8f77f7fc957b6401e GIT binary patch literal 680 zcmV;Z0$2TsP)Px%Vo5|nR7efQmd|TbK@i7xHd+Ebh=-m8!Qw#>iuf1wAbROluOcX^O;m!SsY;C& zYny-|`B9OA9;Fozo;}!`Cqcx6Ab2+*LJ*Wd*3YD`;hDUbyu26e!oHoIneTjOc9-2J zrl+}l{*Y<4a;Dv$#dMV3qJJ|YZ_MOmT}q`U^S`?t<^C z%Vv*2nnpe!h0*gl#TKq0Ul*6l9RvKCZbt}^#MPOJiQ^W+i~o^S6BZ8dyb_;Dl71|# zbF-F%ayS+^2}opGD|Sg@#Kiv6ia*5!CxLy{ll(GCgjiUSEo-Kxo&)|8D?l8O$WN}` z7dtmsHhYr2eovg>t1=EjIOeR>>#sVO2G`#Q_WD}5@0cti50q4+b#E)k*CD?-CW`(r z)-J=L4@swWiFJmd4EdcM(-^;6X|=lKkJx<{{YoByTkQF&Uzb2Gvb^_u@qxtZ#N%;; zm!#Ya7;(M?>2eSzlvtg;2mWyoaH!7OyDaa+Fu#Gs3S!x>vg}X70tD(sZgXB91=>92 zP-69?@*G3O!weoo3XrZ1cJh9GhB>L7$}dxS4RKJii|lEnLpdl&Up`cxLAf4CE>fn_ z$oIfV#F`0}>mSRr9`ZVsX4M|GjZCb8AwS1ZC4t}k?yhippGGCzbHBf49=RkH|Ecc) O0000Px(97#k$RCodHoxN_@lI5Eb~&LG9sh0P;iC z1FQrh0B%shbNp_uqHip}#lPb5Uvk8c`IXzpivv*r26Uy%U-@pa{s6y`JH&mKpTfZB z+_vV6RKAYy;$c5nc!u9>9^Da!pnzCNOo)vzF{4|y=0>1R{AY@MLORBM|JPjFK}HZ8 zi4n0P6Fa(N@zMz1ZN^Fs2yM@eH zA!9?in3~;g9fvSZTU9`8CB{f5FGz~<*|@J9Y+TIoniXhQ0Wmfq4dx1w*{BAJOi#uA zu)3g*SK3xUj3w4crVW?XRLSF%zVtidwq*S84n7$qYp52J%>FVt#jAR?X|3 zC?M7*#7)^7t*{b}l!H!cbWkgBjsmcEkYL=M!fIU4=l%42| z7$dLzZn;z09sCRhg1Jl}YG|PB`ZV!hE6|$)!Q8PxJiSi$R=+E<0uu#h4P}F9BL1fW z1rRk-U#9V?HY?Dl0>Rv&U-9)RyXz__Kx=vSiccWA(?dZXuk@h++!Z=KtkNY%k8d<* ziR|Gt@n0*@xdOr3USg03iS8KNx$3UqQ~`LK>li!BCG#UL8_za+!3uPsfEb&Q26J=a z$%uZ59y~RtjyJTW0GurzJf(`*$-_z8QrvOo6o9Xbhm)!lJ9>cqoP6HUmICk{TH6MM>ns>O z|C>);9JLbElevc&PR~>TM)dAj6a3ej%ssklpBcQokxKM=ix>EvT%JE~krQL+i!h+E zO&5LM;uHHk;T`hQpSP$4Vu;L-(Tty(FXtZa5B`KOmpj!5f8OD*0kGQ-{*-kFNP+B6 opp}Ig_PRdgq~Rsut$YIQACf8iwg+dN46+MTEv)ZOLUvSL~3NBz=B4WuRB>q7%qbVR^-&?^O zMo0WQ@0opkckce#e-&}tW;*TtrZKnPV|#0fXz=H-UEzi?$>hT8F-2&Cb2K%XZ7*gNE6Ai~ohNvobS&HsZ0Ao*`kH z^42i@z0NtN<9i)u+$dxa&SgK@!oG){SKgWLh;iU~Il`~@=@_~C|pXNDQ_kDY&! z+sC)RT`tdC^Yy=zsqeMUbussMyyWqH5fQ!Xhp9>6J*%BNJxXHr78RMD+c-;W`?9NU zQ*%PjwJF}-*llr5>iBJ!ok`cGZoU}l_I>^19U + +@interface UIImage (LogoQrCode) + ++(UIImage *)createQrImageWith:(UIImage *)logo logoSize:(CGSize )size qrText:(NSString *)text; + + +@end diff --git a/GIGA/Category/UIImage+LogoQrCode.m b/GIGA/Category/UIImage+LogoQrCode.m new file mode 100644 index 0000000..0d76733 --- /dev/null +++ b/GIGA/Category/UIImage+LogoQrCode.m @@ -0,0 +1,52 @@ +// +// UIImage+LogoQrCode.m +// GIGA +// +// Created by lianxiang on 2018/9/25. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "UIImage+LogoQrCode.h" + +@implementation UIImage (LogoQrCode) + ++(UIImage *)createQrImageWith:(UIImage *)logo logoSize:(CGSize )size qrText:(NSString *)text +{ + + //NSArray *filter = [CIFilter filterNamesInCategory:kCICategoryBuiltIn]; + + // 二维码过滤器 + CIFilter *filterImage = [CIFilter filterWithName:@"CIQRCodeGenerator"]; + // 将二位码过滤器设置为默认属性 + [filterImage setDefaults]; + // 将文字转化为二进制 + NSData *dataImage = [text dataUsingEncoding:NSUTF8StringEncoding]; + // 打印输入的属性 + NSLog(@"%@", filterImage.inputKeys); + // KVC 赋值 + [filterImage setValue:dataImage forKey:@"inputMessage"]; + // 取出输出图片 + CIImage *outputImage = [filterImage outputImage]; + outputImage = [outputImage imageByApplyingTransform:CGAffineTransformMakeScale(20, 20)]; + // 转化图片 + UIImage *image = [UIImage imageWithCIImage:outputImage]; + + // 为二维码加自定义图片 + + // 开启绘图, 获取图片 上下文<图片大小> + UIGraphicsBeginImageContext(image.size); + // 将二维码图片画上去 + [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; + // 将小图片画上去 + UIImage *smallImage = logo; + [smallImage drawInRect:CGRectMake((image.size.width - 100) / 2, (image.size.width - 100) / 2, 100, 100)]; + // 获取最终的图片 + UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext(); + // 关闭上下文 + UIGraphicsEndImageContext(); + return finalImage; + + +} + +@end diff --git a/GIGA/Category/UIImage+ShotImage.h b/GIGA/Category/UIImage+ShotImage.h new file mode 100644 index 0000000..01e0635 --- /dev/null +++ b/GIGA/Category/UIImage+ShotImage.h @@ -0,0 +1,15 @@ +// +// UIImage+ShotImage.h +// GIGA +// +// Created by lianxiang on 2018/9/25. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface UIImage (ShotImage) +//截图tableviewi ++(UIImage *)saveLongImage:(UITableView *)table; + +@end diff --git a/GIGA/Category/UIImage+ShotImage.m b/GIGA/Category/UIImage+ShotImage.m new file mode 100644 index 0000000..a78ace9 --- /dev/null +++ b/GIGA/Category/UIImage+ShotImage.m @@ -0,0 +1,39 @@ +// +// UIImage+ShotImage.m +// GIGA +// +// Created by lianxiang on 2018/9/25. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "UIImage+ShotImage.h" + +@implementation UIImage (ShotImage) + ++(UIImage *)saveLongImage:(UITableView *)table { + + UIImage* image = nil; + // 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了,调整清晰度。 + + UIGraphicsBeginImageContextWithOptions(table.contentSize, YES, [UIScreen mainScreen].scale); + + CGPoint savedContentOffset = table.contentOffset; + CGRect savedFrame = table.frame; + table.contentOffset = CGPointZero; + table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height); + + [table.layer renderInContext: UIGraphicsGetCurrentContext()]; + + image = UIGraphicsGetImageFromCurrentImageContext(); + + table.contentOffset = savedContentOffset; + + table.frame = savedFrame; + + UIGraphicsEndImageContext(); + + return image; + +} + +@end diff --git a/GIGA/Common/GiGaHelper.h b/GIGA/Common/GiGaHelper.h index 50ab310..1cc80f8 100644 --- a/GIGA/Common/GiGaHelper.h +++ b/GIGA/Common/GiGaHelper.h @@ -68,4 +68,6 @@ // +(int)convertToInt:(NSString*)strtemp; ++(NSString*)dictionaryToJson:(NSDictionary *)dic; + @end diff --git a/GIGA/Common/GiGaHelper.m b/GIGA/Common/GiGaHelper.m index dfce4ca..3c48fae 100644 --- a/GIGA/Common/GiGaHelper.m +++ b/GIGA/Common/GiGaHelper.m @@ -281,4 +281,17 @@ } return strlength; } + ++(NSString*)dictionaryToJson:(NSDictionary *)dic + +{ + + NSError *parseError =nil; + + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError]; + + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + +} + @end diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.h b/GIGA/Common/GiGaNetTool/GiGaNetManager.h index acb4a11..e7c159e 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.h +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.h @@ -19,7 +19,7 @@ typedef void (^responseBlock)(NSDictionary *responseDict, NSDictionary *response success:(void (^)(id response))success failure:(void (^)(NSError *err))failure; -// 测试题 , 登录 body 传参 +// 测试题 ,登录 .. body 传参 +(void)userbodyRequest:(NSString *)url params:(NSDictionary *)param completionHandler:(nullable void (^)(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error))completionHandler; //上传图片 1张 diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.m b/GIGA/Common/GiGaNetTool/GiGaNetManager.m index ac555f8..7bcfa61 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.m +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.m @@ -102,34 +102,61 @@ }]; } -//登录body传参数 +//body传参数 +(void)userbodyRequest:(NSString *)url params:(NSDictionary *)param completionHandler:(nullable void (^)(NSURLResponse *response,NSDictionary *resDic, NSError * _Nullable error))completionHandler { + //NSString *jsonStr = [GiGaHelper dictionaryToJson:param]; NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURL *baseUrl = [NSURL URLWithString:[GiGaServerConfig getMainUrl]]; AFHTTPSessionManager*manager=[[AFHTTPSessionManager alloc] initWithBaseURL:baseUrl sessionConfiguration:configuration]; + manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + manager.requestSerializer = [AFHTTPRequestSerializer serializer]; + manager.responseSerializer = [AFHTTPResponseSerializer serializer]; + + [manager.responseSerializer setAcceptableContentTypes:[NSSet setWithObjects:@"application/json",@"text/json", @"text/javascript",@"text/html",@"text/plain",nil]]; + + NSString *token = [GiGaUserDefault getCurentToken]; + + NSMutableURLRequest *requst = [[AFJSONRequestSerializer serializer] + requestWithMethod:@"POST" URLString:url parameters:nil error:nil]; + + requst.timeoutInterval = 20.f; + + if (token) { + [manager.requestSerializer setValue:token forHTTPHeaderField:@"token"]; + [requst setValue:token forHTTPHeaderField:@"token"]; + } - NSMutableURLRequest *requst = [[AFJSONRequestSerializer serializer] - requestWithMethod:@"POST" URLString:url parameters:param error:nil]; - requst.timeoutInterval = 10.f; [requst setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [requst setValue:@"application/json" forHTTPHeaderField:@"Accept"]; + + + if (param && param.count > 0){ + + NSError *parseError =nil; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:param options:NSJSONWritingPrettyPrinted error:&parseError]; +// NSData *jsonData = [jsonStr dataUsingEncoding:NSUTF8StringEncoding]; + [requst setHTTPBody:jsonData]; + } + NSURLSessionDataTask *task = [manager dataTaskWithRequest:requst uploadProgress:^(NSProgress * _Nonnull uploadProgress) { } downloadProgress:^(NSProgress * _Nonnull downloadProgress) { } completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - if (completionHandler) { - completionHandler(response,responseObject,error); - } + NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; + if (completionHandler) { + completionHandler(response,responseDic,error); + } }]; [task resume]; } + //上传1张 +(void)uploadImage:(NSString *)url imgData:(NSData *)imgData diff --git a/GIGA/Common/GiGaNetTool/WeiIXinApiManager.h b/GIGA/Common/GiGaNetTool/WeiIXinApiManager.h index d12d6f4..028a748 100644 --- a/GIGA/Common/GiGaNetTool/WeiIXinApiManager.h +++ b/GIGA/Common/GiGaNetTool/WeiIXinApiManager.h @@ -32,4 +32,6 @@ success:(void (^)(id response))success failure:(void (^)(NSError *err))failure; +//+(void)shareMessageToWX:() + @end diff --git a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h index f61e420..7663a2e 100644 --- a/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h +++ b/GIGA/Common/GiGaUserDB/GIGaUserFileHelper.h @@ -24,4 +24,5 @@ +(UIImage *)getUserFeedbackImag:(NSString *)imageName; +(void)delectAllfeedimages; + @end diff --git a/GIGA/Common/GiGaUserDB/GiGaUserManager.h b/GIGA/Common/GiGaUserDB/GiGaUserManager.h index 29f4e45..e2dec9c 100644 --- a/GIGA/Common/GiGaUserDB/GiGaUserManager.h +++ b/GIGA/Common/GiGaUserDB/GiGaUserManager.h @@ -8,6 +8,7 @@ #import #import "GiGaUser.h" +#import "MaskTestResult.h" typedef void (^userDataresponseBlock)(GiGaUser *user); @@ -16,6 +17,7 @@ typedef void (^userErrorMsgBlock)(NSDictionary *errorCodemsg); @interface GiGaUserManager : NSObject @property(nonatomic,strong) GiGaUser *user; +@property(nonatomic,strong) MaskTestResult *testReult; +(instancetype)shareUser; - (void)saveUser:(GiGaUser *)user; @@ -29,4 +31,8 @@ typedef void (^userErrorMsgBlock)(NSDictionary *errorCodemsg); -(void)synsisUserInfo:(userDataresponseBlock)block userErrorMsgBlock:(userErrorMsgBlock)errorCodeMsg; +//保存肤质测试记录 +//-(void)saveLatestUserTestRecord:(MaskTestResult *)maskTestResult; +//-(MaskTestResult *)latestMaskTestResult; + @end diff --git a/GIGA/Common/GiGaUserDB/GiGaUserManager.m b/GIGA/Common/GiGaUserDB/GiGaUserManager.m index 325a20e..dc8f8db 100644 --- a/GIGA/Common/GiGaUserDB/GiGaUserManager.m +++ b/GIGA/Common/GiGaUserDB/GiGaUserManager.m @@ -20,6 +20,7 @@ const static NSInteger GIGADB_USER_VER = 0;//当前数据库版本号 @property (nonatomic,strong) NSMutableArray *userArr; @property (nonatomic,copy) NSString *userTabId; + @end @implementation GiGaUserManager @@ -140,4 +141,12 @@ const static NSInteger GIGADB_USER_VER = 0;//当前数据库版本号 } +//保留 +#pragma mark 最新一次测试记录 +-(void)saveLatestUserTestRecord:(MaskTestResult *)maskTestResult{ + [_store createTableWithName:@"gigaLastestSkinTest"]; + +} + + @end diff --git a/GIGA/Config/ApiRequestConfig.h b/GIGA/Config/ApiRequestConfig.h index 8c26d80..85d1203 100644 --- a/GIGA/Config/ApiRequestConfig.h +++ b/GIGA/Config/ApiRequestConfig.h @@ -17,8 +17,10 @@ #define kApiOccuption @"sys/sysdict/v1/maskoccupation" //修改用户信息 #define kFixUserInfo @"user/v1/editinfo" -//头像上传 上传多张反馈 -#define kUploadAvator @"sys/oss/v1/upload" + +//头像上传 +#define kUploadAvator @"user/v1/editheadimg" +//意见反馈 单张 #define kUploadFeed @"sys/oss/v1/upload" //版本说明 @@ -34,12 +36,20 @@ //找回密码发送验证码 #define kApiChangePassSendCode @"msg/sms/v1/retrievesendcode" //异步验证手机验证码 -#define kApiVersifyPhoneCode @"v1/user/v1/validateSmsCode" +#define kApiVersifyPhoneCode @"user/v1/validateSmsCode" + //获取意见反馈类型 (设置意见反馈) #define kApiGetFeedList @"sys/sysdict/v1/maskproposaltype" //意见建议 #define kAPiUpLoadFeeeds @"sys/proposal/v1/save" +//使用记录 +#define kApiUserHistoryList @"activity/maskuselog/v1/list" +//测试结果获取 +#define kAiSkinTestResult @"activity/maskquestion/v1/result" +//获取最后一次测试结果 +#define kApiGetLatestTest @"activity/maskquestionresultlog/v1/finalresult" - +//获取测试题列表 +#define kApiSkinTestQuestionList @"activity/maskquestion/v1/list" #endif /* ApiRequestConfig_h */ diff --git a/GIGA/GIGA.pch b/GIGA/GIGA.pch index 0e28d5b..506a86f 100644 --- a/GIGA/GIGA.pch +++ b/GIGA/GIGA.pch @@ -16,6 +16,7 @@ #import #import #import +#import "WXApiObject.h" #endif #import "GiGaUserDefault.h" diff --git a/GIGA/Modules/LogIn/Controller/GiGaWebViewController.xib b/GIGA/Modules/LogIn/Controller/GiGaWebViewController.xib index 0fad55b..d539c13 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaWebViewController.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaWebViewController.xib @@ -21,14 +21,14 @@ - + - + diff --git a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m index a4a97be..cc3120a 100644 --- a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m @@ -61,12 +61,15 @@ -(void)mycuntomSwitchAction:(id)sender{ + + LXCustomSwith *nkswitch = (LXCustomSwith *)sender; if (nkswitch.isOn) NSLog(@"switchPressed ON"); else [[LXDanMuManager shareInstance] destory]; [self destorySocket]; + NC_POST_NAME_OBJECT(@"UserCloseChatRoomAction", nil); [self dismissViewControllerAnimated:YES completion:nil]; NSLog(@"switchPressed OFF"); } @@ -74,6 +77,7 @@ -(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]; } diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index 0fe7044..b62d114 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -51,12 +51,32 @@ @property(nonatomic,strong) UIImageView *swipeGaurdimagView; @property(nonatomic,strong) UIButton *startMaskButton; @property(nonatomic,strong) UIButton *startTestButton; +//开启弹幕按钮 +@property(nonatomic,strong) UIButton *openDanmuButton; + @end @implementation GiGaMaskTaskViewController #pragma mark - property +- (UIButton *)openDanmuButton{ + if (!_openDanmuButton) { + _openDanmuButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_openDanmuButton addTarget:self action:@selector(openDanmuButtonAction) forControlEvents:UIControlEventTouchUpInside]; + _openDanmuButton.backgroundColor = GIGARGB(112, 0, 0, 1); + _openDanmuButton.frame = CGRectMake(KMainW - 25 -50,SAFE_NAV_HEIGHT + 15, 50, 20); + _openDanmuButton.layer.masksToBounds = YES; + _openDanmuButton.layer.cornerRadius = 10; + NSAttributedString *att = [GiGaHelper stringWithText:@"弹幕" textColor:[UIColor whiteColor] textFont:GIGA_TEXTFONTMEDIUM(10) leterSpace:0]; + [_openDanmuButton setAttributedTitle:att forState:UIControlStateNormal]; + [_openDanmuButton setImage:[UIImage imageNamed:@"btn_talk"] forState:UIControlStateNormal]; + //_openDanmuButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0); + _openDanmuButton.titleEdgeInsets = UIEdgeInsetsMake(0, -25, 0, 25); + + } + return _openDanmuButton; +} //面膜 - (UIImageView *)maskImageView{ if (!_maskImageView) { @@ -174,7 +194,7 @@ [super viewWillAppear:animated]; //取消导航对内容下移影响 [self.navigationController.navigationBar setTranslucent:YES]; - + self.openDanmuButton.hidden = NO; } @@ -184,11 +204,19 @@ self.navigationController.interactivePopGestureRecognizer.enabled = NO; } - BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd]; - if (showAppGaurd == NO) { - [self showAPPappGaurdView]; + // 暂不用 app引导页 + +// BOOL showAppGaurd = [GiGaUserDefault isShowedAppGaurd]; +// if (showAppGaurd == NO) { +// [self showAPPappGaurdView]; +// } + //新手蒙版 + BOOL isshowGaurd = [GiGaUserDefault isShowedGaurd]; + if (isshowGaurd == NO) { + NSLog(@"%d",(int)isshowGaurd ); + [self showUserGaurdView]; } - //[self showUserGaurdView]; + } -(void)viewWillDisappear:(BOOL)animated{ @@ -318,7 +346,7 @@ -(void)initUI{ self.view.backgroundColor = GIGA_MAIN_BGCOLOR; - + [self.view addSubview:self.openDanmuButton]; [self.view addSubview:self.faceView]; [self.view addSubview:self.maskImageView]; [self.view addSubview:self.hairImageView]; @@ -479,6 +507,7 @@ -(void)maskTimeEnd{ NC_POST_NAME_OBJECT(kUserNoti_MASKEND, nil); + //面膜时间结束时设置 全局变量 不再发送本地通知 提醒 AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; delegate.isMasking = NO; @@ -502,8 +531,7 @@ // resultVC.model = model; // [self.navigationController pushViewController:resultVC animated:YES]; - //[self showAlertGoShareMaskTime]; - + // [self showAlertGoShareMaskTime]; GiGaQuestionVC *questionVC = [[GiGaQuestionVC alloc] init]; [self.navigationController pushViewController:questionVC animated:YES]; @@ -511,13 +539,19 @@ } -(void)addNotify{ - + //引导页 NC_ADD_TARGET_NAME_OBJECT(self, @selector(guardViewDissmiss), USER_GUARD_DISSMISS, nil) ; + NC_ADD_TARGET_NAME_OBJECT(self, @selector(appGauardViewDissmiss),APP_GUARD_DISSMISS, nil) ; NC_ADD_TARGET_NAME_OBJECT(self, @selector(pushToAppAdDetailView),APP_PUSHTO_DETAILVIEW, nil) ; NC_ADD_TARGET_NAME_OBJECT(self, @selector(userLoginNotify), kUserLoginSuccessNoti, nil); NC_ADD_TARGET_NAME_OBJECT(self, @selector(userlogOutNotify), kUserLogOutNotify, nil); NC_ADD_TARGET_NAME_OBJECT(self, @selector(userAvatorUpDate), kUserAvatorUpdateNoti, nil) ; + + //用户关闭弹幕聊天 + NC_ADD_TARGET_NAME_OBJECT(self, @selector(userCloseChatRoomAction), @"UserCloseChatRoomAction", nil); + + } #pragma mark 广告详情 @@ -527,9 +561,11 @@ [self.navigationController pushViewController:detailVC animated:YES]; } -#pragma mark 新手引导消失 +#pragma mark 新手引导蒙版消失 -(void)guardViewDissmiss{ + [self showWaringView]; + } #pragma mark app引导页消失 @@ -549,6 +585,8 @@ NC_REMOVE_NAME(self, kUserAvatorUpdateNoti, nil); NC_REMOVE_NAME(self, kUserLogOutNotify, nil); NC_REMOVE_NAME(self, kUserLoginSuccessNoti, nil); + NC_REMOVE_NAME(self, @"UserCloseChatRoomAction", nil); + } #pragma mark 新手引导 @@ -623,16 +661,20 @@ -(void)leftBtnAction{ BOOL isUserLogin = [GiGaUserDefault isUserLogin]; + if (isUserLogin) { GiGaMasssagesVC *masageVC= [[GiGaMasssagesVC alloc] init]; [self.navigationController pushViewController:masageVC animated:YES]; }else{ + GiGaUserLoginVC *userlogInVC= [[GiGaUserLoginVC alloc] init]; GiGaBaseNavViewController *baseNav = [[GiGaBaseNavViewController alloc] initWithRootViewController:userlogInVC]; [self presentViewController:baseNav animated:YES completion:nil]; + } + } #pragma mark 个人中心 action @@ -718,5 +760,14 @@ }]; } +#pragma mark - 开启弹幕按钮事件 +-(void)openDanmuButtonAction{ + self.openDanmuButton.hidden = YES; + [self createInputView]; +} +//通知用户挂断弹幕 +-(void)userCloseChatRoomAction{ + self.openDanmuButton.hidden = NO; +} @end diff --git a/GIGA/Modules/Mask/Controller/ShareViewController.m b/GIGA/Modules/Mask/Controller/ShareViewController.m index dd0dda7..9f32c91 100644 --- a/GIGA/Modules/Mask/Controller/ShareViewController.m +++ b/GIGA/Modules/Mask/Controller/ShareViewController.m @@ -13,6 +13,12 @@ #import "MaskTimeShareActionSheet.h" #import "GIGaUserFileHelper.h" #import +#import "GiGaFileNanager.h" +//#import "WXApiObject.h" +#import +#import +#import "UIImage+ShotImage.h" + @interface ShareViewController () @property(nonatomic,strong) UITableView *tab; @property(nonatomic,strong) UIImageView *backimageview ; @@ -27,35 +33,41 @@ [super viewDidLoad]; _curentImageIndex = 0; - UIImageView *backimageview = [[UIImageView alloc] init]; - backimageview.contentMode = UIViewContentModeScaleAspectFill; - backimageview.frame = CGRectMake(0, 0,self.view.frame.size.width, self.view.frame.size.height); - backimageview.userInteractionEnabled = YES; - backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME]; - -// self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]]; - self.backimageview = backimageview; - [self.view addSubview:backimageview]; [self creatTabUI]; + + UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; backBtn.frame = CGRectMake(20,44, 40, 40); [backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal]; [backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:backBtn]; - [self.view insertSubview:backimageview atIndex:0]; + [self creatBtns]; } -(void)creatTabUI{ + self.automaticallyAdjustsScrollViewInsets = NO; self.tab = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; self.tab.separatorStyle = UITableViewCellSelectionStyleNone; self.tab.delegate = self; self.tab.dataSource = self; self.tab.backgroundColor = [UIColor clearColor]; [self.view addSubview:self.tab]; + + UIImageView *backimageview = [[UIImageView alloc] init]; + backimageview.contentMode = UIViewContentModeScaleAspectFill; + backimageview.frame = CGRectMake(0,0,self.view.frame.size.width, self.view.frame.size.height); + backimageview.userInteractionEnabled = YES; + backimageview.image = [GIGaUserFileHelper getUserShareImage:kUSERSHAREA_IMAGENAME]; + + // self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sharebg_1"]]; + self.backimageview = backimageview; + + self.tab.backgroundView = backimageview; + } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ @@ -146,10 +158,9 @@ } +//更换背景 -(void)changeAction{ - - MaskTimeShareActionSheet * sheet = [[MaskTimeShareActionSheet alloc] initWithFrame:CGRectMake(0, 0, KMainW, KMainH)]; [sheet show:^(NSUInteger index) { switch (index) { @@ -186,6 +197,7 @@ [self.view addSubview:sheet]; } + #pragma mark 相册 -(void)photosAlbum{ UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; @@ -217,6 +229,7 @@ } +//拍照 -(void)takePhoto{ UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.allowsEditing = YES; @@ -263,9 +276,9 @@ UIImage*img=[info objectForKey:UIImagePickerControllerEditedImage]; UIImage *small = [GIGaUserFileHelper zipScaleWithImage:img]; [GIGaUserFileHelper savaShareImange:kUSERSHAREA_IMAGENAME image:small]; + [self.backimageview setImage:small]; + - ShareViewController *share = [[ShareViewController alloc] init]; - [self presentViewController:share animated:NO completion:nil]; } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ @@ -273,7 +286,48 @@ } -(void)shareBtnAction{ + if (![WXApi isWXAppInstalled]) { + GIGA_ShowToast(@"未安装微信"); + return; + } + + UIImage *image = [UIImage saveLongImage:self.tab]; + [self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + + alertMaker.addActionDefaultTitle(@"朋友"); + alertMaker.addActionDefaultTitle(@"朋友圈"); + alertMaker.addActionCancelTitle(@"取消"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex==0) { + //好友 + [self shareImagToWX:image scene:WXSceneSession]; + + }else if (buttonIndex==1){ + // 朋友圈 + [self shareImagToWX:image scene:WXSceneTimeline]; + } + }]; +} + +-(void)shareImagToWX:(UIImage *)image scene:(int)scene{ + WXMediaMessage *msg = [WXMediaMessage message]; + UIImage * masllThumb = [GIGaUserFileHelper scaleFromImage:image toSize:CGSizeMake(100, 100)]; + msg.title = @"面膜时间"; + msg.description= @"极迦面膜"; + [msg setThumbImage:masllThumb]; + WXImageObject *imageObject = [WXImageObject object]; + NSData *imageData = UIImagePNGRepresentation(image); + imageObject.imageData = imageData; + msg.mediaObject = imageObject; + + SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init]; + req.message = msg; + req.scene = scene; + req.bText = NO; + + [WXApi sendReq:req]; } @end diff --git a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m index 2e9a6ab..b9b22e3 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m @@ -248,7 +248,7 @@ -(void)loadRequestQuestions{ NSDictionary *params = @{}; - GiGaBaseAPiRequest *request = [GiGaBaseAPiRequest initWithRequestPath:@"activity/maskquestion/v1/list" method:RequestPostMethod parms:params]; + GiGaBaseAPiRequest *request = [GiGaBaseAPiRequest initWithRequestPath:kApiSkinTestQuestionList method:RequestPostMethod parms:params]; [self.view makeToastActivity:CSToastPositionCenter]; [request requstDataWithResult:^(GiGaAPIResult *result) { @@ -359,42 +359,15 @@ -(void)submitAnswer{ - NSDictionary *params = @{@"singleChoiceList":self.answerArray}; - [self.view makeToastActivity:CSToastPositionCenter]; - NSString *url = [NSString stringWithFormat:@"%@activity/maskquestion/v1/result",[GiGaServerConfig getMainUrl]]; - - [GiGaNetManager userbodyRequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) { - [self.view hideToastActivity]; - GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic]; - if (result.success) { - MaskTestResult* mode = [[MaskTestResult alloc] initWithDictionary:resDic error:nil]; - [self userTestEnd:mode]; - }else{ - GIGA_ShowToast(result.message); - } - GILog(@"**测试结果***\n code:%ld\n message:%@\n *******\n dic:%@",result.code,result.message,result.dic); - - - }]; + [self userTestEnd]; } --(void)userTestEnd:(MaskTestResult*)model{ +-(void)userTestEnd{ BOOL isUserLogin = [GiGaUserDefault isUserLogin]; if (isUserLogin) { - //展示结果 -// NSDictionary *dic = @{ -// @"dryness":@"0.41", -// @"drynessPercent":@"41%", -// @"mask":@"", -// @"minute":@"19", -// @"oiliness":@"0.59", -// @"oilinessPercent":@"59%" -// }; -// MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil]; - MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init]; - resultVC.model = model; - [self.navigationController pushViewController:resultVC animated:YES]; + + [self getTestResult]; }else{ [self jxt_showAlertWithTitle:@"对不起您还没有登录" message:@"请登录后查看肤质测试结果" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { @@ -416,6 +389,46 @@ } +//获取结果 +-(void)getTestResult{ + + NSDictionary *params = @{@"singleChoiceList":self.answerArray}; + [self.view makeToastActivity:CSToastPositionCenter]; + NSString *url = [NSString stringWithFormat:@"%@%@",[GiGaServerConfig getMainUrl],kAiSkinTestResult]; + [GiGaNetManager userbodyRequest:url params:params completionHandler:^(NSURLResponse *response, NSDictionary *resDic, NSError * _Nullable error) { + [self.view hideToastActivity]; + GiGaAPIResult *result = [[GiGaAPIResult alloc] initWithDictionary:resDic]; + if (result.success) { + + MaskTestResult* mode = [[MaskTestResult alloc] initWithDictionary:resDic error:nil]; + + NSUInteger minute = [mode.minute integerValue]; + NSTimeInterval time = minute * 60; + [GiGaUserDefault savaMaskeTime:time]; + + //展示结果 + // NSDictionary *dic = @{ + // @"dryness":@"0.41", + // @"drynessPercent":@"41%", + // @"mask":@"", + // @"minute":@"19", + // @"oiliness":@"0.59", + // @"oilinessPercent":@"59%" + // }; + // MaskTestResult *model =[[MaskTestResult alloc] initWithDictionary:dic error:nil]; + MaskTestResultVC *resultVC = [[MaskTestResultVC alloc] init]; + resultVC.model = mode; + [self.navigationController pushViewController:resultVC animated:YES]; + + }else{ + + GIGA_ShowToast(result.message); + } + + GILog(@"**测试结果***\n code:%ld\n message:%@\n *******\n dic:%@",result.code,result.message,result.dic); + }]; +} + -(void)preBtnAction{ _page -- ; diff --git a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.h b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.h index ee81ffd..385fbae 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.h +++ b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.h @@ -12,4 +12,5 @@ @interface MaskTestResultVC : GiGaBaseViewController @property (nonatomic,strong) MaskTestResult *model; + @end diff --git a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m index 5f544d1..315d7ce 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m @@ -10,9 +10,12 @@ #import "MaskResultMinViewCell.h" #import "MaskResultPercentCell.h" #import "MaskResultShareViewCell.h" - +#import "GIGaUserFileHelper.h" +#import "UIImage+ShotImage.h" +#import "GiGaBaseAPiRequest.h" #import "GiGaFileNanager.h" - +#import +#import "MaskTestResult.h" @interface MaskTestResultVC () @@ -22,9 +25,9 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self addNavTitile:@"测试结果"]; // Do any additional setup after loading the view. - [self.view addSubview:self.tableView]; self.tableView.delegate = self; self.tableView.dataSource = self; @@ -39,6 +42,32 @@ [self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"]; [self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"]; + if (!self.model) { + [self addNavTitile:@"历史测试"]; + [self requstLatestTestData]; + } + +} + +-(void)requstLatestTestData{ + + [self.view makeToastActivity:CSToastPositionCenter]; + GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiGetLatestTest method:RequestPostMethod parms:@{}]; + [api requstDataWithResult:^(GiGaAPIResult *result) { + [self.view hideToastActivity]; + if (result.success) { + NSDictionary *dic = result.dic; + NSDictionary *reult = dic[@"result"]; + MaskTestResult *resultMode = [[MaskTestResult alloc] initWithDictionary:reult error:nil]; + self.model = resultMode; + [self.tableView reloadData]; + + }else{ + + GIGA_ShowToast(result.message); + } + }]; + } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ @@ -76,7 +105,7 @@ cell = [[MaskResultShareViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellID];; } [cell.shareBtn addTarget:self action:@selector(shareBtnAciton) forControlEvents:UIControlEventTouchUpInside]; - [cell kidTitle:self.model.mask]; + [cell kidTitle:self.model]; return cell; } @@ -101,41 +130,53 @@ } -(void)shareBtnAciton{ - - UIImage *image = [self saveLongImage:self.tableView]; -// SHareTestImageVC *imagevc = [[SHareTestImageVC alloc] init]; -// imagevc.image = image; - //[self.navigationController pushViewController:imagevc animated:YES]; + + if (![WXApi isWXAppInstalled]) { + GIGA_ShowToast(@"未安装微信"); + return; + } + + UIImage *image = [UIImage saveLongImage:self.tableView]; + //[[GiGaFileNanager shareInstance] saveImaeToAlBum:image]; + [self jxt_showActionSheetWithTitle:@"分享微信" message:@"" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + + alertMaker.addActionDefaultTitle(@"朋友"); + alertMaker.addActionDefaultTitle(@"朋友圈"); + alertMaker.addActionCancelTitle(@"取消"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex==0) { + //好友 + [self shareImagToWX:image scene:WXSceneSession]; + + + }else if (buttonIndex==1){ + // 朋友圈 + [self shareImagToWX:image scene:WXSceneTimeline]; + } + }]; +} + +-(void)shareImagToWX:(UIImage *)image scene:(int)scene{ + WXMediaMessage *msg = [WXMediaMessage message]; + UIImage * masllThumb = [GIGaUserFileHelper scaleFromImage:image toSize:CGSizeMake(100, 100)]; + msg.title = @"面膜时间"; + msg.description= @"极迦面膜"; + [msg setThumbImage:masllThumb]; + + WXImageObject *imageObject = [WXImageObject object]; + NSData *imageData = UIImagePNGRepresentation(image); + imageObject.imageData = imageData; + msg.mediaObject = imageObject; + + SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init]; + req.message = msg; + req.scene = scene; + req.bText = NO; + [WXApi sendReq:req]; } -- (UIImage *)saveLongImage:(UITableView *)table { - - UIImage* image = nil; - // 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了,调整清晰度。 - - UIGraphicsBeginImageContextWithOptions(table.contentSize, YES, [UIScreen mainScreen].scale); - - CGPoint savedContentOffset = table.contentOffset; - CGRect savedFrame = table.frame; - table.contentOffset = CGPointZero; - table.frame = CGRectMake(0, 0, table.contentSize.width, table.contentSize.height); - - [table.layer renderInContext: UIGraphicsGetCurrentContext()]; - - image = UIGraphicsGetImageFromCurrentImageContext(); - - table.contentOffset = savedContentOffset; - - table.frame = savedFrame; - - UIGraphicsEndImageContext(); - [[GiGaFileNanager shareInstance] saveImaeToAlBum:image]; - - return image; - - -} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/GIGA/Modules/Mask/Exercises/Model/MaskTestResult.h b/GIGA/Modules/Mask/Exercises/Model/MaskTestResult.h index d44ac1c..1efd497 100644 --- a/GIGA/Modules/Mask/Exercises/Model/MaskTestResult.h +++ b/GIGA/Modules/Mask/Exercises/Model/MaskTestResult.h @@ -16,6 +16,11 @@ @property(nonatomic,copy) NSString *minute; @property(nonatomic,copy) NSString *oiliness; @property(nonatomic,copy) NSString *oilinessPercent; - +//保湿0无1有 +@property(nonatomic) int moisture; +//美白0无1有 +@property(nonatomic) int whitening; +//提拉紧致0无1有 +@property(nonatomic) int liftingTightening; @end diff --git a/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m b/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m index 934c526..b588e90 100644 --- a/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m +++ b/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m @@ -8,14 +8,19 @@ #import "GIGaQuestionSlider.h" #import "UIColor+HexColor.h" +#define thumbBound_x 10 +#define thumbBound_y 20 + @interface GIGaQuestionSlider() +{ + CGRect _lastBounds; +} + @end @implementation GIGaQuestionSlider - - - (instancetype)initWithFrame:(CGRect)frame type:(GIGaQuestionSliderType)type { self = [super initWithFrame:frame]; @@ -112,5 +117,53 @@ } +// 扩大thumb 触控区域 +- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value + +{ + rect.origin.x = rect.origin.x; + rect.size.width = rect.size.width ; + CGRect result = [super thumbRectForBounds:bounds trackRect:rect value:value]; + + _lastBounds = result; + return result; + +} + +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ + + UIView *result = [super hitTest:point withEvent:event]; + + if (point.x < 0 || point.x > self.bounds.size.width){ + + return result; + + } + + if ((point.y >= -thumbBound_y) && (point.y < _lastBounds.size.height + thumbBound_y)) { + float value = 0.0; + value = point.x - self.bounds.origin.x; + value = value/self.bounds.size.width; + + value = value < 0? 0 : value; + value = value > 1? 1: value; + + value = value * (self.maximumValue - self.minimumValue) + self.minimumValue; + [self setValue:value animated:YES]; + } + return result; + +} + +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{ + BOOL result = [super pointInside:point withEvent:event]; + if (!result && point.y > -10) { + if ((point.x >= _lastBounds.origin.x - thumbBound_x) && (point.x <= (_lastBounds.origin.x + _lastBounds.size.width + thumbBound_x)) && (point.y < (_lastBounds.size.height + thumbBound_y))) { + result = YES; + } + + } + return result; +} @end diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.h b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.h index 6ca235a..f9dc009 100644 --- a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.h +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.h @@ -9,6 +9,11 @@ #import @interface MaskResultCandView : UIView +@property(nonatomic,strong) UIImageView *shuiImageView; +@property(nonatomic,strong) UIImageView *meibaiImageView; +@property(nonatomic,strong) UIImageView *tilaImageView; @property(nonatomic,strong) NSArray *imagesArr; - (instancetype)initWith:(NSArray *)images; +-(void)updateImages:(NSArray *)images; + @end diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.m b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.m index 87f42d2..2b044c2 100644 --- a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.m +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultCandView.m @@ -24,7 +24,17 @@ -(void)creatSubs{ for (NSInteger i=0; i - +#import "MaskTestResult.h" +#import "MaskResultCandView.h" @interface MaskResultShareViewCell : UITableViewCell @property (nonatomic,strong) UIButton *shareBtn; --(void)kidTitle:(NSString *)title; +@property (nonatomic,strong) MaskResultCandView *imagsBackView; + +-(void)kidTitle:(MaskTestResult *)model; @property (nonatomic,strong) UILabel *candLabe; diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultShareViewCell.m b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultShareViewCell.m index c1f2862..a88dd84 100644 --- a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultShareViewCell.m +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskResultShareViewCell.m @@ -48,7 +48,9 @@ }]; //小图标 NSArray * imagesArr = @[@"result_water",@"result_moon",@"result_push"]; + MaskResultCandView *imagsBackView = [[MaskResultCandView alloc] initWith:imagesArr]; + self.imagsBackView = imagsBackView; [self addSubview:imagsBackView]; [imagsBackView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -114,11 +116,19 @@ } --(void)kidTitle:(NSString *)title{ - if (!title || [title isEqualToString:@""] || [title isKindOfClass:[NSNull class]]) { - title = @"全效型"; +-(void)kidTitle:(MaskTestResult *)model{ + if (!model.mask || [model.mask isEqualToString:@""] || [model.mask isKindOfClass:[NSNull class]]) { + model.mask = @"全效型"; } - self.candLabe.text = title; + self.candLabe.text = model.mask; + + NSString *water = model.moisture ==1 ? @"result_water":@"result_wmz"; + + NSString *meibai = model.whitening ==1 ? @"result_moon":@"result_ylwmz"; + + NSString *tila= model.liftingTightening ==1 ? @"result_push":@"result_wmzzz"; + + [self.imagsBackView updateImages:@[water,meibai,tila]]; } -(void)layoutSubviews{ diff --git a/GIGA/Modules/Mask/Exercises/View/NYSliderPopover/NYSliderPopover.m b/GIGA/Modules/Mask/Exercises/View/NYSliderPopover/NYSliderPopover.m index 004c421..fa86767 100755 --- a/GIGA/Modules/Mask/Exercises/View/NYSliderPopover/NYSliderPopover.m +++ b/GIGA/Modules/Mask/Exercises/View/NYSliderPopover/NYSliderPopover.m @@ -8,6 +8,14 @@ #import "NYSliderPopover.h" #import "NYPopover.h" +#define thumbBound_x 10 +#define thumbBound_y 20 + +@interface NYSliderPopover() +{ + CGRect _lastBounds; +} +@end @implementation NYSliderPopover @@ -183,4 +191,55 @@ } + +// 扩大thumb 触控区域 +- (CGRect)thumbRectForBounds:(CGRect)bounds trackRect:(CGRect)rect value:(float)value + +{ + rect.origin.x = rect.origin.x; + rect.size.width = rect.size.width ; + CGRect result = [super thumbRectForBounds:bounds trackRect:rect value:value]; + + _lastBounds = result; + return result; + +} + +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ + + UIView *result = [super hitTest:point withEvent:event]; + + if (point.x < 0 || point.x > self.bounds.size.width){ + + return result; + + } + + if ((point.y >= -thumbBound_y) && (point.y < _lastBounds.size.height + thumbBound_y)) { + float value = 0.0; + value = point.x - self.bounds.origin.x; + value = value/self.bounds.size.width; + + value = value < 0? 0 : value; + value = value > 1? 1: value; + + value = value * (self.maximumValue - self.minimumValue) + self.minimumValue; + [self setValue:value animated:YES]; + } + return result; + +} + +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{ + BOOL result = [super pointInside:point withEvent:event]; + if (!result && point.y > -10) { + if ((point.x >= _lastBounds.origin.x - thumbBound_x) && (point.x <= (_lastBounds.origin.x + _lastBounds.size.width + thumbBound_x)) && (point.y < (_lastBounds.size.height + thumbBound_y))) { + result = YES; + } + + } + return result; +} + + @end diff --git a/GIGA/Modules/Mask/View/GiGaFlyingCommitInputView.m b/GIGA/Modules/Mask/View/GiGaFlyingCommitInputView.m index 69bd4e7..928f798 100644 --- a/GIGA/Modules/Mask/View/GiGaFlyingCommitInputView.m +++ b/GIGA/Modules/Mask/View/GiGaFlyingCommitInputView.m @@ -103,7 +103,7 @@ static const CGFloat kInputViewH = 44.f; } if (self.inputTextField.text.length == 0) { - [[UIApplication sharedApplication].keyWindow makeToast:@"Comment content cannot be empty" duration:1 position:CSToastPositionCenter]; + [[UIApplication sharedApplication].keyWindow makeToast:@"弹幕不能为空" duration:1 position:CSToastPositionCenter]; return; } diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareBoootomViewCell.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareBoootomViewCell.m index e5a5337..4674715 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareBoootomViewCell.m +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareBoootomViewCell.m @@ -7,8 +7,8 @@ // #import "MaskShareBoootomViewCell.h" -#import "ZXingWrapper.h" - +//#import "ZXingWrapper.h" +#import "UIImage+LogoQrCode.h" @implementation MaskShareBoootomViewCell @@ -16,7 +16,9 @@ [super awakeFromNib]; // Initialization code self.backgroundColor = [UIColor clearColor]; - UIImage *imag = [ZXingWrapper createCodeWithString:@"app_logo" size:CGSizeMake(85, 85) CodeFomart:kBarcodeFormatQRCode]; +// UIImage *imag = [ZXingWrapper createCodeWithString:@"giga" size:CGSizeMake(170, 170) CodeFomart:kBarcodeFormatQRCode]; + + UIImage *imag = [UIImage createQrImageWith:[UIImage imageNamed:@"result_logo"] logoSize:CGSizeZero qrText:@"jijia"]; self.codeImageVIew.image = imag; } diff --git a/GIGA/Modules/Me/Controller/GIGaAboutUsVC.xib b/GIGA/Modules/Me/Controller/GIGaAboutUsVC.xib index 238905f..47f6636 100644 --- a/GIGA/Modules/Me/Controller/GIGaAboutUsVC.xib +++ b/GIGA/Modules/Me/Controller/GIGaAboutUsVC.xib @@ -39,7 +39,7 @@ - +