diff --git a/Ash_AWord.xcodeproj/project.pbxproj b/Ash_AWord.xcodeproj/project.pbxproj index 77f7404..352b743 100644 --- a/Ash_AWord.xcodeproj/project.pbxproj +++ b/Ash_AWord.xcodeproj/project.pbxproj @@ -367,6 +367,13 @@ A9DAB9A21B3FC1240008E30B /* MessageSetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DAB9A01B3FC1240008E30B /* MessageSetTableViewCell.m */; }; A9DAB9A31B3FC1240008E30B /* MessageSetTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DAB9A11B3FC1240008E30B /* MessageSetTableViewCell.xib */; }; A9DABA301B3FCF800008E30B /* libEaseMobClientSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9DABA2B1B3FCE870008E30B /* libEaseMobClientSDK.a */; }; + A9DABA341B3FD98F0008E30B /* EMAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DABA331B3FD98F0008E30B /* EMAlertView.m */; }; + A9DABA361B3FDFFC0008E30B /* Profile_filter_down@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA351B3FDFFC0008E30B /* Profile_filter_down@2x.png */; }; + A9DABA381B3FE2660008E30B /* Profile_filter_upClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA371B3FE2660008E30B /* Profile_filter_upClick@2x.png */; }; + A9DABA3B1B3FE4A50008E30B /* TypeSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DABA3A1B3FE4A50008E30B /* TypeSelectView.m */; }; + A9DABA3D1B3FE4B80008E30B /* TypeSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA3C1B3FE4B80008E30B /* TypeSelectView.xib */; }; + A9DABA401B3FE6F30008E30B /* TypeSelectBgView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DABA3F1B3FE6F30008E30B /* TypeSelectBgView.m */; }; + A9DABA421B3FE6FD0008E30B /* TypeSelectBgView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA411B3FE6FD0008E30B /* TypeSelectBgView.xib */; }; A9E2711B1ADB97ED000B1542 /* Default-568h.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E271191ADB97ED000B1542 /* Default-568h.png */; }; A9E2711C1ADB97ED000B1542 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E2711A1ADB97ED000B1542 /* Default.png */; }; A9E2711E1ADBB25C000B1542 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9E2711D1ADBB25C000B1542 /* AVFoundation.framework */; }; @@ -1005,6 +1012,16 @@ A9DAB9A01B3FC1240008E30B /* MessageSetTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageSetTableViewCell.m; sourceTree = ""; }; A9DAB9A11B3FC1240008E30B /* MessageSetTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageSetTableViewCell.xib; sourceTree = ""; }; A9DABA2B1B3FCE870008E30B /* libEaseMobClientSDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libEaseMobClientSDK.a; sourceTree = ""; }; + A9DABA321B3FD98F0008E30B /* EMAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EMAlertView.h; sourceTree = ""; }; + A9DABA331B3FD98F0008E30B /* EMAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EMAlertView.m; sourceTree = ""; }; + A9DABA351B3FDFFC0008E30B /* Profile_filter_down@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_down@2x.png"; sourceTree = ""; }; + A9DABA371B3FE2660008E30B /* Profile_filter_upClick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_upClick@2x.png"; sourceTree = ""; }; + A9DABA391B3FE4A50008E30B /* TypeSelectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSelectView.h; sourceTree = ""; }; + A9DABA3A1B3FE4A50008E30B /* TypeSelectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TypeSelectView.m; sourceTree = ""; }; + A9DABA3C1B3FE4B80008E30B /* TypeSelectView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TypeSelectView.xib; sourceTree = ""; }; + A9DABA3E1B3FE6F30008E30B /* TypeSelectBgView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSelectBgView.h; sourceTree = ""; }; + A9DABA3F1B3FE6F30008E30B /* TypeSelectBgView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TypeSelectBgView.m; sourceTree = ""; }; + A9DABA411B3FE6FD0008E30B /* TypeSelectBgView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TypeSelectBgView.xib; sourceTree = ""; }; A9E271191ADB97ED000B1542 /* Default-568h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h.png"; sourceTree = ""; }; A9E2711A1ADB97ED000B1542 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; A9E2711D1ADBB25C000B1542 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -1900,6 +1917,7 @@ A97C54D91AC9014D0038818A /* Vender */ = { isa = PBXGroup; children = ( + A9DABA311B3FD98F0008E30B /* EMAlertView */, A9744EDF1B3155150082301D /* EaseMobSDK */, A96D2F231B2FFD9C00DC0284 /* DejalActivityView */, A9A3A7551B281392001AAB3A /* CExpandHeader */, @@ -1943,6 +1961,8 @@ children = ( A9C58DAE1B3AA8EC0007FCDC /* audio */, A9F7F4581B33B51F00317F3E /* back@2x.png */, + A9DABA371B3FE2660008E30B /* Profile_filter_upClick@2x.png */, + A9DABA351B3FDFFC0008E30B /* Profile_filter_down@2x.png */, A97D70F11B3E3BAB0070BE84 /* acitvity_center_new@2x.png */, A971EDF61B32B7C40023740E /* chatBar_colorMore_audioCall@2x.png */, A971EDF71B32B7C40023740E /* chatBar_colorMore_audioCallSelected@2x.png */, @@ -2379,10 +2399,25 @@ A9DAB99F1B3FC1240008E30B /* MessageSetTableViewCell.h */, A9DAB9A01B3FC1240008E30B /* MessageSetTableViewCell.m */, A9DAB9A11B3FC1240008E30B /* MessageSetTableViewCell.xib */, + A9DABA391B3FE4A50008E30B /* TypeSelectView.h */, + A9DABA3A1B3FE4A50008E30B /* TypeSelectView.m */, + A9DABA3C1B3FE4B80008E30B /* TypeSelectView.xib */, + A9DABA3E1B3FE6F30008E30B /* TypeSelectBgView.h */, + A9DABA3F1B3FE6F30008E30B /* TypeSelectBgView.m */, + A9DABA411B3FE6FD0008E30B /* TypeSelectBgView.xib */, ); path = Common; sourceTree = ""; }; + A9DABA311B3FD98F0008E30B /* EMAlertView */ = { + isa = PBXGroup; + children = ( + A9DABA321B3FD98F0008E30B /* EMAlertView.h */, + A9DABA331B3FD98F0008E30B /* EMAlertView.m */, + ); + path = EMAlertView; + sourceTree = ""; + }; A9F7F45A1B33BC4E00317F3E /* Call */ = { isa = PBXGroup; children = ( @@ -2558,6 +2593,7 @@ A90BA0191AD6067F00728393 /* voice-continue-record-bgN@2x.png in Resources */, A9C58DF81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png in Resources */, A978CB291B3A3D5A00028C4A /* chat_sender_audio_playing_000@2x.png in Resources */, + A9DABA3D1B3FE4B80008E30B /* TypeSelectView.xib in Resources */, A97C55001AC933AD0038818A /* UMSCommentDetailController.xib in Resources */, A93441F21ACA916D00A6B233 /* tabbarQuotationClick@2x.png in Resources */, A90BA0011AD6031E00728393 /* MessagePublishViewController.xib in Resources */, @@ -2679,6 +2715,7 @@ A971EDF51B32B7AF0023740E /* chatBar_more_photoSelected@2x.png in Resources */, A97559C51ACBEE99004ADA42 /* NoteTableViewCell.xib in Resources */, A90BA0151AD6066000728393 /* voice-bottom-sure@2x.png in Resources */, + A9DABA381B3FE2660008E30B /* Profile_filter_upClick@2x.png in Resources */, A971EDDD1B32B7960023740E /* chatBar_faceSelected@2x.png in Resources */, A9CF212A1B1C65A2007490EF /* praise-wall-white@2x.png in Resources */, A9617A551ACC27860024AE4A /* SetUpViewController.xib in Resources */, @@ -2733,6 +2770,7 @@ A9C58DE31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png in Resources */, A98536731AEB66F9000312BF /* ReportViewController.xib in Resources */, A9C58DF61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png in Resources */, + A9DABA421B3FE6FD0008E30B /* TypeSelectBgView.xib in Resources */, A97C55011AC933AD0038818A /* UMSCommentInputController.xib in Resources */, A971EE0D1B32B7C40023740E /* chatBar_colorMore_videoSelected@2x.png in Resources */, A97559AD1ACB9DF0004ADA42 /* navigationButtonRefreshClick@2x.png in Resources */, @@ -2784,6 +2822,7 @@ A9FD82B71B1D433800AC4DC9 /* accessory@2x.png in Resources */, A9C58E001B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png in Resources */, A9C58DFA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png in Resources */, + A9DABA361B3FDFFC0008E30B /* Profile_filter_down@2x.png in Resources */, A90BA01B1AD6069A00728393 /* voice-play-start@2x.png in Resources */, A9C58DE71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png in Resources */, A978CB361B3A3D6700028C4A /* chat_receiver_audio_playing000@2x.png in Resources */, @@ -2845,6 +2884,7 @@ A9FAD4271AC922BE007ADC10 /* NoteViewController.m in Sources */, A97559A01ACB88FE004ADA42 /* AWordDefault.m in Sources */, A97C54D31AC8F10F0038818A /* XiaoYuAPIClient.m in Sources */, + A9DABA341B3FD98F0008E30B /* EMAlertView.m in Sources */, A9CF21211B1C4C70007490EF /* NoteCommentViewController.m in Sources */, A9F917C51B39055A0007A3AC /* EMChatImageBubbleView.m in Sources */, A97559C41ACBEE99004ADA42 /* NoteTableViewCell.m in Sources */, @@ -2861,6 +2901,7 @@ A971EDB31B32B5740023740E /* EMCDDeviceManager+Media.m in Sources */, A9754A1F1ADC080E0018BAAD /* DataSource.m in Sources */, A971EDB41B32B5740023740E /* EMCDDeviceManager+Microphone.m in Sources */, + A9DABA3B1B3FE4A50008E30B /* TypeSelectView.m in Sources */, A97C54DD1AC901980038818A /* MBProgressHUD+Util.m in Sources */, A96D2F261B2FFDA300DC0284 /* DejalActivityView.m in Sources */, A9F917DA1B390A220007A3AC /* NSDateFormatter+Category.m in Sources */, @@ -2923,6 +2964,7 @@ A9DAB9A21B3FC1240008E30B /* MessageSetTableViewCell.m in Sources */, A9754A211ADC080E0018BAAD /* HttpDataSource.m in Sources */, A9754A201ADC080E0018BAAD /* DataSourceWrapper.m in Sources */, + A9DABA401B3FE6F30008E30B /* TypeSelectBgView.m in Sources */, A97B1A3C1B3FA80E00D538F9 /* MessageSetViewController.m in Sources */, A9F917D71B39091A0007A3AC /* NSDate+Category.m in Sources */, A971EDB71B32B5740023740E /* EMCDDeviceManagerBase.m in Sources */, diff --git a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index a099891..3e70ba1 100644 --- a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -186,7 +186,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/My/MyRelateViewController.m" - timestampString = "457166929.62068" + timestampString = "457175493.973235" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "152" @@ -201,7 +201,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/My/MyRelateViewController.m" - timestampString = "457166929.621048" + timestampString = "457175493.973457" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "152" @@ -259,5 +259,117 @@ landmarkType = "5"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/Resource/Profile_filter_down@2x.png b/Ash_AWord/Resource/Profile_filter_down@2x.png new file mode 100644 index 0000000..8440887 Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_down@2x.png differ diff --git a/Ash_AWord/Resource/Profile_filter_upClick@2x.png b/Ash_AWord/Resource/Profile_filter_upClick@2x.png new file mode 100644 index 0000000..3411d54 Binary files /dev/null and b/Ash_AWord/Resource/Profile_filter_upClick@2x.png differ diff --git a/Ash_AWord/Resource/en.lproj/Localizable.strings b/Ash_AWord/Resource/en.lproj/Localizable.strings index a0c9671..e9f8043 100644 --- a/Ash_AWord/Resource/en.lproj/Localizable.strings +++ b/Ash_AWord/Resource/en.lproj/Localizable.strings @@ -8,7 +8,10 @@ "Saving" = "Saving"; "SaveFailed" = "SaveFailed"; "Saved" = "Saved"; - +"sure" = "OK"; +"yes" = "YES"; +"cancel" = "Cancel"; +"no" = "NO"; //message "message.image" = "image"; "message.location" = "location"; @@ -75,3 +78,33 @@ "NSDateCategory.text12" = "aa hh:mm"; "NSDateCategory.text13" = "M-d HH:mm"; "NSDateCategory.text14" = "today %@"; + + +//setting +"setting.autoLogin" = "automatic login"; +"setting.loginUser" = "log out(%@)"; +"setting.logoutOngoing" = "loging out..."; + +"setting.notDisturb" = "No disturbing"; +"setting.showDetail" = "display message details in apns"; +"setting.open" = "open"; +"setting.nightOpen" = "only open at night (22:00 - 7:00)"; +"setting.close" = "close"; +"setting.sureNotDisturb" = "this setting will cause all day in the don't disturb mode, will no longer receive push messages. Whether or not to continue?"; + +"setting.uploadLog" = "upload run log"; +"setting.sdkVersion" = "SDK version"; +"setting.uploading" = "uploading..."; +"setting.uploadSuccess" = "uploaded successfully"; +"setting.editName" = "Edit NickName"; +"setting.inputName" = "Please input nickname"; +"setting.saveName" = "Save Nickname"; +"setting.namenotempty" = "Name cannot be empty"; +"setting.edittips" = "After setting this nickname, chat with the iOS client demo project, iOS will display this nickname is not a EaseMob ID, if the other party to use the Android client this setting is not effective"; +"setting.iospushname" = "iOS push nickname"; +"setting.useIp" = "Use IP"; +"setting.deleteConWhenLeave" = "Delete conversation when leave a group"; +"setting.microphoneNoAuthority" = "No microphone permissions"; +"setting.microphoneAuthority" = "Please open in \"Setting\"-\"Privacy\"-\"Microphone\"."; +"setting.cameraNoAuthority" = "No camera permissions"; +"setting.cameraAuthority" = "Please open in \"Setting\"-\"Privacy\"-\"Camera\"."; \ No newline at end of file diff --git a/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings b/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings index 8e45ab0..d675973 100644 --- a/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings +++ b/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings @@ -9,6 +9,11 @@ "Saving" = "保存中"; "SaveFailed" = "保存失败"; "Saved" = "保存成功"; +"save" = "保存"; +"ok" = "确定"; +"yes" = "是"; +"cancel" = "取消"; +"no" = "否"; //message "message.image" = "图片"; @@ -60,6 +65,34 @@ "location.fail" = "定位失败"; "location.ongoning" = "正在定位..."; +//setting +"setting.autoLogin" = "自动登录"; +"setting.loginUser" = "退出登录(%@)"; +"setting.logoutOngoing" = "正在退出..."; + +"setting.notDisturb" = "功能消息免打扰"; +"setting.showDetail" = "通知显示消息详情"; +"setting.open" = "开启"; +"setting.nightOpen" = "只在夜间开启 (22:00 - 7:00)"; +"setting.close" = "关闭"; +"setting.sureNotDisturb" = "此设置会导致全天都处于免打扰模式, 不会再收到推送消息. 是否继续?"; + +"setting.uploadLog" = "上传运行日志"; +"setting.sdkVersion" = "SDK 版本"; +"setting.uploading" = "正在上传..."; +"setting.uploadSuccess" = "上传成功"; +"setting.editName" = "更改昵称"; +"setting.inputName" = "请输入新昵称"; +"setting.saveName" = "保存更改昵称"; +"setting.namenotempty" = "昵称不能为空"; +"setting.edittips" = "设置此昵称以后,在与iOS客户端demo聊天工程中,iOS一侧会显示此昵称而不是环信ID,如果对方使用安卓客户端则此设置不生效"; +"setting.iospushname" = "iOS离线推送昵称"; +"setting.useIp" = "使用IP"; +"setting.deleteConWhenLeave" = "退群时删除会话"; +"setting.microphoneNoAuthority" = "未获得授权使用麦克风"; +"setting.microphoneAuthority" = "请在iOS\"设置中\"-\"隐私\"-\"麦克风\"中打开"; +"setting.cameraNoAuthority" = "未获得授权使用相机"; +"setting.cameraAuthority" = "请在iOS\"设置中\"-\"隐私\"-\"相机\"中打开"; //NSDateCategory "NSDateCategory.text1" = "1分钟内"; diff --git a/Ash_AWord/Vender/EMAlertView/EMAlertView.h b/Ash_AWord/Vender/EMAlertView/EMAlertView.h new file mode 100644 index 0000000..73a1ee9 --- /dev/null +++ b/Ash_AWord/Vender/EMAlertView/EMAlertView.h @@ -0,0 +1,30 @@ +// +// EMAlertView.h +// AlertView +// +// Created by EaseMob on 15/4/1. +// Copyright (c) 2015年 EaseMob. All rights reserved. +// + +#import + +@interface EMAlertView : UIAlertView + +/** + * 弹出提示框 + * + * @param title <#title description#> + * @param message <#message description#> + * @param block <#block description#> + * @param cancelButtonTitle <#cancelButtonTitle description#> + * @param otherButtonTitles <#otherButtonTitles description#> + * + * @return <#return value description#> + */ ++ (id)showAlertWithTitle:(NSString *)title + message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ...; + +@end diff --git a/Ash_AWord/Vender/EMAlertView/EMAlertView.m b/Ash_AWord/Vender/EMAlertView/EMAlertView.m new file mode 100644 index 0000000..c695759 --- /dev/null +++ b/Ash_AWord/Vender/EMAlertView/EMAlertView.m @@ -0,0 +1,103 @@ +// +// EMAlertView.m +// AlertView +// +// Created by EaseMob on 15/4/1. +// Copyright (c) 2015年 EaseMob. All rights reserved. +// + +#import "EMAlertView.h" +#import + +@interface EMAlertView () + +@end + +@implementation EMAlertView + +void EMNoTitleAlert(NSString* message) { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:message + message:nil + delegate:nil + cancelButtonTitle:@"确定" + otherButtonTitles:nil]; + [alert show]; +} + ++ (id)showAlertWithTitle:(NSString *)title message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... +{ + if (!cancelButtonTitle && !otherButtonTitles) { + return nil; + } + EMAlertView *alertView = [[self alloc] initWithTitle:title + message:message + completionBlock:block + cancelButtonTitle:cancelButtonTitle + otherButtonTitles:nil]; + + if (otherButtonTitles != nil) { + id eachObject; + va_list argumentList; + if (otherButtonTitles) { + [alertView addButtonWithTitle:otherButtonTitles]; + va_start(argumentList, otherButtonTitles); + while ((eachObject = va_arg(argumentList, id))) { + [alertView addButtonWithTitle:eachObject]; + } + va_end(argumentList); + } + } + + [alertView show]; + + return alertView; + +} + + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + void (^block)(NSUInteger buttonIndex, UIAlertView *alertView) = objc_getAssociatedObject(self, "blockCallback"); + if (block) { + block(buttonIndex, self); + } +} + + +- (id)initWithTitle:(NSString *)title + message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... { + + objc_setAssociatedObject(self, "blockCallback", [block copy], OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + if (self = [self initWithTitle:title + message:message + delegate:self + cancelButtonTitle:nil + otherButtonTitles:nil]) { + + if (cancelButtonTitle) { + [self addButtonWithTitle:cancelButtonTitle]; + self.cancelButtonIndex = [self numberOfButtons] - 1; + } + + id eachObject; + va_list argumentList; + if (otherButtonTitles) { + [self addButtonWithTitle:otherButtonTitles]; + va_start(argumentList, otherButtonTitles); + while ((eachObject = va_arg(argumentList, id))) { + [self addButtonWithTitle:eachObject]; + } + va_end(argumentList); + } + } + return self; +} + +@end diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.m b/Ash_AWord/ViewControllers/Main/MainViewController.m index 7e11f02..bbbaa5b 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.m +++ b/Ash_AWord/ViewControllers/Main/MainViewController.m @@ -76,7 +76,7 @@ static NSString *kMessageType = @"MessageType"; // Do any additional setup after loading the view from its nib. [[UITableViewHeaderFooterView appearance] setTintColor:[UIColor clearColor]]; - [[UITabBar appearance] setTintColor:[UIColor blackColor]]; + [[UITabBar appearance] setTintColor:[UIColor appMainColor]]; [UIBarButtonItem.appearance setTintColor:[UIColor blackColor]]; [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; diff --git a/Ash_AWord/ViewControllers/Main/MessageViewController.m b/Ash_AWord/ViewControllers/Main/MessageViewController.m index e396800..6faadc2 100644 --- a/Ash_AWord/ViewControllers/Main/MessageViewController.m +++ b/Ash_AWord/ViewControllers/Main/MessageViewController.m @@ -12,12 +12,17 @@ #import "MessageTableViewCell.h" #import "AudioPlayer.h" #import "ReportViewController.h" +#import "TypeSelectView.h" +#import "TypeSelectBgView.h" @interface MessageViewController () { NSInteger _page; NSMutableArray* _text_voiceArr; NSInteger _playIndex; NSInteger _reportIndex; + TypeSelectView* _typeSelectView; + TypeSelectBgView* _typeSelectBgView; + NSInteger _type; //_type=0 代表全部,1代表关注. } @end @@ -32,6 +37,7 @@ _text_voiceArr = [[NSMutableArray alloc] init]; _playIndex = -1; _reportIndex = -1; + _type = 0; } return self; } @@ -43,6 +49,20 @@ [self customViewDidLoad]; + _typeSelectBgView = [Ash_UIUtil instanceXibView:@"TypeSelectBgView"]; + _typeSelectBgView.frame = self.view.frame; + [self.view addSubview:_typeSelectBgView]; + _typeSelectBgView.typeIndex = _type; + [_typeSelectBgView.allBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside]; + [_typeSelectBgView.attentionBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside]; + [_typeSelectBgView hide]; + + _typeSelectView = [Ash_UIUtil instanceXibView:@"TypeSelectView"]; + [_typeSelectView.typeBtn addTarget:self action:@selector(showTypeSelect:) forControlEvents:UIControlEventTouchUpInside]; + _typeSelectView.frame = CGRectMake(0, 0, 60, 40); + self.navigationItem.titleView = _typeSelectView; + + self.navigationItem.title = @"听你说"; self.navigationItem.leftBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(publish) image:[UIImage imageNamed:@"navigationButtonPublish"] highlightedImage:[UIImage imageNamed:@"navigationButtonPublishClick"]]; self.navigationItem.rightBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(headerBeginRefreshing) image:[UIImage imageNamed:@"navigationButtonRefresh"] highlightedImage:[UIImage imageNamed:@"navigationButtonRefreshClick"]]; @@ -63,6 +83,30 @@ [menu setMenuItems:menuItems]; } +-(void)selectTypeBtn:(UIButton*)button +{ + [_typeSelectBgView hide]; + if (_type == button.tag) { + return; + }else{ + _type = button.tag; + if (_type == 0) { + _typeSelectView.titleLabel.text = @"全部"; + }else{ + _typeSelectView.titleLabel.text = @"关注"; + } + _typeSelectBgView.typeIndex = _type; + [self headerBeginRefreshing]; + + } +} +-(void)showTypeSelect:(id)sender +{ + if (_typeSelectBgView.hidden) { + [_typeSelectBgView show]; + } +} + -(void)longPressToDo:(UILongPressGestureRecognizer *)gesture { @@ -142,7 +186,7 @@ { [MobClick event:kUmen_message]; - PropertyEntity* pro = [MessageViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:20]; + PropertyEntity* pro = [MessageViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:DefaultPageSize withType:_type]; [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { MessageViewModel* noteViewModel = (MessageViewModel*)viewModel; diff --git a/Ash_AWord/ViewControllers/Main/NoteViewController.m b/Ash_AWord/ViewControllers/Main/NoteViewController.m index d6b3336..4e7d9cb 100644 --- a/Ash_AWord/ViewControllers/Main/NoteViewController.m +++ b/Ash_AWord/ViewControllers/Main/NoteViewController.m @@ -12,11 +12,16 @@ #import "NoteViewModel.h" #import "UpdateViewModel.h" #import "ReportViewController.h" +#import "TypeSelectView.h" +#import "TypeSelectBgView.h" @interface NoteViewController () { NSInteger _page; NSMutableArray* _text_imageArr; NSInteger _reportIndex; + TypeSelectView* _typeSelectView; + TypeSelectBgView* _typeSelectBgView; + NSInteger _type; //_type=0 代表全部,1代表关注. } @end @@ -30,6 +35,7 @@ _page = 1; _text_imageArr = [[NSMutableArray alloc] init]; _reportIndex = -1; + _type = 0; } return self; } @@ -42,6 +48,20 @@ self.navigationItem.title = @"遇见你"; + + _typeSelectBgView = [Ash_UIUtil instanceXibView:@"TypeSelectBgView"]; + _typeSelectBgView.frame = self.view.frame; + [self.view addSubview:_typeSelectBgView]; + _typeSelectBgView.typeIndex = _type; + [_typeSelectBgView.allBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside]; + [_typeSelectBgView.attentionBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside]; + [_typeSelectBgView hide]; + + _typeSelectView = [Ash_UIUtil instanceXibView:@"TypeSelectView"]; + [_typeSelectView.typeBtn addTarget:self action:@selector(showTypeSelect:) forControlEvents:UIControlEventTouchUpInside]; + _typeSelectView.frame = CGRectMake(0, 0, 60, 40); + self.navigationItem.titleView = _typeSelectView; + self.navigationItem.leftBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(publish) image:[UIImage imageNamed:@"navigationButtonPublish"] highlightedImage:[UIImage imageNamed:@"navigationButtonPublishClick"]]; self.navigationItem.rightBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(headerBeginRefreshing) image:[UIImage imageNamed:@"navigationButtonRefresh"] highlightedImage:[UIImage imageNamed:@"navigationButtonRefreshClick"]]; [self headerBeginRefreshing]; @@ -62,6 +82,29 @@ [menu setMenuItems:menuItems]; } +-(void)selectTypeBtn:(UIButton*)button +{ + [_typeSelectBgView hide]; + if (_type == button.tag) { + return; + }else{ + _type = button.tag; + if (_type == 0) { + _typeSelectView.titleLabel.text = @"全部"; + }else{ + _typeSelectView.titleLabel.text = @"关注"; + } + _typeSelectBgView.typeIndex = _type; + [self headerBeginRefreshing]; + + } +} +-(void)showTypeSelect:(id)sender +{ + if (_typeSelectBgView.hidden) { + [_typeSelectBgView show]; + } +} -(void)longPressToDo:(UILongPressGestureRecognizer *)gesture { if(gesture.state == UIGestureRecognizerStateBegan) @@ -164,7 +207,7 @@ { [MobClick event:kUmen_note]; - PropertyEntity* pro = [NoteViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:DefaultPageSize]; + PropertyEntity* pro = [NoteViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:DefaultPageSize withType:_type]; [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { NoteViewModel* noteViewModel = (NoteViewModel*)viewModel; diff --git a/Ash_AWord/ViewControllers/My/MessageSetViewController.m b/Ash_AWord/ViewControllers/My/MessageSetViewController.m index ec4d135..7c892bf 100644 --- a/Ash_AWord/ViewControllers/My/MessageSetViewController.m +++ b/Ash_AWord/ViewControllers/My/MessageSetViewController.m @@ -7,9 +7,14 @@ // #import "MessageSetViewController.h" - -@interface MessageSetViewController () - +#import "MessageSetTableViewCell.h" +#import "EMAlertView.h" +@interface MessageSetViewController () +{ + EMPushNotificationNoDisturbStatus _noDisturbingStatus; + NSInteger _noDisturbingStart; + NSInteger _noDisturbingEnd; +} @end @implementation MessageSetViewController @@ -17,6 +22,57 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. + [self customViewDidLoad]; + self.title = @"消息推送设置"; + _tableView.delegate = self; + _tableView.dataSource = self; + + + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(savePushOptions)]; + _noDisturbingStart = -1; + _noDisturbingEnd = -1; + _noDisturbingStatus = -1; + [self refreshPushOptions]; + + [self.tableView reloadData]; +} +#pragma mark - action + +- (void)savePushOptions +{ + BOOL isUpdate = NO; + EMPushNotificationOptions *options = [[EaseMob sharedInstance].chatManager pushNotificationOptions]; + + if (options.noDisturbingStartH != _noDisturbingStart || options.noDisturbingEndH != _noDisturbingEnd){ + isUpdate = YES; + options.noDisturbStatus = _noDisturbingStatus; + options.noDisturbingStartH = _noDisturbingStart; + options.noDisturbingEndH = _noDisturbingEnd; + } + + if (isUpdate) { + [[EaseMob sharedInstance].chatManager asyncUpdatePushOptions:options completion:^(EMPushNotificationOptions *options, EMError *error) { + if (!error) { + [MBProgressHUD checkHudWithView:self.view label:@"保存成功" hidesAfter:1.0]; + }else{ + [MBProgressHUD checkHudWithView:self.view label:@"服务器异常,保存失败" hidesAfter:1.0]; + + } + } onQueue:nil]; + } + +} + + +- (void)refreshPushOptions +{ + EMPushNotificationOptions *options = [[EaseMob sharedInstance].chatManager pushNotificationOptions]; + _noDisturbingStatus = options.noDisturbStatus; + if (_noDisturbingStatus != ePushNotificationNoDisturbStatusClose) { + _noDisturbingStart = options.noDisturbingStartH; + _noDisturbingEnd = options.noDisturbingEndH; + } } - (void)didReceiveMemoryWarning { @@ -24,6 +80,106 @@ // Dispose of any resources that can be recreated. } +#pragma mark UITableViewDelegate +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 3; +} +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return 50; +} +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return NSLocalizedString(@"setting.notDisturb", @"No disturbing"); + +} +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section +{ + + return 30; +} +-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString* cellIdentifier = @"MessageSetTableViewCell"; + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; + } + + if (indexPath.row == 0) { + cell.textLabel.text = NSLocalizedString(@"setting.open", @"Open"); + cell.accessoryType = _noDisturbingStatus == ePushNotificationNoDisturbStatusDay ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + } + else if (indexPath.row == 1) + { + cell.textLabel.text = NSLocalizedString(@"setting.nightOpen", @"only open at night (22:00 - 7:00)"); + cell.accessoryType = _noDisturbingStatus == ePushNotificationNoDisturbStatusCustom ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + } + else if (indexPath.row == 2) + { + cell.textLabel.text = NSLocalizedString(@"setting.close", @"Close"); + cell.accessoryType = _noDisturbingStatus == ePushNotificationNoDisturbStatusClose ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + } + + return cell; +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + BOOL needReload = YES; + + switch (indexPath.row) { + case 0: + { + needReload = NO; + [EMAlertView showAlertWithTitle:NSLocalizedString(@"prompt", @"Prompt") + message:NSLocalizedString(@"setting.sureNotDisturb", @"this setting will cause all day in the don't disturb mode, will no longer receive push messages. Whether or not to continue?") + completionBlock:^(NSUInteger buttonIndex, EMAlertView *alertView) { + switch (buttonIndex) { + case 0: { + } break; + default: { + self->_noDisturbingStart = 0; + self->_noDisturbingEnd = 24; + self->_noDisturbingStatus = ePushNotificationNoDisturbStatusDay; + [tableView reloadData]; + } break; + } + + } cancelButtonTitle:NSLocalizedString(@"no", @"NO") + otherButtonTitles:NSLocalizedString(@"yes", @"YES"), nil]; + + } break; + case 1: + { + _noDisturbingStart = 22; + _noDisturbingEnd = 7; + _noDisturbingStatus = ePushNotificationNoDisturbStatusCustom; + } + break; + case 2: + { + _noDisturbingStart = -1; + _noDisturbingEnd = -1; + _noDisturbingStatus = ePushNotificationNoDisturbStatusClose; + } + break; + + default: + break; + } + + if (needReload) { + [tableView reloadData]; + } + +} /* #pragma mark - Navigation diff --git a/Ash_AWord/ViewControllers/My/MessageSetViewController.xib b/Ash_AWord/ViewControllers/My/MessageSetViewController.xib index 35501e4..773a62a 100644 --- a/Ash_AWord/ViewControllers/My/MessageSetViewController.xib +++ b/Ash_AWord/ViewControllers/My/MessageSetViewController.xib @@ -16,9 +16,9 @@ - + - + diff --git a/Ash_AWord/ViewControllers/Note/NotePublishViewController.h b/Ash_AWord/ViewControllers/Note/NotePublishViewController.h index 0594882..6f67f45 100644 --- a/Ash_AWord/ViewControllers/Note/NotePublishViewController.h +++ b/Ash_AWord/ViewControllers/Note/NotePublishViewController.h @@ -12,6 +12,7 @@ @property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentHeight; @property (weak, nonatomic) IBOutlet UIPlaceHolderTextView *contentTextView; +- (IBAction)imageBtnClick:(id)sender; @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property (weak, nonatomic) IBOutlet UILabel *lengthLabel; @property (nonatomic,strong)UIImage* publishImage; diff --git a/Ash_AWord/ViewControllers/Note/NotePublishViewController.m b/Ash_AWord/ViewControllers/Note/NotePublishViewController.m index 26c2a58..91c1646 100644 --- a/Ash_AWord/ViewControllers/Note/NotePublishViewController.m +++ b/Ash_AWord/ViewControllers/Note/NotePublishViewController.m @@ -8,7 +8,7 @@ #import "NotePublishViewController.h" #import "NotePublishViewModel.h" -@interface NotePublishViewController () +@interface NotePublishViewController () { NSInteger _textLeft; } @@ -111,4 +111,56 @@ } */ +- (IBAction)imageBtnClick:(id)sender { + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"拍照",@"从手机相册选择", nil]; + actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; + [actionSheet showFromTabBar:self.tabBarController.tabBar]; + }else{ + [self actionSheet:nil clickedButtonAtIndex:1]; + } +} +#pragma mark UIActonSheetDelegate +-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex +{ + UIImagePickerController* picker = [[UIImagePickerController alloc] init]; + // picker.allowsEditing = YES; + picker.delegate = self; + if (buttonIndex == 0) { + picker.sourceType = UIImagePickerControllerSourceTypeCamera; + } + if (buttonIndex == 1) { + picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + + } + if(buttonIndex == 2) + { + return; + } + [self presentViewController:picker animated:YES completion:nil]; + +} + +#pragma mark UIImagePickerControllerDelegate +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [picker dismissViewControllerAnimated: YES completion: ^(void){}]; + +} +-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info +{ + UIImage* image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; + if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) { + + UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); + } + // resize image + image = [Ash_UIUtil fixOrientation:image]; + image = [Ash_UIUtil compressImageDownToPhoneScreenSize:image]; + [picker dismissViewControllerAnimated:NO completion:nil]; + + _publishImage = image; + [_imageView setImage:_publishImage]; +} + @end diff --git a/Ash_AWord/ViewControllers/Note/NotePublishViewController.xib b/Ash_AWord/ViewControllers/Note/NotePublishViewController.xib index 9031455..1de1504 100644 --- a/Ash_AWord/ViewControllers/Note/NotePublishViewController.xib +++ b/Ash_AWord/ViewControllers/Note/NotePublishViewController.xib @@ -1,8 +1,8 @@ - + - + @@ -45,18 +45,31 @@ + + + + + diff --git a/Ash_AWord/ViewModels/Message/MessageViewModel.h b/Ash_AWord/ViewModels/Message/MessageViewModel.h index 51eee29..b4037f3 100644 --- a/Ash_AWord/ViewModels/Message/MessageViewModel.h +++ b/Ash_AWord/ViewModels/Message/MessageViewModel.h @@ -33,7 +33,7 @@ @property (nonatomic, strong)Text_Voice *text_voice; -+(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size; ++(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withType:(NSInteger)type; //type 0 查看全部,1关注; +(PropertyEntity*)requireMyWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size; +(PropertyEntity*)requireOhterWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withOtherId:(NSString*)otherid; diff --git a/Ash_AWord/ViewModels/Message/MessageViewModel.m b/Ash_AWord/ViewModels/Message/MessageViewModel.m index c2ad3ee..345778b 100644 --- a/Ash_AWord/ViewModels/Message/MessageViewModel.m +++ b/Ash_AWord/ViewModels/Message/MessageViewModel.m @@ -62,7 +62,7 @@ + (NSValueTransformer *)text_voiceJSONTransformer{ return [NSValueTransformer mtl_JSONDictionaryTransformerWithModelClass:Text_Voice.class]; } -+(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size ++(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withType:(NSInteger)type { PropertyEntity *pro = [[PropertyEntity alloc] init]; pro.requireType = HTTPRequestTypeWithPOSTDATA; @@ -72,8 +72,12 @@ @"pageSize": [NSString stringWithFormat:@"%ld",(long)page_size], }; + NSString* command = @"30004"; + if (type == 1) { + command = @"30009"; + } pro.pro = @{@"root": dic, - @"command": @"30004", + @"command": command, }; return pro; diff --git a/Ash_AWord/ViewModels/Note/NoteViewModel.h b/Ash_AWord/ViewModels/Note/NoteViewModel.h index 6c15b29..a731db3 100644 --- a/Ash_AWord/ViewModels/Note/NoteViewModel.h +++ b/Ash_AWord/ViewModels/Note/NoteViewModel.h @@ -30,7 +30,7 @@ @property (nonatomic, strong)NSArray* text_imagesArr; @property (nonatomic, strong)Text_Image* text_image; -+(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size; ++(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withType:(NSInteger)type; //type 0 查看全部,1关注 +(PropertyEntity*)requireMyWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size; +(PropertyEntity*)requireOhterWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withOtherId:(NSString*)otherid; diff --git a/Ash_AWord/ViewModels/Note/NoteViewModel.m b/Ash_AWord/ViewModels/Note/NoteViewModel.m index 5ff462b..6e8bfdf 100644 --- a/Ash_AWord/ViewModels/Note/NoteViewModel.m +++ b/Ash_AWord/ViewModels/Note/NoteViewModel.m @@ -64,7 +64,7 @@ return [NSValueTransformer mtl_JSONDictionaryTransformerWithModelClass:Text_Image.class]; } -+(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size ++(PropertyEntity*)requireWithOrder_by:(Order_by)order_by withPage:(NSInteger)page withPage_size:(NSInteger)page_size withType:(NSInteger)type { PropertyEntity *pro = [[PropertyEntity alloc] init]; pro.requireType = HTTPRequestTypeWithPOSTDATA; @@ -74,9 +74,12 @@ @"page": [NSString stringWithFormat:@"%ld",(long)page], @"pageSize": [NSString stringWithFormat:@"%ld",(long)page_size], }; - + NSString* command = @"20004"; + if (type == 1) { + command = @"20009"; + } pro.pro = @{@"root": dic, - @"command": @"20004", + @"command": command, }; diff --git a/Ash_AWord/Views/Common/MessageSetTableViewCell.h b/Ash_AWord/Views/Common/MessageSetTableViewCell.h index c27822f..7185e1c 100644 --- a/Ash_AWord/Views/Common/MessageSetTableViewCell.h +++ b/Ash_AWord/Views/Common/MessageSetTableViewCell.h @@ -9,5 +9,6 @@ #import @interface MessageSetTableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UISwitch *isSlectSwitch; @end diff --git a/Ash_AWord/Views/Common/MessageSetTableViewCell.xib b/Ash_AWord/Views/Common/MessageSetTableViewCell.xib index 2d27c3d..904c8c1 100644 --- a/Ash_AWord/Views/Common/MessageSetTableViewCell.xib +++ b/Ash_AWord/Views/Common/MessageSetTableViewCell.xib @@ -1,7 +1,8 @@ - + - + + @@ -12,7 +13,19 @@ + + + + + + + + + + + + diff --git a/Ash_AWord/Views/Common/TypeSelectBgView.h b/Ash_AWord/Views/Common/TypeSelectBgView.h new file mode 100644 index 0000000..3ec3eec --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectBgView.h @@ -0,0 +1,25 @@ +// +// TypeSelectBgView.h +// Ash_AWord +// +// Created by xmfish on 15/6/28. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import + +@interface TypeSelectBgView : UIView + +@property (weak, nonatomic) IBOutlet UIView *bgView; +@property (weak, nonatomic) IBOutlet UIButton *allBtn; +- (IBAction)allBtnClick:(id)sender; +- (IBAction)bgBtnClick:(id)sender; +- (IBAction)attentionBtnClick:(id)sender; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *lineHeight; +@property (weak, nonatomic) IBOutlet UIView *lineView; +@property (weak, nonatomic) IBOutlet UIButton *attentionBtn; + +@property(nonatomic, assign)NSInteger typeIndex; +-(void)show; +-(void)hide; +@end diff --git a/Ash_AWord/Views/Common/TypeSelectBgView.m b/Ash_AWord/Views/Common/TypeSelectBgView.m new file mode 100644 index 0000000..7662f98 --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectBgView.m @@ -0,0 +1,71 @@ +// +// TypeSelectBgView.m +// Ash_AWord +// +// Created by xmfish on 15/6/28. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "TypeSelectBgView.h" + +@implementation TypeSelectBgView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. + +*/ +- (void)drawRect:(CGRect)rect { + // Drawing code + _allBtn.tag = 0; + _attentionBtn.tag = 1; + CGRect frame = _bgView.frame; + frame.origin.y-=_bgView.frame.size.height; + _bgView.frame = frame; + + _lineHeight.constant = 0.5; + _lineView.backgroundColor = [UIColor lineColor]; +} +- (IBAction)allBtnClick:(id)sender { +} + +- (IBAction)bgBtnClick:(id)sender { + [self hide]; +} + +- (IBAction)attentionBtnClick:(id)sender { +} + +-(void)show{ + [self changeTypeState]; + self.hidden = NO; + [UIView animateWithDuration:0.3 animations:^{ + CGRect frame = _bgView.frame; + frame.origin.y+=_bgView.frame.size.height; + _bgView.frame = frame; + } completion:^(BOOL finished) { + + }]; +} +-(void)hide{ + + [UIView animateWithDuration:0.3 animations:^{ + CGRect frame = _bgView.frame; + frame.origin.y-=_bgView.frame.size.height; + _bgView.frame = frame; + } completion:^(BOOL finished) { + self.hidden = YES; + }]; +} +-(void)changeTypeState +{ + if (_typeIndex == 0) { + [_allBtn setTitleColor:[UIColor appMainColor] forState:UIControlStateNormal]; + [_attentionBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + }else{ + [_allBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [_attentionBtn setTitleColor:[UIColor appMainColor] forState:UIControlStateNormal]; + + } +} +@end diff --git a/Ash_AWord/Views/Common/TypeSelectBgView.xib b/Ash_AWord/Views/Common/TypeSelectBgView.xib new file mode 100644 index 0000000..01e504b --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectBgView.xib @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/Views/Common/TypeSelectView.h b/Ash_AWord/Views/Common/TypeSelectView.h new file mode 100644 index 0000000..a43f544 --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectView.h @@ -0,0 +1,16 @@ +// +// TypeSelectView.h +// Ash_AWord +// +// Created by xmfish on 15/6/28. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import + +@interface TypeSelectView : UIView +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UIButton *imageTypeBtn; +@property (weak, nonatomic) IBOutlet UIButton *typeBtn; + +@end diff --git a/Ash_AWord/Views/Common/TypeSelectView.m b/Ash_AWord/Views/Common/TypeSelectView.m new file mode 100644 index 0000000..e310f87 --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectView.m @@ -0,0 +1,23 @@ +// +// TypeSelectView.m +// Ash_AWord +// +// Created by xmfish on 15/6/28. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "TypeSelectView.h" + +@implementation TypeSelectView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +- (IBAction)typeBtnClick:(id)sender { +} +@end diff --git a/Ash_AWord/Views/Common/TypeSelectView.xib b/Ash_AWord/Views/Common/TypeSelectView.xib new file mode 100644 index 0000000..6953b30 --- /dev/null +++ b/Ash_AWord/Views/Common/TypeSelectView.xib @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +