消息的删除等

This commit is contained in:
wu736139669
2015-06-26 17:32:34 +08:00
parent 4a9bac5452
commit b720c1ff25
10 changed files with 133 additions and 24 deletions
@@ -2041,11 +2041,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m" filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m"
timestampString = "456156474.252497" timestampString = "457003304.570546"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "130" startingLineNumber = "191"
endingLineNumber = "130" endingLineNumber = "191"
landmarkName = "-loadData" landmarkName = "-loadData"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@@ -2425,11 +2425,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m" filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m"
timestampString = "456156474.252497" timestampString = "457003304.570546"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "125" startingLineNumber = "186"
endingLineNumber = "125" endingLineNumber = "186"
landmarkName = "-loadData" landmarkName = "-loadData"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@@ -2505,11 +2505,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m" filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m"
timestampString = "456156517.360693" timestampString = "457003304.570546"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "161" startingLineNumber = "222"
endingLineNumber = "161" endingLineNumber = "222"
landmarkName = "-loadData" landmarkName = "-loadData"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@@ -2521,11 +2521,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m" filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m"
timestampString = "456156474.252497" timestampString = "457003304.570546"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "50" startingLineNumber = "53"
endingLineNumber = "50" endingLineNumber = "53"
landmarkName = "-viewDidLoad" landmarkName = "-viewDidLoad"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@@ -4009,11 +4009,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m" filePath = "Ash_AWord/ViewControllers/My/PersonalInfoViewController.m"
timestampString = "456933821.019339" timestampString = "457003304.570546"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "328" startingLineNumber = "389"
endingLineNumber = "328" endingLineNumber = "389"
landmarkName = "-chatBtnClick:" landmarkName = "-chatBtnClick:"
landmarkType = "5"> landmarkType = "5">
</BreakpointContent> </BreakpointContent>
@@ -4313,7 +4313,7 @@
moduleName = "Ash_AWord" moduleName = "Ash_AWord"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m"
timestampString = "456997731.778097" timestampString = "457003304.958387"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "877" startingLineNumber = "877"
@@ -4328,7 +4328,7 @@
moduleName = "Ash_AWord" moduleName = "Ash_AWord"
usesParentBreakpointCondition = "Yes" usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m"
timestampString = "456997731.778294" timestampString = "457003304.958543"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "877" startingLineNumber = "877"
+4
View File
@@ -37,4 +37,8 @@
//设置登录方式 //设置登录方式
+(void)setLoginType:(NSInteger)loginType; +(void)setLoginType:(NSInteger)loginType;
+(NSInteger)getLoginType; +(NSInteger)getLoginType;
//保存背景图片
+(BOOL)setHeadBgImg:(UIImage *)headBgImg;
+(UIImage*)getHeadBgImg;
@end @end
+13
View File
@@ -79,4 +79,17 @@
{ {
return [[NSUserDefaults standardUserDefaults] integerForKey:@"logintype"]; return [[NSUserDefaults standardUserDefaults] integerForKey:@"logintype"];
} }
+(BOOL)setHeadBgImg:(UIImage *)headBgImg
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"headbg.png"]]; // 保存文件的名称
return [UIImagePNGRepresentation(headBgImg)writeToFile: filePath atomically:YES];
}
+(UIImage*)getHeadBgImg
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"headbg.png"]]; // 保存文件的名称
UIImage *img = [UIImage imageWithContentsOfFile:filePath];
return img;
}
@end @end
+1
View File
@@ -16,6 +16,7 @@
@property (nonatomic, strong) NSString *userAvatar; @property (nonatomic, strong) NSString *userAvatar;
@property (nonatomic, strong) NSString* userGender; @property (nonatomic, strong) NSString* userGender;
@property (nonatomic, assign) NSInteger loginType; //0代表第三方,1代表本地. @property (nonatomic, assign) NSInteger loginType; //0代表第三方,1代表本地.
@property (nonatomic, strong) UIImage* headBgImg;
+(AWordUser*)sharedInstance; +(AWordUser*)sharedInstance;
@end @end
+7
View File
@@ -21,6 +21,7 @@ static AWordUser *sharedObj = nil;
sharedObj.userAvatar = [AWordDefault getUserAvatar]; sharedObj.userAvatar = [AWordDefault getUserAvatar];
sharedObj.userGender = [AWordDefault getUserGender]; sharedObj.userGender = [AWordDefault getUserGender];
sharedObj.loginType = [AWordDefault getLoginType]; sharedObj.loginType = [AWordDefault getLoginType];
sharedObj.headBgImg = [AWordDefault getHeadBgImg];
} }
return sharedObj; return sharedObj;
} }
@@ -57,4 +58,10 @@ static AWordUser *sharedObj = nil;
_userAvatar = userAvatar; _userAvatar = userAvatar;
[AWordDefault setUserAvatar:userAvatar]; [AWordDefault setUserAvatar:userAvatar];
} }
-(void)setHeadBgImg:(UIImage *)headBgImg
{
_headBgImg = headBgImg;
[AWordDefault setHeadBgImg:headBgImg];
}
@end @end
@@ -18,6 +18,7 @@
#import "MyMessageTableViewCell.h" #import "MyMessageTableViewCell.h"
#import "MainViewController.h" #import "MainViewController.h"
#import "AppDelegate.h" #import "AppDelegate.h"
#import "PersonalInfoViewController.h"
@interface MyViewController () @interface MyViewController ()
{ {
NSArray* cellTitleArr; NSArray* cellTitleArr;
@@ -154,9 +155,14 @@
}else{ }else{
if([AWordUser sharedInstance].loginType == 1) if([AWordUser sharedInstance].loginType == 1)
{ {
SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init]; // SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init];
setUserInfoViewController.hidesBottomBarWhenPushed = YES; // setUserInfoViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:setUserInfoViewController animated:YES]; // [self.navigationController pushViewController:setUserInfoViewController animated:YES];
PersonalInfoViewController* personalInfoViewController = [[PersonalInfoViewController alloc] init];
personalInfoViewController.hidesBottomBarWhenPushed = YES;
personalInfoViewController.otherUserId = [AWordUser sharedInstance].uid;
[[AppDelegate visibleViewController].navigationController pushViewController:personalInfoViewController animated:YES];
} }
} }
@@ -15,7 +15,7 @@
#import "MessageViewModel.h" #import "MessageViewModel.h"
#import "UserViewModel.h" #import "UserViewModel.h"
#import "ChatMainViewController.h" #import "ChatMainViewController.h"
@interface PersonalInfoViewController ()<NoteTableViewCellDelegate,MessageTableViewCellDelegate> @interface PersonalInfoViewController ()<NoteTableViewCellDelegate,MessageTableViewCellDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UIActionSheetDelegate>
{ {
CExpandHeader *_header; CExpandHeader *_header;
PersonalTopView* _personalTopView; PersonalTopView* _personalTopView;
@@ -43,10 +43,13 @@
self.navigationItem.title = @"个人主页"; self.navigationItem.title = @"个人主页";
if ([AWordUser sharedInstance].headBgImg) {
_topViewImage.image = [AWordUser sharedInstance].headBgImg;
}
_imageArr = [[NSMutableArray alloc] init]; _imageArr = [[NSMutableArray alloc] init];
_voiceArr = [[NSMutableArray alloc] init]; _voiceArr = [[NSMutableArray alloc] init];
NSLog(@"%@",[AWordUser sharedInstance].uid);
if ([_otherUserId isEqualToString:[AWordUser sharedInstance].uid]) { if ([_otherUserId isEqualToString:[AWordUser sharedInstance].uid]) {
_bottomView.hidden = YES; _bottomView.hidden = YES;
@@ -66,6 +69,7 @@
__weak PersonalInfoViewController *weakself = self; __weak PersonalInfoViewController *weakself = self;
[_personalTopView setuserInfoViewModel:_userViewModel]; [_personalTopView setuserInfoViewModel:_userViewModel];
[_personalTopView.headBtn addTarget:self action:@selector(selectHeadImage:) forControlEvents:UIControlEventTouchUpInside];
[_personalTopView setIsSelectImg:^(BOOL isSelectImg){ [_personalTopView setIsSelectImg:^(BOOL isSelectImg){
_isSelectImage = isSelectImg; _isSelectImage = isSelectImg;
if (isSelectImg) { if (isSelectImg) {
@@ -82,10 +86,67 @@
} }
} }
}]; }];
// [self.tableView beginUpdates]; // [self.tableView beginUpdates];
self.tableView.tableHeaderView = _personalTopView; self.tableView.tableHeaderView = _personalTopView;
// [self.tableView endUpdates]; // [self.tableView endUpdates];
} }
#pragma mark 替换头图
-(void)selectHeadImage:(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];
}
}
-(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:@"UIImagePickerControllerEditedImage"];
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];
// _avatarImage = image;
// _avatarImageView.image = _avatarImage;
_topViewImage.image = image;
[[AWordUser sharedInstance] setHeadBgImg:image];
}
#pragma mark MJRefreshDelegate #pragma mark MJRefreshDelegate
-(void)headerRereshing -(void)headerRereshing
{ {
+2 -1
View File
@@ -8,7 +8,6 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
typedef void (^IsSelectImage)(BOOL); typedef void (^IsSelectImage)(BOOL);
@class UserViewModel; @class UserViewModel;
@interface PersonalTopView : UIView @interface PersonalTopView : UIView
@property (strong, nonatomic)IsSelectImage isSelectImg; @property (strong, nonatomic)IsSelectImage isSelectImg;
@@ -33,6 +32,8 @@ typedef void (^IsSelectImage)(BOOL);
@property (weak, nonatomic) IBOutlet UIView *selectView; @property (weak, nonatomic) IBOutlet UIView *selectView;
@property (weak, nonatomic) IBOutlet UIButton *attentionBtn; @property (weak, nonatomic) IBOutlet UIButton *attentionBtn;
- (IBAction)attentionBtnClick:(id)sender; - (IBAction)attentionBtnClick:(id)sender;
@property (weak, nonatomic) IBOutlet UIButton *headBtn;
- (IBAction)headBtnClick:(id)sender;
-(void)setuserInfoViewModel:(UserViewModel*)userViewModel; -(void)setuserInfoViewModel:(UserViewModel*)userViewModel;
@end @end
+4
View File
@@ -154,4 +154,8 @@
}]; }];
} }
- (IBAction)headBtnClick:(id)sender {
}
@end @end
+12
View File
@@ -215,13 +215,24 @@
<constraint firstItem="5o9-fJ-VTY" firstAttribute="leading" secondItem="WX9-rs-4F1" secondAttribute="leading" constant="10" id="psm-pO-aXr"/> <constraint firstItem="5o9-fJ-VTY" firstAttribute="leading" secondItem="WX9-rs-4F1" secondAttribute="leading" constant="10" id="psm-pO-aXr"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bla-xA-hHn">
<rect key="frame" x="0.0" y="0.0" width="320" height="146"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstAttribute="bottom" secondItem="WX9-rs-4F1" secondAttribute="bottom" id="EHp-jo-kyp"/> <constraint firstAttribute="bottom" secondItem="WX9-rs-4F1" secondAttribute="bottom" id="EHp-jo-kyp"/>
<constraint firstItem="bla-xA-hHn" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Syn-Oj-cR0"/>
<constraint firstItem="bla-xA-hHn" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="VCd-F5-BRl"/>
<constraint firstItem="WX9-rs-4F1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="109" id="fdX-7l-8fh"/> <constraint firstItem="WX9-rs-4F1" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="109" id="fdX-7l-8fh"/>
<constraint firstAttribute="bottom" secondItem="WX9-rs-4F1" secondAttribute="bottom" id="gtr-tG-96M"/> <constraint firstAttribute="bottom" secondItem="WX9-rs-4F1" secondAttribute="bottom" id="gtr-tG-96M"/>
<constraint firstAttribute="trailing" secondItem="bla-xA-hHn" secondAttribute="trailing" id="mD5-ut-f3G"/>
<constraint firstItem="WX9-rs-4F1" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="nQ3-aZ-41G"/> <constraint firstItem="WX9-rs-4F1" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="nQ3-aZ-41G"/>
<constraint firstItem="WX9-rs-4F1" firstAttribute="top" secondItem="bla-xA-hHn" secondAttribute="bottom" id="uEZ-fY-OE0"/>
<constraint firstAttribute="trailing" secondItem="WX9-rs-4F1" secondAttribute="trailing" id="zvw-PO-jv1"/> <constraint firstAttribute="trailing" secondItem="WX9-rs-4F1" secondAttribute="trailing" id="zvw-PO-jv1"/>
</constraints> </constraints>
<nil key="simulatedStatusBarMetrics"/> <nil key="simulatedStatusBarMetrics"/>
@@ -240,6 +251,7 @@
<outlet property="attentionCountLabel" destination="aTY-fs-6Kn" id="EWv-uA-ptu"/> <outlet property="attentionCountLabel" destination="aTY-fs-6Kn" id="EWv-uA-ptu"/>
<outlet property="avatarBtn" destination="5o9-fJ-VTY" id="Bfn-tL-ki0"/> <outlet property="avatarBtn" destination="5o9-fJ-VTY" id="Bfn-tL-ki0"/>
<outlet property="fansCountLabel" destination="dV9-mk-6So" id="nVx-CR-WIf"/> <outlet property="fansCountLabel" destination="dV9-mk-6So" id="nVx-CR-WIf"/>
<outlet property="headBtn" destination="bla-xA-hHn" id="vNS-IO-6v3"/>
<outlet property="imageBtn" destination="bSw-ar-jAL" id="gXt-L0-dkx"/> <outlet property="imageBtn" destination="bSw-ar-jAL" id="gXt-L0-dkx"/>
<outlet property="line1" destination="sml-su-cYb" id="dQy-oU-Ans"/> <outlet property="line1" destination="sml-su-cYb" id="dQy-oU-Ans"/>
<outlet property="line1Width" destination="iis-R5-w9v" id="iZx-cd-KgH"/> <outlet property="line1Width" destination="iis-R5-w9v" id="iZx-cd-KgH"/>