This commit is contained in:
wu736139669
2015-06-27 11:11:41 +08:00
parent b720c1ff25
commit 7e7c699536
42 changed files with 871 additions and 324 deletions
+14
View File
@@ -233,6 +233,9 @@
A97CCE2A1B3BE6440046FE17 /* MessageListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97CCE281B3BE6440046FE17 /* MessageListViewController.xib */; };
A97CCE2E1B3BEBDA0046FE17 /* MessageListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A97CCE2C1B3BEBDA0046FE17 /* MessageListTableViewCell.m */; };
A97CCE2F1B3BEBDA0046FE17 /* MessageListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97CCE2D1B3BEBDA0046FE17 /* MessageListTableViewCell.xib */; };
A97D70F21B3E3BAB0070BE84 /* acitvity_center_new@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A97D70F11B3E3BAB0070BE84 /* acitvity_center_new@2x.png */; };
A97D70F61B3E40520070BE84 /* MyRelateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A97D70F41B3E40520070BE84 /* MyRelateViewController.m */; };
A97D70F71B3E40520070BE84 /* MyRelateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97D70F51B3E40520070BE84 /* MyRelateViewController.xib */; };
A97DBE331ACAE10800705682 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A97DBE311ACAE10800705682 /* LoginViewController.m */; };
A97DBE341ACAE10800705682 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE321ACAE10800705682 /* LoginViewController.xib */; };
A97DBE3F1ACAE29E00705682 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE391ACAE29E00705682 /* Icon.png */; };
@@ -831,6 +834,10 @@
A97CCE2B1B3BEBDA0046FE17 /* MessageListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageListTableViewCell.h; sourceTree = "<group>"; };
A97CCE2C1B3BEBDA0046FE17 /* MessageListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageListTableViewCell.m; sourceTree = "<group>"; };
A97CCE2D1B3BEBDA0046FE17 /* MessageListTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageListTableViewCell.xib; sourceTree = "<group>"; };
A97D70F11B3E3BAB0070BE84 /* acitvity_center_new@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "acitvity_center_new@2x.png"; sourceTree = "<group>"; };
A97D70F31B3E40520070BE84 /* MyRelateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyRelateViewController.h; sourceTree = "<group>"; };
A97D70F41B3E40520070BE84 /* MyRelateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyRelateViewController.m; sourceTree = "<group>"; };
A97D70F51B3E40520070BE84 /* MyRelateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyRelateViewController.xib; sourceTree = "<group>"; };
A97DBE301ACAE10800705682 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
A97DBE311ACAE10800705682 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
A97DBE321ACAE10800705682 /* LoginViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = "<group>"; };
@@ -1220,6 +1227,9 @@
A97CCE261B3BE6440046FE17 /* MessageListViewController.h */,
A97CCE271B3BE6440046FE17 /* MessageListViewController.m */,
A97CCE281B3BE6440046FE17 /* MessageListViewController.xib */,
A97D70F31B3E40520070BE84 /* MyRelateViewController.h */,
A97D70F41B3E40520070BE84 /* MyRelateViewController.m */,
A97D70F51B3E40520070BE84 /* MyRelateViewController.xib */,
);
path = My;
sourceTree = "<group>";
@@ -1922,6 +1932,7 @@
children = (
A9C58DAE1B3AA8EC0007FCDC /* audio */,
A9F7F4581B33B51F00317F3E /* back@2x.png */,
A97D70F11B3E3BAB0070BE84 /* acitvity_center_new@2x.png */,
A971EDF61B32B7C40023740E /* chatBar_colorMore_audioCall@2x.png */,
A971EDF71B32B7C40023740E /* chatBar_colorMore_audioCallSelected@2x.png */,
A971EDF81B32B7C40023740E /* chatBar_colorMore_camera@2x.png */,
@@ -2588,6 +2599,7 @@
A9C58E091B3AA8EC0007FCDC /* VoiceSearchFeedback018.png in Resources */,
A971EE041B32B7C40023740E /* chatBar_colorMore_camera@2x.png in Resources */,
A94691CD1B26EACE00B5D26B /* PersonalInfoViewController.xib in Resources */,
A97D70F71B3E40520070BE84 /* MyRelateViewController.xib in Resources */,
A96862421ACCF0B400DDAA6B /* LICENCE.txt in Resources */,
A985367D1AEB8F89000312BF /* RegistInfoViewController.xib in Resources */,
A978CB2D1B3A3D5A00028C4A /* chat_sender_audio_playing_full@2x.png in Resources */,
@@ -2679,6 +2691,7 @@
A98536781AEB7400000312BF /* RegistAccountViewController.xib in Resources */,
A971EDF01B32B7AF0023740E /* chatBar_more_camera@2x.png in Resources */,
A97559CE1ACBF0BC004ADA42 /* btn_good_clicked@2x.png in Resources */,
A97D70F21B3E3BAB0070BE84 /* acitvity_center_new@2x.png in Resources */,
A9B6DFE61B2033A80003C1BC /* toolbar_light_comment@2x.png in Resources */,
A97883881AD369DF00D46477 /* mainCellDingClick@2x.png in Resources */,
A90BA0211AD606B400728393 /* voice-record-level@2x.png in Resources */,
@@ -2938,6 +2951,7 @@
A97CCE291B3BE6440046FE17 /* MessageListViewController.m in Sources */,
A9FD82BC1B1D544300AC4DC9 /* CommentTableViewCell.m in Sources */,
A9B6DFCC1B1FFDB20003C1BC /* CommentTextView.m in Sources */,
A97D70F61B3E40520070BE84 /* MyRelateViewController.m in Sources */,
A96F27EE1B2195BA00DA0A66 /* UIImageView+Reloading.m in Sources */,
A9B4A9541AEDC3620017C655 /* FeedbackViewController.m in Sources */,
);
+3
View File
@@ -38,6 +38,9 @@
+(void)setLoginType:(NSInteger)loginType;
+(NSInteger)getLoginType;
//设置个性签名
+(void)setSignature:(NSString*)sinagure;
+(NSString*)getSignature;
//保存背景图片
+(BOOL)setHeadBgImg:(UIImage *)headBgImg;
+(UIImage*)getHeadBgImg;
+11
View File
@@ -79,6 +79,17 @@
{
return [[NSUserDefaults standardUserDefaults] integerForKey:@"logintype"];
}
+(void)setSignature:(NSString *)sinagure
{
[[NSUserDefaults standardUserDefaults] setObject:sinagure forKey:@"sinagure"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+(NSString*)getSignature
{
return [[NSUserDefaults standardUserDefaults] stringForKey:@"sinagure"];
}
+(BOOL)setHeadBgImg:(UIImage *)headBgImg
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
+3
View File
@@ -17,6 +17,9 @@
@property (nonatomic, strong) NSString* userGender;
@property (nonatomic, assign) NSInteger loginType; //0代表第三方,1代表本地.
@property (nonatomic, strong) UIImage* headBgImg;
@property (nonatomic, strong) NSString* signature;
@property (nonatomic, assign)NSInteger myNewFollowerCount;
@property (nonatomic, assign)NSInteger notReadCommentNum;
+(AWordUser*)sharedInstance;
@end
+8 -1
View File
@@ -22,6 +22,9 @@ static AWordUser *sharedObj = nil;
sharedObj.userGender = [AWordDefault getUserGender];
sharedObj.loginType = [AWordDefault getLoginType];
sharedObj.headBgImg = [AWordDefault getHeadBgImg];
sharedObj.signature = [AWordDefault getSignature];
sharedObj.notReadCommentNum = 0;
sharedObj.myNewFollowerCount = 0;
}
return sharedObj;
}
@@ -63,5 +66,9 @@ static AWordUser *sharedObj = nil;
_headBgImg = headBgImg;
[AWordDefault setHeadBgImg:headBgImg];
}
-(void)setSignature:(NSString *)signature
{
_signature = signature;
[AWordDefault setSignature:signature];
}
@end
+1
View File
@@ -72,6 +72,7 @@
#define Ash_AWord_API_URL @"http://121.43.150.13/QuestionServer/rs/yjn/post"
#define Ash_AWord_First_URL @"http://121.43.150.13"
#define Ash_AWord_Share_URL @"http://121.43.150.13/QuestionServer/web"
#define Ash_Aword_Base_URL @"http://121.43.150.13/QuestionServer"
//#define Ash_AWord_API_URL @"http://192.168.1.3:8080/QuestionServer"
#define Sign_Key @"yjn@jjyy123"
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -17,6 +17,8 @@ typedef enum {
@property (nonatomic, readonly) NSNumber* errCode;
@property (nonatomic, readonly) NSString *errMessage;
@property (nonatomic, readonly) NSInteger notReadCommentNum;//用户发表的所有记录的未读评论总数(每个接口都会返回该项)
@property (nonatomic, readonly) NSInteger myNewFollowerCount;//用户上一次加载关注自己的用户列表之后新关注自己的用户数(每个接口都会返回该项)
- (BOOL)success;
@@ -13,6 +13,8 @@
return @{
@"errCode": @"ret",
@"errMessage": @"msg",
@"notReadCommentNum": @"notReadCommentNum",
@"myNewFollowerCount": @"myNewFollowerCount",
};
}
@@ -21,6 +23,8 @@
self = [super initWithDictionary:dictionaryValue error:error];
if (self != nil)
{
[AWordUser sharedInstance].notReadCommentNum = _notReadCommentNum;
[AWordUser sharedInstance].myNewFollowerCount = _myNewFollowerCount;
}
return self;
}
+1 -1
View File
@@ -512,7 +512,7 @@
+ (UIColor *)appMainColorAlpha:(CGFloat)alpha
{
return [UIColor colorWithHexString:@"#68d430" alpha:1];
return [UIColor colorWithHexString:@"#61BFA9" alpha:1];
}
+ (UIColor *)appNavBackgroundColor
@@ -45,7 +45,6 @@
{
if(call.callState == CTCallStateIncoming)
{
NSLog(@"Call is incoming");
[_timeTimer invalidate];
[self _stopRing];
@@ -503,7 +502,6 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
if (callSession.status == eCallSessionStatusDisconnected) {
[self _stopRing];
NSLog(@"callSession.status == eCallSessionStatusDisconnected");
_statusLabel.text = @"通话已挂断";
NSString *str = @"通话结束";
if(_timeLength == 0)
@@ -199,7 +199,8 @@
completion:^(NSError *error)
{
if (error) {
NSLog(NSLocalizedString(@"message.startRecordFail", @"failure to start recording"));
// DLog(NSLocalizedString(@"message.startRecordFail", @"failure to start recording"));
}
}];
}
@@ -256,7 +257,7 @@
NSError *error = nil;
[fileman removeItemAtURL:videoURL error:&error];
if (error) {
NSLog(@"failed to remove file, error:%@.", error);
DLog(@"failed to remove file, error:%@.", error);
}
}
EMChatVideo *chatVideo = [[EMChatVideo alloc] initWithFile:[mp4 relativePath] displayName:@"video.mp4"];
@@ -393,16 +394,16 @@
[exportSession exportAsynchronouslyWithCompletionHandler:^{
switch ([exportSession status]) {
case AVAssetExportSessionStatusFailed: {
NSLog(@"failed, error:%@.", exportSession.error);
DLog(@"failed, error:%@.", exportSession.error);
} break;
case AVAssetExportSessionStatusCancelled: {
NSLog(@"cancelled.");
DLog(@"cancelled.");
} break;
case AVAssetExportSessionStatusCompleted: {
NSLog(@"completed.");
DLog(@"completed.");
} break;
default: {
NSLog(@"others.");
DLog(@"others.");
} break;
}
dispatch_semaphore_signal(wait);
@@ -1128,7 +1129,7 @@
}
else
{
NSLog(@"Read %@ failed!", localPath);
DLog(@"Read %@ failed!", localPath);
}
return ;
}
@@ -1153,7 +1154,7 @@
}
else
{
NSLog(@"Read %@ failed!", localPath);
DLog(@"Read %@ failed!", localPath);
}
return ;
}
@@ -93,9 +93,7 @@
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToSina];
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
[[UMSocialDataService defaultDataService] requestSnsInformation:UMShareToSina completion:^(UMSocialResponseEntity *response){
NSLog(@"SnsInformation is %@",response.data);
if (response.data) {
NSString* gender = @"";
if ([[response.data objectForKey:@"gender"] integerValue]==0) {
@@ -102,7 +102,7 @@
<constraint firstAttribute="width" constant="46" id="zHz-0E-PK4"/>
</constraints>
<state key="normal" title="登录">
<color key="titleColor" red="0.3803921569" green="0.74901960779999999" blue="0.66274509800000003" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleColor" red="0.38039215686274508" green="0.74901960784313726" blue="0.66274509803921566" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
@@ -262,7 +262,6 @@ static NSString *kMessageType = @"MessageType";
if (timeInterval < kDefaultPlaySoundInterval) {
//如果距离上次响铃和震动时间太短, 则跳过响铃
NSLog(@"skip ringing & vibration %@, %@", [NSDate date], self.lastPlaySoundDate);
return;
}
@@ -163,7 +163,6 @@
[self.tableView reloadData];
} failedBlock:^(NSError *error) {
// _page--;
[MBProgressHUD errorHudWithView:self.view label:kNetworkErrorTips hidesAfter:1.0];
[self footerEndRefreshing];
[self headerEndRefreshing];
@@ -19,6 +19,8 @@
#import "MainViewController.h"
#import "AppDelegate.h"
#import "PersonalInfoViewController.h"
#import "PraiseUserListViewController.h"
#import "MyRelateViewController.h"
@interface MyViewController ()
{
NSArray* cellTitleArr;
@@ -76,11 +78,11 @@
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 3;
return 5;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 1) {
if (section == 2 || section == 3) {
return 2;
}
return 1;
@@ -88,12 +90,12 @@
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* cellIdentifier = @"cell";
if (indexPath.section == 2) {
if (indexPath.section == 4 || (indexPath.section==2&&indexPath.row==1) || indexPath.section==1) {
cellIdentifier = @"MyMessageTableViewCell";
}
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
if (indexPath.section == 2) {
if (indexPath.section == 4 || (indexPath.section==1&&indexPath.row==1) || indexPath.section==1) {
UINib* nib = nil;
nib = [UINib nibWithNibName:cellIdentifier bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
@@ -105,6 +107,8 @@
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
switch (indexPath.section) {
case 0:
{
@@ -122,6 +126,25 @@
}
break;
case 1:
{
cell.textLabel.text = @"与我相关";
[(MyMessageTableViewCell*)cell setUnReadColor:[UIColor appMainColor]];
[(MyMessageTableViewCell*)cell setUnReadCount:[AWordUser sharedInstance].notReadCommentNum];
}
break;
case 2:
{
if (indexPath.row == 0 ) {
cell.textLabel.text = @"我的关注";
}
if (indexPath.row == 1) {
cell.textLabel.text = @"我的粉丝";
[(MyMessageTableViewCell*)cell setUnReadColor:[UIColor appMainColor]];
[(MyMessageTableViewCell*)cell setUnReadCount:[AWordUser sharedInstance].myNewFollowerCount];
}
}
break;
case 3:
{
if (indexPath.row == 0 ) {
cell.textLabel.text = @"我发表的图片";
@@ -131,11 +154,13 @@
}
}
break;
case 2:
case 4:
{
cell.textLabel.text = @"消息";
NSInteger count = [((AppDelegate*)[UIApplication sharedApplication].delegate).mainViewController setupUnreadMessageCount];
[(MyMessageTableViewCell*)cell setUnReadColor:[UIColor redColor]];
[(MyMessageTableViewCell*)cell setUnReadCount:count];
}
break;
default:
@@ -155,14 +180,11 @@
}else{
if([AWordUser sharedInstance].loginType == 1)
{
// SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init];
// setUserInfoViewController.hidesBottomBarWhenPushed = 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];
[self.navigationController pushViewController:personalInfoViewController animated:YES];
}
}
@@ -170,6 +192,35 @@
}
break;
case 1:
{
MyRelateViewController* myRelateViewController = [[MyRelateViewController alloc] init];
myRelateViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:myRelateViewController animated:YES];
}
break;
case 2:
{
if (![AWordUser sharedInstance].isLogin)
{
[LoginViewController presentLoginViewControllerInView:self success:nil];
}else
{
PraiseUserListViewController* praiseUserListViewController = [[PraiseUserListViewController alloc] init];
praiseUserListViewController.targetId = [AWordUser sharedInstance].uid;
praiseUserListViewController.userListType = UserList_Fans_Type;
praiseUserListViewController.hidesBottomBarWhenPushed = YES;
if (indexPath.row == 0) {
praiseUserListViewController.userListType = UserList_Attention_Type;
}else{
praiseUserListViewController.userListType = UserList_Fans_Type;
}
[self.navigationController pushViewController:praiseUserListViewController animated:YES];
}
}
break;
case 3:
{
if (![AWordUser sharedInstance].isLogin)
{
@@ -189,7 +240,7 @@
}
break;
case 2:
case 4:
{
MessageListViewController* messageListViewController = [[MessageListViewController alloc] init];
messageListViewController.hidesBottomBarWhenPushed = YES;
@@ -219,6 +219,7 @@
cell.commentType = Voice_Type;
CommentInfoViewModel* commentInfoViewModel = [_commentInfoArr objectAtIndex:indexPath.row];
commentInfoViewModel.status = 1;
cell.ownerId = _text_Voice.ownerId;
[cell setCommentWithUid:^(NSString* ownerId){
[_commentTextView showWithUid:ownerId];
@@ -153,8 +153,10 @@
AVAudioSession * session = [AVAudioSession sharedInstance];
NSError * sessionError;
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:&sessionError];
if(session == nil)
NSLog(@"Error creating session: %@", [sessionError description]);
if(session == nil){
DLog(@"Error creating session: %@", [sessionError description]);
}
else
[session setActive:YES error:nil];
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyMessageViewController">
@@ -16,9 +16,9 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="JAL-oF-Xht">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="JAL-oF-Xht">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyNoteViewController">
@@ -16,9 +16,9 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="Olt-dV-VMy">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="Olt-dV-VMy">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
@@ -0,0 +1,14 @@
//
// MyRelateViewController.h
// Ash_AWord
//
// Created by xmfish on 15/6/27.
// Copyright (c) 2015年 ash. All rights reserved.
//
#import "BaseRefreshViewController.h"
@interface MyRelateViewController : BaseRefreshViewController
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end
@@ -0,0 +1,170 @@
//
// MyRelateViewController.m
// Ash_AWord
//
// Created by xmfish on 15/6/27.
// Copyright (c) 2015年 ash. All rights reserved.
//
#import "MyRelateViewController.h"
#import "CommentTableViewCell.h"
#import "CommentViewModel.h"
#import "NoteCommentViewController.h"
#import "MessageCommentViewController.h"
@interface MyRelateViewController ()
{
NSMutableArray* _commentInfoArr;
NSInteger _page;
}
@end
@implementation MyRelateViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
_page = 1;
_commentInfoArr = [[NSMutableArray alloc] init];
[self customViewDidLoad];
self.navigationItem.title = @"与我相关";
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"已读" style:UIBarButtonItemStyleDone target:self action:@selector(readAll)];
[self headerBeginRefreshing];
}
#pragma mark 标记已读
-(void)readAll
{
}
#pragma mark MJRefreshDelegate
-(void)headerRereshing
{
_page=1;
[self loadData];
}
-(void)footerRereshing
{
[self loadData];
}
-(void)loadData
{
[MobClick event:kUmen_note];
PropertyEntity* pro = [CommentViewModel requireLoadMyCommentWithPage:_page withPage_size:DefaultPageSize];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
if ([viewModel success]) {
CommentViewModel* commentViewModel = (CommentViewModel*)viewModel;
if (_page <= 1) {
[_commentInfoArr removeAllObjects];
}
if (commentViewModel.commentInfoArr) {
[_commentInfoArr addObjectsFromArray:commentViewModel.commentInfoArr];
}
[self footerEndRefreshing];
[self headerEndRefreshing];
if (commentViewModel.commentInfoArr.count<DefaultPageSize) {
[self.tableView removeFooter];
}else{
[self.tableView addGifFooterWithRefreshingTarget:self refreshingAction:@selector(footerRereshing)];
}
_page++;
}else
{
[MBProgressHUD errorHudWithView:self.view label:[viewModel errMessage] hidesAfter:1.0];
}
[self.tableView reloadData];
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:kNetworkErrorTips hidesAfter:1.0];
[self footerEndRefreshing];
[self headerEndRefreshing];
}];
}
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _commentInfoArr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CommentInfoViewModel* commentInfoViewModel = [_commentInfoArr objectAtIndex:indexPath.row];
return [CommentTableViewCell getHeightWithCommentInfoViewModel:commentInfoViewModel isReplyOwner:NO];
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 5.0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.01;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* cellIdentifier = [NSString stringWithFormat:@"cellIdentifier%ld",(long)indexPath.section];
CommentTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
UINib* nib = nil;
nib = [UINib nibWithNibName:@"CommentTableViewCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
}
CommentInfoViewModel* commentInfoViewModel = [_commentInfoArr objectAtIndex:indexPath.row];
cell.isAllowReport = NO;
[cell setCommentWithUid:^(NSString* uid){
[self tableView:tableView didSelectRowAtIndexPath:indexPath];
}];
[cell setCommentInfoViewModel:commentInfoViewModel];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
CommentInfoViewModel* commentInfoViewModel = [_commentInfoArr objectAtIndex:indexPath.row];
if (commentInfoViewModel.commentType == Image_Type) {
NoteCommentViewController* noteCommentViewController = [[NoteCommentViewController alloc] init];
noteCommentViewController.hidesBottomBarWhenPushed = YES;
// noteCommentViewController.text_image = _text_image;
[self.navigationController pushViewController:noteCommentViewController animated:YES];
}else{
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyRelateViewController">
<connections>
<outlet property="tableView" destination="S0H-EM-lPe" id="yFs-Cf-vYh"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="S0H-EM-lPe">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="S0H-EM-lPe" secondAttribute="trailing" id="BCN-bi-BHD"/>
<constraint firstItem="S0H-EM-lPe" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Oe2-1e-YaH"/>
<constraint firstItem="S0H-EM-lPe" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="cqh-d3-xjf"/>
<constraint firstAttribute="bottom" secondItem="S0H-EM-lPe" secondAttribute="bottom" id="hI4-pZ-6ye"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
</objects>
</document>
@@ -15,6 +15,7 @@
#import "MessageViewModel.h"
#import "UserViewModel.h"
#import "ChatMainViewController.h"
#import "SetUserInfoViewController.h"
@interface PersonalInfoViewController ()<NoteTableViewCellDelegate,MessageTableViewCellDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UIActionSheetDelegate>
{
CExpandHeader *_header;
@@ -54,11 +55,14 @@
if ([_otherUserId isEqualToString:[AWordUser sharedInstance].uid]) {
_bottomView.hidden = YES;
_tableBottomHeight.constant = 0.0;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"修改信息" style:UIBarButtonItemStyleDone target:self action:@selector(modifyInfo)];
}
self.tableView.hidden = YES;
[DejalActivityView activityViewForView:self.view withLabel:kLoadingTips];
[self headerRereshing];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(headerRereshing) name:kLoginSuccessNotificationName object:nil];
}
-(void)viewDidAppear:(BOOL)animated
@@ -69,7 +73,9 @@
__weak PersonalInfoViewController *weakself = self;
[_personalTopView setuserInfoViewModel:_userViewModel];
[_personalTopView.headBtn addTarget:self action:@selector(selectHeadImage:) forControlEvents:UIControlEventTouchUpInside];
if ([_otherUserId isEqualToString:[AWordUser sharedInstance].uid]) {
[_personalTopView.headBtn addTarget:self action:@selector(selectHeadImage:) forControlEvents:UIControlEventTouchUpInside];
}
[_personalTopView setIsSelectImg:^(BOOL isSelectImg){
_isSelectImage = isSelectImg;
if (isSelectImg) {
@@ -92,6 +98,14 @@
// [self.tableView endUpdates];
}
#pragma mark 修改个人信息
-(void)modifyInfo
{
SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init];
setUserInfoViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:setUserInfoViewController animated:YES];
}
#pragma mark 替换头图
-(void)selectHeadImage:(id)sender
{
@@ -176,7 +176,7 @@
}
-(void)showUserNotice
{
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/notice.html",Ash_AWord_API_URL]]];
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/notice.html",Ash_Aword_Base_URL]]];
[self.navigationController pushViewController:svWebViewController animated:YES];
}
- (void)goToAppraisal
@@ -188,7 +188,7 @@
#pragma mark 关于
-(void)showAbout
{
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/about.html",Ash_AWord_API_URL]]];
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/about.html",Ash_Aword_Base_URL]]];
[self.navigationController pushViewController:svWebViewController animated:YES];
}
#pragma mark UIAlertViewDelegate
@@ -7,9 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "UIPlaceHolderTextView.h"
@interface SetUserInfoViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *avatarBtn;
@property (weak, nonatomic) IBOutlet UIPlaceHolderTextView *signatureTextView;
@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView;
@property (weak, nonatomic) IBOutlet UITextField *nickNameTextField;
- (IBAction)avatarBtnClick:(id)sender;
@@ -8,7 +8,7 @@
#import "SetUserInfoViewController.h"
#import "LoginViewModel.h"
@interface SetUserInfoViewController ()<UITextFieldDelegate,UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@interface SetUserInfoViewController ()<UITextFieldDelegate,UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UITextViewDelegate>
{
UIImage* _avatarImage;
}
@@ -30,6 +30,22 @@
[_avatarImageView sd_setImageWithURL:[NSURL URLWithString:[AWordUser sharedInstance].userAvatar] placeholderImage:[UIImage imageNamed:@"Icon"]];
_nickNameTextField.text = [AWordUser sharedInstance].userName;
_nickNameTextField.placeholder = [AWordUser sharedInstance].userName;
_nickNameTextField.layer.borderColor = [[UIColor lineColor] CGColor];
_signatureTextView.layer.borderWidth = 0.5;
_signatureTextView.layer.borderColor = [[UIColor lineColor] CGColor];
_signatureTextView.layer.cornerRadius = 5;
_signatureTextView.layer.masksToBounds = YES;
_signatureTextView.font = [UIFont appBoldFontOfSize:14.0];
if ([AWordUser sharedInstance].signature.length > 0) {
_signatureTextView.placeholder = [AWordUser sharedInstance].signature;
}else{
_signatureTextView.placeholder = @"还未填写签名";
}
_signatureTextView.delegate = self;
UITapGestureRecognizer *singleRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)];
singleRecognizer.numberOfTapsRequired = 1;
@@ -42,6 +58,44 @@
{
[self.view endEditing:YES];
}
//开始编辑输入框的时候,软键盘出现,执行此事件
-(void)textViewDidBeginEditing:(UITextView *)textView
{
NSTimeInterval animationDuration = 0.30f;
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:animationDuration];
//将视图的Y坐标向上移动offset个单位,以使下面腾出地方用于软键盘的显示
self.view.frame = CGRectMake(0.0f, -20, self.view.frame.size.width, self.view.frame.size.height);
[UIView commitAnimations];
}
//当用户按下return键或者按回车键,keyboard消失
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if ([text isEqualToString:@"\n"]) {
[textView resignFirstResponder];
}
return YES;
}
//输入框编辑完成以后,将视图恢复到原始状态
-(void)textViewDidEndEditing:(UITextView *)textView
{
NSTimeInterval animationDuration = 0.30f;
[UIView beginAnimations:@"ResizeForKeyboard" context:nil];
[UIView setAnimationDuration:animationDuration];
self.view.frame =CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height);
[UIView commitAnimations];
}
#pragma mark UITextField
//开始编辑输入框的时候,软键盘出现,执行此事件
-(void)textFieldDidBeginEditing:(UITextField *)textField
@@ -130,7 +184,15 @@
-(void)sureModify
{
if ( [_nickNameTextField.text isEqualToString:[AWordUser sharedInstance].userName] && !_avatarImage) {
if (_signatureTextView.text.length > 40) {
[MBProgressHUD errorHudWithView:nil label:@"个性签名要在40字以内" hidesAfter:1.0];
return;
}
if ([_signatureTextView.text isEqualToString:@""] && [AWordUser sharedInstance].signature.length<=0) {
[MBProgressHUD errorHudWithView:nil label:@"没有内容修改" hidesAfter:1.0];
return;
}
if ( [_nickNameTextField.text isEqualToString:[AWordUser sharedInstance].userName] && !_avatarImage && [_signatureTextView.text isEqualToString:[AWordUser sharedInstance].signature]) {
[MBProgressHUD errorHudWithView:nil label:@"没有内容修改" hidesAfter:1.0];
return;
}
@@ -143,7 +205,11 @@
if (nickName.length <= 0 || [_nickNameTextField.text isEqualToString:@""]) {
nickName = _nickNameTextField.placeholder;
}
PropertyEntity* pro = [LoginViewModel requireModifyInfoWithNickName:nickName withGender:@"" withAvatarImg:_avatarImage];
NSString* signature = _signatureTextView.text;
if (signature.length <= 0 || [_signatureTextView.text isEqualToString:@""]) {
signature = _signatureTextView.placeholder;
}
PropertyEntity* pro = [LoginViewModel requireModifyInfoWithNickName:nickName withGender:@"" withAvatarImg:_avatarImage withSignature:signature];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
@@ -152,6 +218,7 @@
[AWordUser sharedInstance].userName = nickName;
[AWordUser sharedInstance].userAvatar = loginViewModel.figureurl;
[AWordUser sharedInstance].userGender = @"";
[AWordUser sharedInstance].signature = signature;
[[NSNotificationCenter defaultCenter] postNotificationName:kLoginSuccessNotificationName object:nil];
[MBProgressHUD checkHudWithView:nil label:@"修改成功" hidesAfter:1.0];
@@ -10,6 +10,7 @@
<outlet property="avatarBtn" destination="6m0-pr-AnS" id="WQE-S9-rxX"/>
<outlet property="avatarImageView" destination="aR4-Ns-KIq" id="NG3-g3-kHm"/>
<outlet property="nickNameTextField" destination="f6E-ZQ-vlM" id="3Cv-wV-iRh"/>
<outlet property="signatureTextView" destination="6FG-FG-PDe" id="LgM-mg-Ucf"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
@@ -60,17 +61,35 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="个性签名" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SMc-rS-TB5">
<rect key="frame" x="20" y="251" width="56" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6FG-FG-PDe" customClass="UIPlaceHolderTextView">
<rect key="frame" x="18" y="276" width="284" height="150"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="MRK-h4-W4a"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="6m0-pr-AnS" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="77" id="0kv-XB-XA2"/>
<constraint firstAttribute="trailing" secondItem="f6E-ZQ-vlM" secondAttribute="trailing" constant="20" id="2hz-ha-lYL"/>
<constraint firstItem="6FG-FG-PDe" firstAttribute="top" secondItem="SMc-rS-TB5" secondAttribute="bottom" constant="8" id="8K8-57-Rcm"/>
<constraint firstItem="6FG-FG-PDe" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="18" id="AUZ-qs-dyL"/>
<constraint firstItem="SMc-rS-TB5" firstAttribute="top" secondItem="f6E-ZQ-vlM" secondAttribute="bottom" constant="15" id="FHI-9O-iiZ"/>
<constraint firstAttribute="centerX" secondItem="6m0-pr-AnS" secondAttribute="centerX" id="HwA-53-ec4"/>
<constraint firstAttribute="centerX" secondItem="aR4-Ns-KIq" secondAttribute="centerX" id="Jrg-i8-VWm"/>
<constraint firstItem="f6E-ZQ-vlM" firstAttribute="top" secondItem="SWc-2U-wd0" secondAttribute="bottom" constant="8" id="LxR-Ea-KqA"/>
<constraint firstAttribute="trailing" secondItem="6FG-FG-PDe" secondAttribute="trailing" constant="18" id="Nth-Br-MGO"/>
<constraint firstItem="f6E-ZQ-vlM" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="20" id="SBz-no-mEa"/>
<constraint firstItem="aR4-Ns-KIq" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="82" id="XUg-iU-e6l"/>
<constraint firstItem="SWc-2U-wd0" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="177" id="pJm-yH-V3p"/>
<constraint firstItem="SMc-rS-TB5" firstAttribute="leading" secondItem="SWc-2U-wd0" secondAttribute="leading" id="wOP-QM-jVp"/>
<constraint firstItem="SWc-2U-wd0" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="20" id="zb7-x6-5J5"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
@@ -28,7 +28,6 @@
self.navigationItem.title = @"关注";
}else if(_userListType == UserList_Fans_Type){
self.navigationItem.title = @"粉丝";
}
self.tableView.delegate = self;
self.tableView.dataSource = self;
@@ -17,6 +17,7 @@
@property (nonatomic, strong) NSString *createTime;
@property (nonatomic, strong) NSString *toUserId;
@property (nonatomic, strong) NSString *toUserName;
@property (nonatomic, assign) NSInteger status;//状态。0:未读,1:已读
@property (nonatomic, assign) CommentType commentType;
@end
@interface CommentViewModel : BaseViewModel
@@ -27,4 +28,6 @@
+(PropertyEntity*)requireDelCommentWithCommentId:(NSInteger)commentId;
+(PropertyEntity*)requireLoadCommentWithRecordId:(NSInteger)recordId withPage:(NSInteger)page withPage_size:(NSInteger)page_size WithType:(CommentType)commentType;
+(PropertyEntity*)requireLoadMyCommentWithPage:(NSInteger)page withPage_size:(NSInteger)page_size;
@end
@@ -20,6 +20,7 @@
@"commentType": @"type",
@"toUserId":@"toUserId",
@"toUserName":@"toUserName",
@"status" : @"status",
};
}
@end
@@ -83,4 +84,17 @@
};
return pro;
}
+(PropertyEntity*)requireLoadMyCommentWithPage:(NSInteger)page withPage_size:(NSInteger)page_size
{
PropertyEntity *pro = [[PropertyEntity alloc] init];
pro.requireType = HTTPRequestTypeWithPOSTDATA;
pro.responesOBJ = self.class;
NSDictionary* dic = @{@"page": [NSString stringWithFormat:@"%ld",page],
@"pageSize": [NSString stringWithFormat:@"%ld",page_size],
};
pro.pro = @{@"root": dic,
@"command": @"10204",
};
return pro;
}
@end
@@ -19,6 +19,7 @@
@property (nonatomic, strong) NSString *signature;
@property (nonatomic, assign) NSInteger followCount;
@property (nonatomic, assign) NSInteger followerCount;
@property (nonatomic, assign) BOOL isNew;
@end
+4 -1
View File
@@ -19,6 +19,9 @@ typedef enum {
@property (nonatomic, strong) NSString* uId; //用户id。
@property (nonatomic, strong) NSString* figureurl;
@property (nonatomic, strong) NSString* userName;
@property (nonatomic, strong) NSString* gender;
@property (nonatomic, strong) NSString* signature;
+ (PropertyEntity *)requireLoginWithOpenId:(NSString*)openId withName:(NSString*)name withGender:(NSString*)gender withFigureUrl:(NSString*)figureUrl;
@@ -32,7 +35,7 @@ typedef enum {
+(PropertyEntity*)requireModifyPassWord:(NSString*)newPassword withOldPaaaWord:(NSString*)oldPassWord;
//修改信息
+(PropertyEntity*)requireModifyInfoWithNickName:(NSString*)nickName withGender:(NSString*)gender withAvatarImg:(UIImage*)avatarImg;
+(PropertyEntity*)requireModifyInfoWithNickName:(NSString*)nickName withGender:(NSString*)gender withAvatarImg:(UIImage*)avatarImg withSignature:(NSString*)signature;
//举报
+(PropertyEntity*)requireReportWith:(Msg_Type)type withMsgId:(NSInteger)msgId withContent:(NSString*)content ;
+5 -2
View File
@@ -15,6 +15,8 @@
[dic setObject:@"uid" forKey:@"uId"];
[dic setObject:@"figureurl" forKey:@"figureurl"];
[dic setObject:@"name" forKey:@"userName"];
[dic setObject:@"signature" forKey:@"signature"];
[dic setObject:@"gender" forKey:@"gender"];
return dic;
}
@@ -94,7 +96,7 @@
return pro;
}
+(PropertyEntity*)requireModifyInfoWithNickName:(NSString *)nickName withGender:(NSString *)gender withAvatarImg:(UIImage *)avatarImg
+(PropertyEntity*)requireModifyInfoWithNickName:(NSString *)nickName withGender:(NSString *)gender withAvatarImg:(UIImage *)avatarImg withSignature:(NSString *)signature
{
PropertyEntity *pro = [[PropertyEntity alloc] init];
pro.requireType = HTTPRequestTypeWithPOSTDATA;
@@ -107,7 +109,8 @@
pro.pFile = file;
NSDictionary* dic = @{@"gender": gender,
@"name": nickName
@"name": nickName,
@"signature": signature,
};
pro.pro = @{@"root": dic,
@"command": @"10006",};
@@ -17,11 +17,14 @@ typedef void (^DelCommentSuccess)(void);
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *floorLabel;
@property (weak, nonatomic) IBOutlet UILabel *isNewLabel;
@property (weak, nonatomic) IBOutlet DTAttributedTextView *contentTextView;
@property (strong, nonatomic)NSString* ownerId;
@property (weak, nonatomic) IBOutlet UIImageView *isNewView;
@property (strong, nonatomic)CommentWithUid commentWithUid;
@property (strong, nonatomic)DelCommentSuccess delCommentSuccess;
@property (assign,nonatomic)BOOL isAllowReport;
@property (assign, nonatomic)CommentType commentType;
- (IBAction)avatarBtnClick:(id)sender;
-(void)setCommentInfoViewModel:(CommentInfoViewModel*)commentInfoViewModel;
+17 -6
View File
@@ -25,6 +25,11 @@
_floorLabel.layer.masksToBounds = YES;
_floorLabel.layer.cornerRadius = 8.0;
_isNewLabel.layer.masksToBounds = YES;
_isNewLabel.layer.cornerRadius = 5.0;
_isNewView.hidden = YES;
_isAllowReport = YES;
_contentTextView.textDelegate = self;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
@@ -67,6 +72,7 @@
}else{
[self setIsAuthor:NO];
}
_isNewView.hidden = !commentInfoViewModel.status;
NSString* content = commentInfoViewModel.content;
if (![commentInfoViewModel.toUserId isEqualToString:_ownerId]){
content = [CommentTableViewCell getContentWithCommentInfoViewModel:commentInfoViewModel];
@@ -135,21 +141,26 @@
-(void)longPressToDo:(UILongPressGestureRecognizer *)gesture
{
if(gesture.state == UIGestureRecognizerStateBegan)
{
//启动弹出菜单
NSMutableArray *menuItems = [NSMutableArray array];
UIMenuItem *messageRepItem = [[UIMenuItem alloc] initWithTitle:@"举报" action:@selector(messageRep:)];
[menuItems addObject:messageRepItem];
if (_isAllowReport) {
UIMenuItem *messageRepItem = [[UIMenuItem alloc] initWithTitle:@"举报" action:@selector(messageRep:)];
[menuItems addObject:messageRepItem];
if ([_commentInfoViewModel.ownerId isEqualToString:[AWordUser sharedInstance].uid]) {
UIMenuItem *messageDelItem = [[UIMenuItem alloc] initWithTitle:@"删除" action:@selector(messageDel:)];
[menuItems addObject:messageDelItem];
}
}
UIMenuItem *messageCopyItem = [[UIMenuItem alloc] initWithTitle:@"复制" action:@selector(messageCopy:)];
[menuItems addObject:messageCopyItem];
if ([_commentInfoViewModel.ownerId isEqualToString:[AWordUser sharedInstance].uid]) {
UIMenuItem *messageDelItem = [[UIMenuItem alloc] initWithTitle:@"删除" action:@selector(messageDel:)];
[menuItems addObject:messageDelItem];
}
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setMenuItems:menuItems];
@@ -40,6 +40,13 @@
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="acitvity_center_new.png" translatesAutoresizingMaskIntoConstraints="NO" id="eMG-PA-nNU">
<rect key="frame" x="297" y="0.0" width="23" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="Dmm-9C-oWb"/>
<constraint firstAttribute="width" constant="23" id="u0I-Ba-FY2"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Biq-B6-eAd" customClass="DTAttributedTextView">
<rect key="frame" x="49" y="16" width="266" height="82"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@@ -58,6 +65,7 @@
<constraint firstItem="qab-Nl-rao" firstAttribute="centerX" secondItem="eYx-r1-Tw5" secondAttribute="centerX" id="4sT-FS-HI3"/>
<constraint firstItem="qab-Nl-rao" firstAttribute="height" secondItem="eYx-r1-Tw5" secondAttribute="height" id="9QX-LS-S2o"/>
<constraint firstItem="Biq-B6-eAd" firstAttribute="leading" secondItem="qab-Nl-rao" secondAttribute="trailing" constant="5" id="Ct8-e2-FK1"/>
<constraint firstItem="eMG-PA-nNU" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="GmY-ys-4Bc"/>
<constraint firstAttribute="trailing" secondItem="Biq-B6-eAd" secondAttribute="trailing" constant="5" id="Jxe-1e-ijt"/>
<constraint firstItem="ZiP-RG-jgh" firstAttribute="leading" secondItem="HNF-FY-BJ4" secondAttribute="trailing" constant="5" id="Ms5-W3-KbQ"/>
<constraint firstItem="qab-Nl-rao" firstAttribute="width" secondItem="eYx-r1-Tw5" secondAttribute="width" id="N5a-ft-DRr"/>
@@ -77,6 +85,7 @@
<constraint firstItem="HNF-FY-BJ4" firstAttribute="leading" secondItem="qab-Nl-rao" secondAttribute="trailing" constant="8" id="vHk-Qa-UVw"/>
<constraint firstItem="qab-Nl-rao" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="vo4-6n-JGW"/>
<constraint firstAttribute="trailingMargin" secondItem="Biq-B6-eAd" secondAttribute="trailing" constant="10" id="xea-GT-ROG"/>
<constraint firstAttribute="trailing" secondItem="eMG-PA-nNU" secondAttribute="trailing" id="yb4-9K-sCj"/>
</constraints>
<variation key="default">
<mask key="constraints">
@@ -92,6 +101,7 @@
<outlet property="avatarImageView" destination="qab-Nl-rao" id="wUN-5h-CDf"/>
<outlet property="contentTextView" destination="Biq-B6-eAd" id="Sgg-UY-WKg"/>
<outlet property="floorLabel" destination="ZiP-RG-jgh" id="i5k-Oq-tHp"/>
<outlet property="isNewView" destination="eMG-PA-nNU" id="5IM-jp-tWm"/>
<outlet property="nameLabel" destination="HNF-FY-BJ4" id="gqu-ya-Fzi"/>
<outlet property="timeLabel" destination="aio-xk-LSD" id="t5S-sR-9vq"/>
</connections>
@@ -99,6 +109,7 @@
</tableViewCell>
</objects>
<resources>
<image name="acitvity_center_new.png" width="46" height="47"/>
<image name="defaultUserIcon.png" width="50" height="50"/>
</resources>
</document>
@@ -12,4 +12,5 @@
@property (weak, nonatomic) IBOutlet UILabel *unReadCountLabel;
-(void)setUnReadCount:(NSInteger)unReadConut;
-(void)setUnReadColor:(UIColor*)color;
@end
@@ -14,6 +14,7 @@
// Initialization code
_unReadCountLabel.layer.cornerRadius = 10.0;
_unReadCountLabel.layer.masksToBounds = YES;
_unReadCountLabel.hidden = YES;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
@@ -21,6 +22,10 @@
// Configure the view for the selected state
}
-(void)setUnReadColor:(UIColor *)color
{
_unReadCountLabel.backgroundColor = color;
}
-(void)setUnReadCount:(NSInteger)unReadConut
{
if (unReadConut > 0) {
@@ -16,7 +16,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="999" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UJW-wi-X9b">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UJW-wi-X9b">
<rect key="frame" x="292" y="12" width="20" height="20"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<constraints>