diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index ece2243..52e812e 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -38,6 +38,12 @@ 8342FD862150FD5200D141F4 /* VersionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD852150FD5200D141F4 /* VersionModel.m */; }; 8342FD8A2151095100D141F4 /* AppVersionLogoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8342FD882151095100D141F4 /* AppVersionLogoCell.m */; }; 8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8342FD892151095100D141F4 /* AppVersionLogoCell.xib */; }; + 834415EA215B4E6F00A6D906 /* HistoryNoDataViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 834415E8215B4E6F00A6D906 /* HistoryNoDataViewCell.m */; }; + 834415EB215B4E6F00A6D906 /* HistoryNoDataViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 834415E9215B4E6F00A6D906 /* HistoryNoDataViewCell.xib */; }; + 834415EF215B52EF00A6D906 /* MaskTestNODataViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 834415ED215B52EF00A6D906 /* MaskTestNODataViewCell.m */; }; + 834415F0215B52EF00A6D906 /* MaskTestNODataViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 834415EE215B52EF00A6D906 /* MaskTestNODataViewCell.xib */; }; + 834415F3215B5F8200A6D906 /* GiGaShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 834415F2215B5F8200A6D906 /* GiGaShareModel.m */; }; + 834415F6215B89A300A6D906 /* MaskTimeTopAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 834415F5215B89A300A6D906 /* MaskTimeTopAnimationView.m */; }; 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 */; }; @@ -306,6 +312,16 @@ 8342FD872151095100D141F4 /* AppVersionLogoCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppVersionLogoCell.h; sourceTree = ""; }; 8342FD882151095100D141F4 /* AppVersionLogoCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppVersionLogoCell.m; sourceTree = ""; }; 8342FD892151095100D141F4 /* AppVersionLogoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AppVersionLogoCell.xib; sourceTree = ""; }; + 834415E7215B4E6F00A6D906 /* HistoryNoDataViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HistoryNoDataViewCell.h; sourceTree = ""; }; + 834415E8215B4E6F00A6D906 /* HistoryNoDataViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HistoryNoDataViewCell.m; sourceTree = ""; }; + 834415E9215B4E6F00A6D906 /* HistoryNoDataViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HistoryNoDataViewCell.xib; sourceTree = ""; }; + 834415EC215B52EF00A6D906 /* MaskTestNODataViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTestNODataViewCell.h; sourceTree = ""; }; + 834415ED215B52EF00A6D906 /* MaskTestNODataViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTestNODataViewCell.m; sourceTree = ""; }; + 834415EE215B52EF00A6D906 /* MaskTestNODataViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MaskTestNODataViewCell.xib; sourceTree = ""; }; + 834415F1215B5F8200A6D906 /* GiGaShareModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaShareModel.h; sourceTree = ""; }; + 834415F2215B5F8200A6D906 /* GiGaShareModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaShareModel.m; sourceTree = ""; }; + 834415F4215B89A300A6D906 /* MaskTimeTopAnimationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskTimeTopAnimationView.h; sourceTree = ""; }; + 834415F5215B89A300A6D906 /* MaskTimeTopAnimationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskTimeTopAnimationView.m; 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 = ""; }; @@ -845,6 +861,8 @@ children = ( 8392900D2134FA0A0077D2E8 /* GiGaCommentModel.h */, 8392900E2134FA0A0077D2E8 /* GiGaCommentModel.m */, + 834415F1215B5F8200A6D906 /* GiGaShareModel.h */, + 834415F2215B5F8200A6D906 /* GiGaShareModel.m */, ); path = Model; sourceTree = ""; @@ -862,6 +880,8 @@ 83928FF92134D8F60077D2E8 /* GiGaFlyingCommitInputView.m */, 83BFAE79213D3F3A004EF801 /* MaskTimeCircularProgressView.h */, 83BFAE7A213D3F3A004EF801 /* MaskTimeCircularProgressView.m */, + 834415F4215B89A300A6D906 /* MaskTimeTopAnimationView.h */, + 834415F5215B89A300A6D906 /* MaskTimeTopAnimationView.m */, ); path = View; sourceTree = ""; @@ -1488,6 +1508,9 @@ 8384F0ED2153355A002C19F0 /* MaskResultShareViewCell.m */, 8384F0EF21538146002C19F0 /* MaskResultCandView.h */, 8384F0F021538146002C19F0 /* MaskResultCandView.m */, + 834415EC215B52EF00A6D906 /* MaskTestNODataViewCell.h */, + 834415ED215B52EF00A6D906 /* MaskTestNODataViewCell.m */, + 834415EE215B52EF00A6D906 /* MaskTestNODataViewCell.xib */, ); path = MaskResultViews; sourceTree = ""; @@ -1635,6 +1658,9 @@ 83C78A11215873170083DDD9 /* MaskHistoryListViewCell.h */, 83C78A12215873170083DDD9 /* MaskHistoryListViewCell.m */, 83C78A13215873170083DDD9 /* MaskHistoryListViewCell.xib */, + 834415E7215B4E6F00A6D906 /* HistoryNoDataViewCell.h */, + 834415E8215B4E6F00A6D906 /* HistoryNoDataViewCell.m */, + 834415E9215B4E6F00A6D906 /* HistoryNoDataViewCell.xib */, ); path = HistoryView; sourceTree = ""; @@ -1822,6 +1848,7 @@ 8376B8332154A39200AB79F8 /* MaskTimeEndActionViewCell.xib in Resources */, 838762D9214B9EF80039D241 /* GIGaUserIDViewCell.xib in Resources */, 838762E8214B9FA60039D241 /* GIGaUserCityViewCell.xib in Resources */, + 834415EB215B4E6F00A6D906 /* HistoryNoDataViewCell.xib in Resources */, 8342FD8B2151095100D141F4 /* AppVersionLogoCell.xib in Resources */, 8382DFEF21564A1F00BBA5A5 /* photopicker_back.png in Resources */, 83BFAE68213CCF10004EF801 /* GiGaMineUserViewCell.xib in Resources */, @@ -1842,6 +1869,7 @@ 8382DFF121564A1F00BBA5A5 /* photopicker_back@2x.png in Resources */, 8382DFB221562B0A00BBA5A5 /* GIGaFeedQQViewCell.xib in Resources */, 8338F6B12142182200B4780B /* MaskTime.png in Resources */, + 834415F0215B52EF00A6D906 /* MaskTestNODataViewCell.xib in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, 83C78A15215873170083DDD9 /* MaskHistoryListViewCell.xib in Resources */, ); @@ -1955,6 +1983,7 @@ 838500DC2137F3F7003514A3 /* GiGaAttributedLabel.m in Sources */, 83BFAE7B213D3F3A004EF801 /* MaskTimeCircularProgressView.m in Sources */, 8382DFF721564A1F00BBA5A5 /* SJPhotoPickerRaidoButton.m in Sources */, + 834415EF215B52EF00A6D906 /* MaskTestNODataViewCell.m in Sources */, 8382DFF321564A1F00BBA5A5 /* SJPreviewPhotoCell.m in Sources */, 8314D2112133ABE500B458BF /* WeiIXinApiManager.m in Sources */, 83BDC0582147B89900E74E0D /* GiGaAnswerViewCell.m in Sources */, @@ -1987,10 +2016,12 @@ 83346ACE212BD7830054D597 /* GiGaWebViewController.m in Sources */, 8357ADD82124027D000816F2 /* GiGaUserDefault.m in Sources */, 8382DFE821564A1F00BBA5A5 /* SJPhotoModel.m in Sources */, + 834415F3215B5F8200A6D906 /* GiGaShareModel.m in Sources */, 8382DFF521564A1F00BBA5A5 /* SJPhotoPickerNavBar.m in Sources */, 8384F0F121538146002C19F0 /* MaskResultCandView.m in Sources */, 83835BB6212E5174001480F2 /* GiGaServiceViewController.m in Sources */, 835147352152003700B25A88 /* GiGaFeedBackViewController.m in Sources */, + 834415F6215B89A300A6D906 /* MaskTimeTopAnimationView.m in Sources */, 8390116E214E20B2004CA790 /* LYSDateLogicViewController.m in Sources */, 8361B40721215E6F00238FEB /* GiGaHelper.m in Sources */, 835147382152147600B25A88 /* GiGaUserInfoVC.m in Sources */, @@ -2091,6 +2122,7 @@ 836EE5DA2136716100F0ABB2 /* NSTimer+Convenience.m in Sources */, 83A22712212A9EA900B3E75C /* UIView+Sizes.m in Sources */, 839290092134F4C40077D2E8 /* GiGaFlingCommitVC.m in Sources */, + 834415EA215B4E6F00A6D906 /* HistoryNoDataViewCell.m in Sources */, 83BFAE70213CDB29004EF801 /* GiMaskTimeHistoryVC.m in Sources */, 8382DFEA21564A1F00BBA5A5 /* SJPhotoAlbumsController.m in Sources */, 83A22718212ABDFF00B3E75C /* GiGaBlockButton.m in Sources */, diff --git a/GIGA/AppDelegate+ThirdParty.m b/GIGA/AppDelegate+ThirdParty.m index 0d34295..85d20ac 100644 --- a/GIGA/AppDelegate+ThirdParty.m +++ b/GIGA/AppDelegate+ThirdParty.m @@ -67,6 +67,7 @@ //WXApiDelegate - (void)onReq:(BaseReq *)req{ + } @@ -79,6 +80,10 @@ }else{ [[UIApplication sharedApplication].keyWindow makeToast:@"授权失败" duration:1.6 position:CSToastPositionCenter]; } + }else if ([resp isKindOfClass:[SendMessageToWXResp class]]){ + if (resp.errCode == 0) { + NC_POST_NAME_OBJECT(NC_UseShareSuccessNoti, nil); + } } } diff --git a/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json index 745e8c3..36613ec 100644 --- a/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json +++ b/GIGA/Assets.xcassets/maskTime/btn_talk.imageset/Contents.json @@ -1,9 +1,17 @@ { "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, { "idiom" : "universal", "filename" : "btn_talk@2x.png", "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/Contents.json new file mode 100644 index 0000000..6ca095d --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "share_oneblack@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/share_oneblack@2x.png b/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/share_oneblack@2x.png new file mode 100644 index 0000000..827a2f6 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/share_oneblack.imageset/share_oneblack@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/user_day.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/user_day.imageset/Contents.json new file mode 100644 index 0000000..6b90143 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/user_day.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "user_day@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/user_day.imageset/user_day@2x.png b/GIGA/Assets.xcassets/maskTime/user_day.imageset/user_day@2x.png new file mode 100644 index 0000000..71be052 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/user_day.imageset/user_day@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/user_time.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/user_time.imageset/Contents.json new file mode 100644 index 0000000..60cb0a4 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/user_time.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "user_time@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/user_time.imageset/user_time@2x.png b/GIGA/Assets.xcassets/maskTime/user_time.imageset/user_time@2x.png new file mode 100644 index 0000000..db1acfc Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/user_time.imageset/user_time@2x.png differ diff --git a/GIGA/Common/GiGaNetTool/GiGaNetManager.m b/GIGA/Common/GiGaNetTool/GiGaNetManager.m index 7bcfa61..67293b3 100644 --- a/GIGA/Common/GiGaNetTool/GiGaNetManager.m +++ b/GIGA/Common/GiGaNetTool/GiGaNetManager.m @@ -36,12 +36,12 @@ [manager GET:url parameters:params progress:^(NSProgress * _Nonnull downloadProgress) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - - NSLog(@"%@", responseObject); - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; - NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; - block(dict, headerFields, nil); - + if (responseObject) { + NSLog(@"%@", responseObject); + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; + NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; + block(dict, headerFields, nil); + } } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; @@ -57,12 +57,14 @@ [manager POST:url parameters:params progress:^(NSProgress * _Nonnull uploadProgress) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; - NSLog(@"%@", dict); - NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; - block(dict, headerFields, nil); + if (responseObject) { + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; + NSLog(@"%@", dict); + NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; + block(dict, headerFields, nil); + } + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; block(nil, headerFields, error); @@ -88,12 +90,14 @@ } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; - NSLog(@"%@", dict); - if (success) { - success(responseObject); + if (responseObject) { + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; + NSLog(@"%@", dict); + if (success) { + success(responseObject); + } } - + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@"%@",error); if (failure) { @@ -145,12 +149,18 @@ } downloadProgress:^(NSProgress * _Nonnull downloadProgress) { } completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - - NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; - - if (completionHandler) { - completionHandler(response,responseDic,error); + if (responseObject) { + NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; + + if (completionHandler) { + completionHandler(response,responseDic,error); + } + }else{ + if (completionHandler) { + completionHandler(nil,nil,error); + } } + }]; [task resume]; @@ -193,12 +203,13 @@ } progress:^(NSProgress * _Nonnull uploadProgress) { } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; - NSLog(@"%@", dict); - NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; - if (block) { - block(dict, headerFields, nil); + if (responseObject) { + NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; + NSLog(@"%@", dict); + NSDictionary *headerFields = [(NSHTTPURLResponse *)task.response allHeaderFields]; + if (block) { + block(dict, headerFields, nil); + } } } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { diff --git a/GIGA/Common/GiGaUserDB/GiGaUserDefault.m b/GIGA/Common/GiGaUserDB/GiGaUserDefault.m index 27d642f..7541ba5 100644 --- a/GIGA/Common/GiGaUserDB/GiGaUserDefault.m +++ b/GIGA/Common/GiGaUserDB/GiGaUserDefault.m @@ -131,7 +131,8 @@ NSString *const kMaskeTime= @"userMaskeTime"; NSTimeInterval time = [UD_STADARDUD doubleForKey:kMaskeTime]; if (time == 0) { - //time = 16 * 60; + //默认17 分钟 + time = 17 * 60; time = MASKTIME_DEFAULT; } return time; diff --git a/GIGA/Config/ApiRequestConfig.h b/GIGA/Config/ApiRequestConfig.h index 85d1203..a14ad53 100644 --- a/GIGA/Config/ApiRequestConfig.h +++ b/GIGA/Config/ApiRequestConfig.h @@ -51,5 +51,12 @@ //获取测试题列表 #define kApiSkinTestQuestionList @"activity/maskquestion/v1/list" +//开始敷面膜 +#define KApiBeginMaskTime @"activity/maskuselog/v1/begin" +//结束敷面膜 +#define kApiEndMaskTime @"activity/maskuselog/v1/end" +//每日分享 +#define kApiShareAction @"activity/maskuselog/v1/sharedata" + #endif /* ApiRequestConfig_h */ diff --git a/GIGA/Config/GIGA.h b/GIGA/Config/GIGA.h index be81d7b..f800de4 100644 --- a/GIGA/Config/GIGA.h +++ b/GIGA/Config/GIGA.h @@ -51,6 +51,10 @@ UD_SYNC #define kUserAvatorUpdateNoti @"userAvatorUpdate" //用户昵称修改 #define kUserNameUpDateNoti @"userNickNameUpdate" +//分享成功 +#define NC_UseShareSuccessNoti @"GIGaUsershareSuccess" + + //微信登陆授权成功 #define kWeiXinAuthrization_Success @"WXAuthSuccess" diff --git a/GIGA/GIGA.pch b/GIGA/GIGA.pch index 506a86f..473f552 100644 --- a/GIGA/GIGA.pch +++ b/GIGA/GIGA.pch @@ -12,6 +12,7 @@ // Include any system framework and library headers here that should be included in all compilation units. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. #ifdef __OBJC__ + #import "AFNetworking.h" #import #import @@ -19,6 +20,7 @@ #import "WXApiObject.h" #endif + #import "GiGaUserDefault.h" #import "GIGA.h" diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m index 707515e..acd0d34 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.m @@ -163,6 +163,7 @@ self.registBtn.layer.masksToBounds = YES; self.registBtn.layer.cornerRadius = self.registBtn.frame.size.height / 2; + self.registBtn.userInteractionEnabled = NO; } @@ -247,15 +248,15 @@ -(void)checkBtnAction:(UIButton *)btn{ btn.selected = !btn.selected; if (btn.selected) { - [btn setImage:[UIImage imageNamed:@"btn_turndown"] forState:UIControlStateSelected]; - - [self.registBtn setBackgroundColor:[UIColor lightGrayColor]]; - self.registBtn.userInteractionEnabled = NO; + [btn setImage:[UIImage imageNamed:@"btn_right"] forState:UIControlStateNormal]; + [self.registBtn setBackgroundColor:GIGARGB(181,14,14, 1)]; + self.registBtn.userInteractionEnabled = YES; }else{ - [btn setImage:[UIImage imageNamed:@"btn_right"] forState:UIControlStateNormal]; - [self.registBtn setBackgroundColor:GIGARGB(0, 222, 189, 1)]; - self.registBtn.userInteractionEnabled = YES; + [btn setImage:[UIImage imageNamed:@"btn_turndown"] forState:UIControlStateSelected]; + [self.registBtn setBackgroundColor:[UIColor lightGrayColor]]; + self.registBtn.userInteractionEnabled = NO; + } } diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib index 0dbd7a6..eedc6a5 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib @@ -91,7 +91,7 @@ @@ -171,7 +171,7 @@ - + diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index 5f895c8..0b22507 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -245,7 +245,9 @@ -(void)WeiXinLongIn:(NSNotification *)notification{ //检查网络 //[self testNetworkStatus]; + [self.view makeToastActivity:CSToastPositionCenter]; + NSDictionary *param = @{ @"appid":WXin_APPID, @"secret":WXin_APPSecret, diff --git a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.h b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.h index 9b1cde2..4f8f719 100644 --- a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.h +++ b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.h @@ -9,5 +9,6 @@ #import "GiGaBaseViewController.h" @interface GIGaMaskShareViewController : GiGaBaseViewController +@property(nonatomic,copy) NSString *maskTimeId; @end diff --git a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m index b63f479..2e136fd 100644 --- a/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m +++ b/GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m @@ -14,8 +14,11 @@ #import "MaskTimeShareActionSheet.h" #import "GIGaUserFileHelper.h" #import +#import "GiGaBaseAPiRequest.h" +#import "GiGaShareModel.h" +#import "UIImageView+WebCache.h" @interface GIGaMaskShareViewController () - +@property(nonatomic,strong) GiGaShareModel *model; @end @implementation GIGaMaskShareViewController @@ -33,7 +36,9 @@ self.tableView.estimatedSectionHeaderHeight = 0; //self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, 30)]; self.tableView.frame = CGRectMake(0,0,KMainW, self.view.frame.size.height); - // Do any additional setup after loading the view. + + [self requestshareInfo]; + } - (void)didReceiveMemoryWarning { @@ -56,13 +61,29 @@ cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeEndViewImgaeCell" owner:self options:nil] lastObject]; } + if (self.model) { + cell.minuteLab.text = [NSString stringWithFormat:@"%@min",self.model.minute]; + cell.timeLable.text = [NSString stringWithFormat:@"这是您敷面膜的第:%@张",self.model.monthMaskNum]; + } return cell; + }else if (indexPath.section == 1){ MaskTimeTimeViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTimeTimeViewCell"]; if (!cell) { cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeTimeViewCell" owner:self options:nil] lastObject]; } + if (self.model) { + cell.timeLabe.text = self.model.minute; + CGFloat percent = [self.model.exquisite floatValue]; + int perrr = percent * 100; + NSString *per = [NSString stringWithFormat:@"%d",perrr]; + cell.percentLabe.text = per; + cell.totalTime.text = self.model.totalMaskNum; + NSURL *url = [NSURL URLWithString:self.model.headImgUrl]; + [cell.useravator sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]]; + } + return cell; }else if (indexPath.section == 2){ @@ -86,7 +107,7 @@ return 205; } - return 90; + return 120; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ @@ -101,7 +122,7 @@ #pragma mark changeBackBtnAction -(void)changeBackBtnAction{ - MaskTimeShareActionSheet * sheet = [[MaskTimeShareActionSheet alloc] initWithFrame:CGRectMake(0, 0, KMainW, KMainH)]; + MaskTimeShareActionSheet * sheet = [MaskTimeShareActionSheet showAtView:self]; [sheet show:^(NSUInteger index) { switch (index) { case 0: @@ -114,6 +135,7 @@ //系统 [GIGaUserFileHelper delectShareImage:kUSERSHAREA_IMAGENAME]; ShareViewController *share = [[ShareViewController alloc] init]; + share.model = self.model; [self presentViewController:share animated:NO completion:nil]; } @@ -129,15 +151,15 @@ } }]; - - [self.view addSubview:sheet]; + } #pragma mark share -(void)shareBtnAction{ ShareViewController *share = [[ShareViewController alloc] init]; - [self presentViewController:share animated:NO completion:nil]; + share.model = self.model; + [self presentViewController:share animated:YES completion:nil]; } @@ -220,6 +242,7 @@ [GIGaUserFileHelper savaShareImange:kUSERSHAREA_IMAGENAME image:small]; ShareViewController *share = [[ShareViewController alloc] init]; + share.model = self.model; [self presentViewController:share animated:NO completion:nil]; } @@ -227,5 +250,23 @@ [picker dismissViewControllerAnimated:YES completion:nil]; } +-(void)requestshareInfo{ + + + if (self.maskTimeId == nil) { + return; + } + + GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiShareAction method:RequestPostMethod parms:@{@"id":self.maskTimeId}]; + [api requstDataWithResult:^(GiGaAPIResult *result){ + if (result.success) { + NSDictionary *dic = result.dic; + GiGaShareModel *model = [[GiGaShareModel alloc] initWithDictionary:dic error:nil]; + self.model = model; + [self.tableView reloadData]; + } + }]; +} + @end diff --git a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m index cc3120a..09f642a 100644 --- a/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m +++ b/GIGA/Modules/Mask/Controller/GiGaFlingCommitVC.m @@ -46,8 +46,11 @@ } return _danmuSwitch; + } + + - (GiGaFlyingCommitInputView *)commitInputView{ if (!_commitInputView) { @@ -139,10 +142,10 @@ _manager = manager; _client = manager.defaultSocket; [self.manager connect]; - weakify(self); + [self.client on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) { - GIGA_WIndowTost(@"客户端上线"); + //GIGA_WIndowTost(@"客户端上线"); NSLog(@"*************\n\niOS客户端上线\n\n*************"); }]; @@ -154,9 +157,11 @@ [self.client on:@"onTalk" callback:^(NSArray * _Nonnull data, SocketAckEmitter * _Nonnull ack) { - NSString *json =data[0]; - NSLog(@"callback json***:%@",json); - NSDictionary *dic = [GiGaHelper dictionaryWithJsonString:json]; + //NSString *json =data[0]; + //NSDictionary *dic = [GiGaHelper dictionaryWithJsonString:json]; + NSDictionary *dic = data[0]; + NSLog(@"callback json***:%@",dic); + if (dic == nil) { NSLog(@"解析失败"); @@ -176,15 +181,8 @@ [self.client on:@"error" callback:^(NSArray * _Nonnull event, SocketAckEmitter * _Nonnull ack) { - [GIGAMBHUDHelper messageAddto:self.view title:@"连接弹幕"]; -// 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]:@""); + [GIGAMBHUDHelper messageAddto:self.view title:@"连接弹幕中..."]; + GILog(@"请求超时"); }]; diff --git a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m index b62d114..3ec0273 100644 --- a/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m +++ b/GIGA/Modules/Mask/Controller/GiGaMaskTaskViewController.m @@ -33,9 +33,11 @@ #import "GiGaBaseAPiRequest.h" #import "MaskTestResultVC.h" #import "GIGaMaskShareViewController.h" +#import "MaskHistryRecord.h" +#import "MaskTimeTopAnimationView.h" -@interface GiGaMaskTaskViewController () +@interface GiGaMaskTaskViewController () { AVAudioPlayer *_musicPalyer; } @@ -53,13 +55,28 @@ @property(nonatomic,strong) UIButton *startTestButton; //开启弹幕按钮 @property(nonatomic,strong) UIButton *openDanmuButton; - +//记录当前面试时间 记录开id +@property(nonatomic,copy) NSString *currentMaskId; +@property(nonatomic,strong) MaskTimeTopAnimationView *animLabeview; @end @implementation GiGaMaskTaskViewController #pragma mark - property + +- (MaskTimeTopAnimationView *)animLabeview{ + if (!_animLabeview) { + _animLabeview = [[MaskTimeTopAnimationView alloc] initWithFrame:CGRectMake(0,20+ PhoneX_TopMargin,KMainW - 40 * 2, 44)]; + NSString *text = @"长时间的使用面膜可能会对您的皮肤造成伤害"; + [_animLabeview animationWithTexts:[NSArray arrayWithObjects:text,@"面膜时间",text, nil]]; + + //_animLabeview.backgroundColor = [UIColor blueColor]; + } + + return _animLabeview; +} + - (UIButton *)openDanmuButton{ if (!_openDanmuButton) { _openDanmuButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -177,7 +194,7 @@ #pragma mark 弹幕 -(void)createInputView{ - + self.openDanmuButton.hidden = YES; GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init]; if (ISIOS8) { GiGaFlingVC.modalPresentationStyle = UIModalPresentationOverCurrentContext; @@ -228,13 +245,13 @@ } - (void)viewDidLoad { + [super viewDidLoad]; - [self setUpNav]; [self initUI]; [self addNotify]; [self creatBackGroundMusic]; - + } #pragma mark - 响应事件 @@ -345,18 +362,18 @@ #pragma mark 布局 -(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]; - //[self.view bringSubviewToFront:self.maskImageView]; [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(124 + PhoneX_TopMargin); @@ -442,7 +459,8 @@ #pragma mark 开始面膜时间 -(void)startMaskTime{ - + //记录 + [self sendBengainMaskTime]; [self createInputView]; //出现弹幕 AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; if (delegate.isMasking) { @@ -450,17 +468,18 @@ } delegate.isMasking = YES; [_musicPalyer play]; - [self setBackGroundPlayingInfo];//锁屏音频信息 + //[self setBackGroundPlayingInfo];//锁屏音频信息 //总时间隔 s - NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime]; + //NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime]; + NSTimeInterval timeInterVal = 6; [self.cicleProgressView startWith:timeInterVal]; //底部弹窗 [self showWaringView]; //app 前台时收到本地通知showAlert 后台时通知提醒 - [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"本地推送" fireTimeInterval:timeInterVal alertAction:@"测试面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND]; +// [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"本地推送" fireTimeInterval:timeInterVal alertAction:@"测试面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND]; } @@ -506,8 +525,8 @@ #pragma mark 面膜时间结束 -(void)maskTimeEnd{ + [self sendEndMaskTime]; NC_POST_NAME_OBJECT(kUserNoti_MASKEND, nil); - //面膜时间结束时设置 全局变量 不再发送本地通知 提醒 AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate]; delegate.isMasking = NO; @@ -579,6 +598,7 @@ } -(void)dealloc{ + NC_REMOVE_NAME(self, USER_GUARD_DISSMISS, nil); NC_REMOVE_NAME(self, APP_GUARD_DISSMISS, nil); NC_REMOVE_NAME(self, APP_PUSHTO_DETAILVIEW, nil); @@ -586,7 +606,6 @@ NC_REMOVE_NAME(self, kUserLogOutNotify, nil); NC_REMOVE_NAME(self, kUserLoginSuccessNoti, nil); NC_REMOVE_NAME(self, @"UserCloseChatRoomAction", nil); - } #pragma mark 新手引导 @@ -612,12 +631,12 @@ #pragma mark - 导航按钮 -(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]; @@ -647,6 +666,8 @@ } } } + + self.navigationController.navigationBar.backgroundColor = [UIColor whiteColor]; } #pragma mark 用户头像更新 @@ -746,23 +767,30 @@ -(void)showAlertGoShareMaskTime{ - [self jxt_showAlertWithTitle:@"面膜时间" message:@"去分享我的面膜时间" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { - alertMaker.addActionCancelTitle(@"下次"); - alertMaker.addActionDefaultTitle(@"去分享"); - } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + if (self.currentMaskId == nil) { + return; + } + BOOL isUserLogin = [GiGaUserDefault isUserLogin]; + if (isUserLogin) { + //游客不分享 + [self jxt_showAlertWithTitle:@"面膜时间" message:@"去分享我的面膜时间" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) { + alertMaker.addActionCancelTitle(@"下次"); + alertMaker.addActionDefaultTitle(@"去分享"); + } actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) { + + if (buttonIndex == 1) { + + GIGaMaskShareViewController *shareVC = [[GIGaMaskShareViewController alloc] init]; + shareVC.maskTimeId = self.currentMaskId; + [self.navigationController pushViewController:shareVC animated:YES]; + } + }]; - if (buttonIndex == 1) { - - GIGaMaskShareViewController *shareVC = [[GIGaMaskShareViewController alloc] init]; - [self.navigationController pushViewController:shareVC animated:YES];; - - } - }]; + } } #pragma mark - 开启弹幕按钮事件 -(void)openDanmuButtonAction{ - self.openDanmuButton.hidden = YES; [self createInputView]; } //通知用户挂断弹幕 @@ -770,4 +798,43 @@ self.openDanmuButton.hidden = NO; } +#pragma mark 开始敷面膜 APi +-(void)sendBengainMaskTime{ + + BOOL isUserLogin = [GiGaUserDefault isUserLogin]; + if (isUserLogin) { + NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime]; + NSString *minute = [NSString stringWithFormat:@"%.f",timeInterVal /60]; + GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:KApiBeginMaskTime method:RequestPostMethod parms:@{@"minute":minute}]; + [api requstDataWithResult:^(GiGaAPIResult *result) { + if (result.success) { + NSDictionary *maskDic = result.dic[@"maskUseLog"]; + self.currentMaskId = maskDic[@"id"]; + } + }]; + } +} + +#pragma mark 结束敷面膜 APi +-(void)sendEndMaskTime{ + + BOOL isUserLogin = [GiGaUserDefault isUserLogin]; + if (isUserLogin) { + if (self.currentMaskId) { + GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kApiEndMaskTime method:RequestPostMethod parms:@{@"id":self.currentMaskId}]; + [api requstDataWithResult:^(GiGaAPIResult *result) { + if (result.success) { + GILog(@"%@",@"面膜时间APi结束"); + + } + }]; + } + } +} + +-(void)addNavTitile:(NSString *)title{ + self.navigationItem.titleView = self.animLabeview; + +} + @end diff --git a/GIGA/Modules/Mask/Controller/ShareViewController.h b/GIGA/Modules/Mask/Controller/ShareViewController.h index 55343fc..1048073 100644 --- a/GIGA/Modules/Mask/Controller/ShareViewController.h +++ b/GIGA/Modules/Mask/Controller/ShareViewController.h @@ -7,7 +7,9 @@ // #import "GiGaBaseViewController.h" +#import "GiGaShareModel.h" @interface ShareViewController : GiGaBaseViewController +@property(nonatomic,strong) GiGaShareModel *model; @end diff --git a/GIGA/Modules/Mask/Controller/ShareViewController.m b/GIGA/Modules/Mask/Controller/ShareViewController.m index 9f32c91..d86d5f8 100644 --- a/GIGA/Modules/Mask/Controller/ShareViewController.m +++ b/GIGA/Modules/Mask/Controller/ShareViewController.m @@ -18,6 +18,8 @@ #import #import #import "UIImage+ShotImage.h" +#import "GiGaBaseAPiRequest.h" +#import "UIImageView+WebCache.h" @interface ShareViewController () @property(nonatomic,strong) UITableView *tab; @@ -37,7 +39,7 @@ UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - backBtn.frame = CGRectMake(20,44, 40, 40); + backBtn.frame = CGRectMake(20,20 +PhoneX_TopMargin, 40, 40); [backBtn setImage:[UIImage imageNamed:@"btn_moment_back"] forState:UIControlStateNormal]; [backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside]; @@ -46,6 +48,12 @@ [self creatBtns]; + NC_ADD_TARGET_NAME_OBJECT(self, @selector(usershareSuccessNoti), NC_UseShareSuccessNoti, nil); + +} + +-(void)dealloc{ + NC_REMOVE_NAME(self, NC_UseShareSuccessNoti, nil); } -(void)creatTabUI{ @@ -84,12 +92,23 @@ cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTimeShareViewCell" owner:self options:nil] lastObject]; } + return cell; }else if (indexPath.row == 1){ MaskShareTimeMidViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareTimeMidViewCell"]; if (!cell) { cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareTimeMidViewCell" owner:self options:nil] lastObject]; + if (self.model) { + cell.timeLabe.text = self.model.minute; + CGFloat percent = [self.model.exquisite floatValue]; + int perrr = percent * 100; + NSString *per = [NSString stringWithFormat:@"%d",perrr]; + cell.percetLabe.text = per; + cell.totalLabe.text = self.model.totalMaskNum; + NSURL *url = [NSURL URLWithString:self.model.headImgUrl]; + [cell.userAvtoar sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"]]; + } } return cell; } @@ -161,7 +180,8 @@ //更换背景 -(void)changeAction{ - MaskTimeShareActionSheet * sheet = [[MaskTimeShareActionSheet alloc] initWithFrame:CGRectMake(0, 0, KMainW, KMainH)]; + MaskTimeShareActionSheet * sheet = [MaskTimeShareActionSheet showAtView:self]; + [sheet show:^(NSUInteger index) { switch (index) { case 0: @@ -176,10 +196,24 @@ if (self->_curentImageIndex == 4) { self->_curentImageIndex = 0; } - NSArray *images = @[@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5",@"sharebg_1"]; + NSArray *images = @[@"sharebg_1",@"sharebg_2",@"sharebg_3",@"sharebg_4",@"sharebg_5"]; [self.backimageview setImage:[UIImage imageNamed: images[self->_curentImageIndex]]]; + MaskTimeShareViewCell *cell = [self.tab cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; + + if (self.curentImageIndex==0) { + cell.shareLabe.image = [UIImage imageNamed:@"share_oneblack"]; + cell.doinglabel.textColor = [UIColor blackColor]; + } + + if (self.curentImageIndex == 1) { + cell.shareLabe.image = [UIImage imageNamed:@"share_one"]; + cell.doinglabel.textColor = GIGARGB(170, 170, 170, 1); + + } + + } break; case 2: @@ -193,9 +227,7 @@ } }]; - - [self.view addSubview:sheet]; - + } #pragma mark 相册 @@ -307,6 +339,7 @@ // 朋友圈 [self shareImagToWX:image scene:WXSceneTimeline]; } + }]; } @@ -330,4 +363,10 @@ [WXApi sendReq:req]; } +//分享成功 +-(void)usershareSuccessNoti{ + +} + + @end diff --git a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m index b9b22e3..9a69ce0 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/GiGaQuestionVC.m @@ -74,10 +74,11 @@ CGFloat navH = SAFE_NAV_HEIGHT; UIButton *numberBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [numberBtn setBackgroundImage:[UIImage imageNamed:@"ceshi_number"] forState:UIControlStateNormal]; - NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:@"1" attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; - - [numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal]; + [numberBtn setBackgroundImage:[UIImage imageNamed:@"result_logo"] forState:UIControlStateNormal]; +// NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:@"1" attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; +// +// +// [numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal]; self.numberBtn = numberBtn; [self.view addSubview:numberBtn]; @@ -85,16 +86,20 @@ titleLabel.text = @"悄悄地告诉你小优的年龄区间是?"; titleLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:16]; titleLabel.textColor = GIGARGB(63, 63, 63, 1); + titleLabel.numberOfLines = 2; self.questionlabel = titleLabel; + [titleLabel sizeToFit]; [self.view addSubview:titleLabel]; UILabel *descLabel = [[UILabel alloc] init]; descLabel.text = @"精准的选择,让小优更好的为您挑选最符合您的肤质的面膜"; descLabel.font = [UIFont fontWithName:GIGA_FONTNAME size:12]; descLabel.textColor = GIGARGB(208, 208, 208, 1); - descLabel.numberOfLines = 0; + + descLabel.numberOfLines = 3; descLabel.textAlignment = NSTextAlignmentCenter; self.descLabel = descLabel; + [descLabel sizeToFit]; [self.view addSubview:descLabel]; [numberBtn mas_makeConstraints:^(MASConstraintMaker *make) { @@ -108,14 +113,14 @@ make.left.mas_equalTo(numberBtn.mas_right).offset(12); make.centerY.mas_equalTo(numberBtn.mas_centerY); - make.right.mas_equalTo(self.view.mas_right).offset(-53); + }]; [descLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(numberBtn.mas_right).offset(12); make.top.mas_equalTo(titleLabel.mas_bottom).offset(20); - make.right.mas_equalTo(self.view.mas_right).offset(-89); + make.right.mas_equalTo(self.view.mas_right).offset(-50); }]; @@ -305,9 +310,9 @@ -(void)reloadViews{ //刷新问题相关数据 - NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_page] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; - - [_numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal]; +// NSAttributedString *numbertitle = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld",(long)_page] attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}]; +// +// [_numberBtn setAttributedTitle:numbertitle forState:UIControlStateNormal]; self.questionlabel.text = [NSString stringWithFormat:@"%@",_currentModel.question]; self.descLabel.text = _currentModel.remark; @@ -343,7 +348,7 @@ [self saveProgress]; if (_page == self.questonArray.count ) { - GIGA_ShowToast(@"没有了"); + //GIGA_ShowToast(@"没有了"); [self submitAnswer]; return; } diff --git a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m index 315d7ce..22cd3d8 100644 --- a/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m +++ b/GIGA/Modules/Mask/Exercises/Controller/MaskTestResultVC.m @@ -16,6 +16,7 @@ #import "GiGaFileNanager.h" #import #import "MaskTestResult.h" +#import "MaskTestNODataViewCell.h" @interface MaskTestResultVC () @@ -42,11 +43,18 @@ [self.tableView registerClass:[MaskResultMinViewCell class] forCellReuseIdentifier:@"MaskResultMinViewCell"]; [self.tableView registerClass:[MaskResultShareViewCell class] forCellReuseIdentifier:@"MaskResultShareViewCell"]; + + if (!self.model) { [self addNavTitile:@"历史测试"]; [self requstLatestTestData]; } + NC_ADD_TARGET_NAME_OBJECT(self, @selector(usershareSuccessNoti), NC_UseShareSuccessNoti, nil); +} + +-(void)dealloc{ + NC_REMOVE_NAME(self, NC_UseShareSuccessNoti, nil); } -(void)requstLatestTestData{ @@ -75,11 +83,24 @@ } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + if (self.model == nil) { + return 1; + } return 3; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (self.model == nil) { + MaskTestNODataViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskTestNODataViewCell"]; + if(!cell){ + cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskTestNODataViewCell" owner:self options:nil] lastObject]; + + } + [cell.testBtn addTarget:self action:@selector(testBtnAction) forControlEvents:UIControlEventTouchUpInside]; + return cell; + } + if (indexPath.row == 0) { static NSString *cellID = @"MaskResultPercentCell"; MaskResultPercentCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID]; @@ -114,6 +135,10 @@ } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (self.model == nil) { + return 255; + } CGFloat viewH = KMainH - SAFE_NAV_HEIGHT; CGFloat cellH = viewH / 3 ; return cellH; @@ -182,6 +207,15 @@ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } +//分享成功 +-(void)usershareSuccessNoti{ + +} + +-(void)testBtnAction{ + [self.navigationController popToRootViewControllerAnimated:YES]; +} + @end diff --git a/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m b/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m index b588e90..a6c86e9 100644 --- a/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m +++ b/GIGA/Modules/Mask/Exercises/View/GIGaQuestionSlider.m @@ -62,7 +62,7 @@ NSArray *colorArr = @[(id)[[UIColor colorWithHex:0xFFFFFF] CGColor], (id)[[UIColor colorWithHex:0xFFF3E4] CGColor], - (id)[[UIColor colorWithHex:0x9A9996] CGColor]]; + (id)[[UIColor colorWithHex:0xFBC37B] CGColor]]; NSArray *colorLocationArray = @[@0.0, @0.5, @1]; CAGradientLayer * gradientLayer = [CAGradientLayer layer]; gradientLayer.frame = self.bounds; diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.h b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.h new file mode 100644 index 0000000..d5d0867 --- /dev/null +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.h @@ -0,0 +1,14 @@ +// +// MaskTestNODataViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface MaskTestNODataViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UIButton *testBtn; + +@end diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.m b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.m new file mode 100644 index 0000000..85794e1 --- /dev/null +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.m @@ -0,0 +1,27 @@ +// +// MaskTestNODataViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "MaskTestNODataViewCell.h" + +@implementation MaskTestNODataViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + self.testBtn.layer.masksToBounds = YES; + self.testBtn.layer.cornerRadius = self.testBtn.frame.size.height /2 ; + +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.xib b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.xib new file mode 100644 index 0000000..a7622be --- /dev/null +++ b/GIGA/Modules/Mask/Exercises/View/MaskResultViews/MaskTestNODataViewCell.xib @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Mask/Model/GiGaShareModel.h b/GIGA/Modules/Mask/Model/GiGaShareModel.h new file mode 100644 index 0000000..265bbba --- /dev/null +++ b/GIGA/Modules/Mask/Model/GiGaShareModel.h @@ -0,0 +1,21 @@ +// +// GiGaShareModel.h +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaShareModel : JSONModel + +@property(nonatomic,copy) NSString *exquisite; +@property(nonatomic,copy) NSString *exquisitePercent; +@property(nonatomic,copy) NSString *headImgUrl; +@property(nonatomic,copy) NSString *minute; +@property(nonatomic,copy) NSString *monthMaskNum; +@property(nonatomic,copy) NSString *msg; +@property(nonatomic,copy) NSString *totalMaskNum; + +@end diff --git a/GIGA/Modules/Mask/Model/GiGaShareModel.m b/GIGA/Modules/Mask/Model/GiGaShareModel.m new file mode 100644 index 0000000..cf80b87 --- /dev/null +++ b/GIGA/Modules/Mask/Model/GiGaShareModel.m @@ -0,0 +1,18 @@ +// +// GiGaShareModel.m +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaShareModel.h" + +@implementation GiGaShareModel + ++ (BOOL)propertyIsOptional:(NSString *)propertyName{ + + return YES; +} + +@end diff --git a/GIGA/Modules/Mask/View/GiGaCommentView.m b/GIGA/Modules/Mask/View/GiGaCommentView.m index 21de34f..c68072b 100644 --- a/GIGA/Modules/Mask/View/GiGaCommentView.m +++ b/GIGA/Modules/Mask/View/GiGaCommentView.m @@ -25,7 +25,8 @@ self.frame = CGRectMake(0, 0, 0, height); _msgModel = model; //self.backgroundColor = [[UIColor blackColor]colorWithAlphaComponent:0.5]; - self.backgroundColor = [UIColor redColor]; + //self.backgroundColor = [UIColor redColor]; + [self initUI]; } return self; @@ -40,43 +41,48 @@ -(void)initUI{ - UIImageView *avatar = [[UIImageView alloc] init]; - avatar.layer.masksToBounds = YES; - avatar.layer.cornerRadius = 15; - [self addSubview:avatar]; - [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); - make.height.mas_equalTo(30); - make.left.mas_equalTo(self.mas_left).mas_offset(3); - make.top.mas_equalTo(self.mas_top).mas_offset(3); - - }]; +// UIImageView *avatar = [[UIImageView alloc] init]; +// avatar.layer.masksToBounds = YES; +// avatar.layer.cornerRadius = 15; +// [self addSubview:avatar]; +// [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); +// make.height.mas_equalTo(30); +// make.left.mas_equalTo(self.mas_left).mas_offset(3); +// make.top.mas_equalTo(self.mas_top).mas_offset(3); +// +// }]; UILabel *namelabel = [[UILabel alloc] init]; - namelabel.font = [UIFont systemFontOfSize:14]; - namelabel.textColor = [UIColor blackColor]; + namelabel.font = GIGA_TEXTFONTBOLD(15); + namelabel.textColor = [UIColor whiteColor]; //namelabel.frame= CGRectMake(CGRectGetMaxX(avatar.frame) + 5, 4, namelabel.frame.size.width, namelabel.frame.size.height); - namelabel.text = @"用户名"; + namelabel.text = @"用户名:"; if (_msgModel.sendUserName && _msgModel.sendUserName.length > 0) { - namelabel.text = [_msgModel.sendUserName replaceUnicode:_msgModel.sendUserName]; + namelabel.text = [NSString stringWithFormat:@"%@:",_msgModel.sendUserName]; } [namelabel sizeToFit]; self.userName = namelabel; [self addSubview:self.userName]; +// [self.userName mas_makeConstraints:^(MASConstraintMaker *make) { +// +// make.left.mas_equalTo(self.userAvtar.mas_right).mas_offset(3); +// make.top.mas_equalTo(self.mas_top).mas_offset(10); +// +// }]; + [self.userName mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.mas_left).offset(3); + make.centerY.mas_equalTo(self.mas_centerY); - make.left.mas_equalTo(self.userAvtar.mas_right).mas_offset(3); - make.top.mas_equalTo(self.mas_top).mas_offset(10); - }]; UILabel *msglabel = [[UILabel alloc] init]; - msglabel.font = [UIFont systemFontOfSize:13]; - msglabel.textColor = [UIColor blackColor]; + msglabel.font = GIGA_TEXTFONTMEDIUM(13); + msglabel.textColor = [UIColor whiteColor]; - //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 = @"信息内容"; if (_msgModel.content && _msgModel.content.length > 0) { msglabel.text = [_msgModel.content replaceUnicode:_msgModel.content]; @@ -84,17 +90,25 @@ self.msg = msglabel; [msglabel sizeToFit]; [self addSubview:self.msg]; +// [self.msg mas_makeConstraints:^(MASConstraintMaker *make) { +// +// make.top.mas_equalTo(self.userAvtar.mas_bottom).mas_offset(3); +// make.left.mas_equalTo(self.mas_left).mas_offset(5); +// +// }]; + [self.msg mas_makeConstraints:^(MASConstraintMaker *make) { - - make.top.mas_equalTo(self.userAvtar.mas_bottom).mas_offset(3); - make.left.mas_equalTo(self.mas_left).mas_offset(5); - + make.left.mas_equalTo(namelabel.mas_right).offset(2); + make.centerY.mas_equalTo(self.mas_centerY); }]; + [self layoutIfNeeded]; - float width = msglabel.frame.size.width > namelabel.frame.size.width ? msglabel.frame.size.width:namelabel.frame.size.width ; +// float width = msglabel.frame.size.width > namelabel.frame.size.width ? msglabel.frame.size.width:namelabel.frame.size.width ; + float width = msglabel.frame.size.width + namelabel.frame.size.width; - self.frame = CGRectMake(0, 0, namelabel.frame.origin.x + 10 + width, self.frame.size.height); + self.frame = CGRectMake(0, 0, width, self.frame.size.height); } + @end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m index 4b71f73..f7bf120 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskActionSheetViewCell.m @@ -16,7 +16,10 @@ } -(void)comfirmTitles:(NSIndexPath *)indepath { - NSArray *titles = @[@"手机相册",@"系统相册",@"自拍"]; + NSArray *titles = @[@"手机相册",@"系统相册",@"自拍",@"取消"]; + if (indepath.row == 3) { + self.sheetTitle.textColor = GIGARGB(165,165, 165, 1); + } self.sheetTitle.text = titles[indepath.row]; } diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.h b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.h index 3d2d005..87056f9 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.h +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.h @@ -14,5 +14,6 @@ @property (weak, nonatomic) IBOutlet UILabel *timeLabe; @property (weak, nonatomic) IBOutlet UILabel *percetLabe; @property (weak, nonatomic) IBOutlet UILabel *totalLabe; +@property (weak, nonatomic) IBOutlet UIImageView *userAvtoar; @end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.m index 30d4a17..8883aef 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.m +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.m @@ -20,6 +20,9 @@ self.timeBackVIew.layer.shadowOffset = CGSizeMake(2,1); self.timeBackVIew.layer.shadowColor = GIGARGB(91, 91, 91, 0.6).CGColor; self.timeBackVIew.layer.shadowOpacity = 0.8; + self.userAvtoar.layer.masksToBounds = YES; + self.userAvtoar.layer.cornerRadius = 4; + } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.xib b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.xib index 7832fd1..f6b9c90 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.xib +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskShareTimeMidViewCell.xib @@ -178,6 +178,7 @@ + diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h index 6209ba9..c9a5c5d 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.h @@ -7,9 +7,13 @@ // #import + + typedef void (^actionSheetAction)(NSUInteger index); -@interface MaskTimeShareActionSheet : UIView +@interface MaskTimeShareActionSheet : UIViewController @property(nonatomic,copy) actionSheetAction action; -(void)show:(actionSheetAction)action; ++(MaskTimeShareActionSheet *)showAtView:(UIViewController *)vc; + @end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m index 70c6aeb..2126056 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareActionSheet.m @@ -15,58 +15,55 @@ @implementation MaskTimeShareActionSheet -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3]; ; - [self creatUI]; - } - return self; + +- (void)viewDidLoad{ + [super viewDidLoad]; + self.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.4]; + [self creatUI]; } -(void)creatUI{ - UIView *holdview =[[UIView alloc] init]; - holdview.frame =CGRectMake(0,KMainH - 216 - 60 -20 , KMainW, 216 + 60 +20); - holdview.backgroundColor = [UIColor whiteColor]; -// CGRect backRect= holdview.frame; -// + holdview.frame =CGRectMake(0,KMainH - 216 , KMainW, 216); + holdview.backgroundColor = [UIColor whiteColor]; + //CGRect backRect= holdview.frame; + // UIBezierPath *maskPath=[UIBezierPath bezierPathWithRoundedRect:backRect byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(15, 15)]; // CAShapeLayer *maskLayer =[[CAShapeLayer alloc] init]; // maskLayer.frame = backRect; // maskLayer.path = maskPath.CGPath; // holdview.layer.mask = maskLayer; - holdview.layer.masksToBounds = YES; - holdview.layer.cornerRadius = 10; - [self addSubview:holdview]; +// holdview.layer.masksToBounds = YES; +// holdview.layer.cornerRadius = 10; + [self.view addSubview:holdview]; - self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KMainW, 216 + 60) style:UITableViewStylePlain]; + self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KMainW, 216) style:UITableViewStylePlain]; self.tabview.backgroundColor = [UIColor whiteColor]; self.tabview.separatorStyle = UITableViewCellSeparatorStyleNone; self.tabview.delegate = self; self.tabview.scrollEnabled = NO; self.tabview.dataSource = self; - - UIButton *cancleBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - [cancleBtn setTitle:@"取消" forState:UIControlStateNormal]; - [cancleBtn setTitleColor:GIGARGB(165,165, 165, 1) forState:UIControlStateNormal]; - [cancleBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; - - cancleBtn.frame = CGRectMake(0,1, KMainW,60); - - self.tabview.tableFooterView = cancleBtn; [holdview addSubview:self.tabview]; - - - + +} + + ++(MaskTimeShareActionSheet *)showAtView:(UIViewController *)vc{ + MaskTimeShareActionSheet *Sheet = [[MaskTimeShareActionSheet alloc] init]; + if (ISIOS8) { + Sheet.modalPresentationStyle = UIModalPresentationOverCurrentContext; + }else{ + Sheet.modalPresentationStyle = UIModalPresentationCurrentContext; + } + [vc presentViewController:Sheet animated:YES completion:nil]; + return Sheet; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - return 3; + return 4; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ @@ -82,11 +79,16 @@ return 54; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - - if (self.action) { - self.action(indexPath.row); + if (indexPath.row == 3) { [self cancleDissmiss]; + }else{ + [self cancleDissmiss]; + if (self.action) { + self.action(indexPath.row); + + } } + } -(void)show:(actionSheetAction)action{ @@ -106,10 +108,8 @@ } -(void)cancleDissmiss{ - [UIView animateWithDuration:1.0 animations:^{ - self.tabview.frame = CGRectMake(0, KMainH - 216, KMainW, 0); - }]; - [self removeFromSuperview]; + + [self dismissViewControllerAnimated:NO completion:nil]; } diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.h b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.h index 0b4a10c..b26982f 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.h +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.h @@ -9,5 +9,7 @@ #import @interface MaskTimeShareViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *doinglabel; +@property (weak, nonatomic) IBOutlet UIImageView *shareLabe; @end diff --git a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.xib b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.xib index 278d6fc..e55ff7c 100644 --- a/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.xib +++ b/GIGA/Modules/Mask/View/MaskSharesViews/MaskTimeShareViewCell.xib @@ -41,7 +41,7 @@ - + @@ -63,12 +63,16 @@ + + + + - + diff --git a/GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.xib b/GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.xib index 69ec66e..fb36194 100644 --- a/GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.xib +++ b/GIGA/Modules/Mask/View/MaskTimeEndViewImgaeCell.xib @@ -57,7 +57,7 @@ - - + - + - + - - + + diff --git a/GIGA/Modules/Me/View/GiGaMineInfoViewCell.xib b/GIGA/Modules/Me/View/GiGaMineInfoViewCell.xib index 7df9175..02a7bce 100644 --- a/GIGA/Modules/Me/View/GiGaMineInfoViewCell.xib +++ b/GIGA/Modules/Me/View/GiGaMineInfoViewCell.xib @@ -12,7 +12,7 @@ - + @@ -36,10 +36,10 @@ - + - + @@ -51,13 +51,13 @@ - + - + - + diff --git a/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.h b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.h new file mode 100644 index 0000000..4e8df23 --- /dev/null +++ b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.h @@ -0,0 +1,14 @@ +// +// HistoryNoDataViewCell.h +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface HistoryNoDataViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UIButton *mianmoBtn; + +@end diff --git a/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.m b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.m new file mode 100644 index 0000000..9547c12 --- /dev/null +++ b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.m @@ -0,0 +1,27 @@ +// +// HistoryNoDataViewCell.m +// GIGA +// +// Created by lianxiang on 2018/9/26. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "HistoryNoDataViewCell.h" + +@implementation HistoryNoDataViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + self.mianmoBtn.layer.masksToBounds = YES; + self.mianmoBtn.layer.cornerRadius = self.mianmoBtn.frame.size.height /2 ; + +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.xib b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.xib new file mode 100644 index 0000000..15fdc7b --- /dev/null +++ b/GIGA/Modules/Me/View/HistoryView/HistoryNoDataViewCell.xib @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.xib b/GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.xib index 5bee7e0..3edb60f 100644 --- a/GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.xib +++ b/GIGA/Modules/Me/View/HistoryView/MasHistoryFirstViewCell.xib @@ -42,12 +42,6 @@ - @@ -82,6 +76,15 @@ + @@ -89,12 +92,12 @@ - + + + - - diff --git a/GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.xib b/GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.xib index a25074d..c0249a4 100644 --- a/GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.xib +++ b/GIGA/Modules/Me/View/HistoryView/MaskHistoryListViewCell.xib @@ -19,62 +19,51 @@ - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -82,9 +71,12 @@ - + + + + diff --git a/GIGA/Modules/Me/View/userInfoView/GiGaUserJobViewCell.m b/GIGA/Modules/Me/View/userInfoView/GiGaUserJobViewCell.m index b2c7b49..53e0c53 100644 --- a/GIGA/Modules/Me/View/userInfoView/GiGaUserJobViewCell.m +++ b/GIGA/Modules/Me/View/userInfoView/GiGaUserJobViewCell.m @@ -18,6 +18,7 @@ @property (nonatomic,assign) int countX; @property (nonatomic,strong) NSArray *titles; @property (nonatomic,copy) NSString *selectjob; +@property (nonatomic) CGFloat btnMaXY; @end @implementation GiGaUserJobViewCell @@ -29,6 +30,7 @@ self.selectionStyle = UITableViewCellSelectionStyleNone; _countY = 0; _countX = 0; + _btnMaXY = 10; [self creatUI]; self.titles = [NSArray new]; //self.backgroundColor = [UIColor blueColor]; @@ -42,14 +44,14 @@ } -(void)updateActionBtnFrame{ - _upDownBtn.frame = CGRectMake(KMainW - 22 - 55,self.frame.size.height - 31, 55, 31); + _upDownBtn.frame = CGRectMake(KMainW - 22 - 55,_btnMaXY, 55, 31); } - (UIButton *)upDownBtn{ if (!_upDownBtn) { _upDownBtn = [UIButton buttonWithType:UIButtonTypeCustom]; - _upDownBtn.frame = CGRectMake(KMainW - 22 - 55, 10, 55, 31); + _upDownBtn.frame = CGRectMake(KMainW - 22 - 55,_btnMaXY, 55, 31); [_upDownBtn addTarget:self action:@selector(upDownBtnAction:) forControlEvents:UIControlEventTouchUpInside]; } return _upDownBtn; @@ -112,8 +114,7 @@ }else{ X = X + width + SPACE_X; } - - + } } } @@ -157,7 +158,6 @@ }else{ X = X + width + SPACE_X; } - } } @@ -192,18 +192,24 @@ _countX = 0; } + if (idx == self.titles.count - 1) { + _btnMaXY = Y; [self updateActionBtnFrame]; } } } JobMaskButton *jobBtn = [JobMaskButton buttonWithType:UIButtonTypeCustom]; - [jobBtn setBackgroundImage:[UIImage imageNamed:@"btn_job"] forState:UIControlStateNormal]; + //[jobBtn setBackgroundImage:[UIImage imageNamed:@"btn_job"] forState:UIControlStateNormal]; + jobBtn.layer.masksToBounds =YES; + jobBtn.layer.cornerRadius = MARK_H /2; + jobBtn.layer.borderWidth = 1; + jobBtn.layer.borderColor = GIGARGB(222, 222, 222, 1).CGColor; jobBtn.jobStr = title; NSAttributedString *attri = [GiGaHelper stringWithText:title textColor:GIGARGB(151, 151, 151, 1) textFont:GIGA_TEXTFONTMEDIUM(13) leterSpace:0]; [jobBtn setAttributedTitle:attri forState:UIControlStateNormal]; - jobBtn.frame = CGRectMake(X,Y, width, MARK_H); + jobBtn.frame = CGRectMake(X,Y,width, MARK_H); [jobBtn addTarget:self action:@selector(jobClick:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:jobBtn];