增加提示

This commit is contained in:
wu736139669
2015-04-27 17:39:10 +08:00
parent dac1e8590b
commit 534239ca07
19 changed files with 85 additions and 31 deletions
@@ -506,11 +506,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/Login/LoginViewController.m"
timestampString = "451664979.302049"
timestampString = "451819141.449598"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "178"
endingLineNumber = "178"
startingLineNumber = "179"
endingLineNumber = "179"
landmarkName = "-loginWithOpenId:withName:withGender:withFigureUrl:"
landmarkType = "5">
<Locations>
@@ -1586,5 +1586,21 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/Main/MyViewController.m"
timestampString = "451819852.959293"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "130"
endingLineNumber = "130"
landmarkName = "-tableView:didSelectRowAtIndexPath:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
+4
View File
@@ -33,4 +33,8 @@
//获取最后更新时间
+(void)setLastUpdateTime:(NSTimeInterval)date;
+(NSTimeInterval)getLastUpdateTime;
//设置登录方式
+(void)setLoginType:(NSInteger)loginType;
+(NSInteger)getLoginType;
@end
+9
View File
@@ -70,4 +70,13 @@
{
return [[NSUserDefaults standardUserDefaults] doubleForKey:@"updatetime"];
}
+(void)setLoginType:(NSInteger)loginType
{
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:loginType] forKey:@"logintype"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+(NSInteger)getLoginType
{
return [[NSUserDefaults standardUserDefaults] integerForKey:@"logintype"];
}
@end
+1
View File
@@ -15,6 +15,7 @@
@property (nonatomic, assign) BOOL isLogin;
@property (nonatomic, strong) NSString *userAvatar;
@property (nonatomic, strong) NSString* userGender;
@property (nonatomic, assign) NSInteger loginType; //0代表第三方,1代表本地.
+(AWordUser*)sharedInstance;
@end
+7
View File
@@ -20,10 +20,17 @@ static AWordUser *sharedObj = nil;
sharedObj.userName = [AWordDefault getUserName];
sharedObj.userAvatar = [AWordDefault getUserAvatar];
sharedObj.userGender = [AWordDefault getUserGender];
sharedObj.loginType = [AWordDefault getLoginType];
}
return sharedObj;
}
-(void)setLoginType:(NSInteger)loginType
{
_loginType = loginType;
[AWordDefault setLoginType:loginType];
}
-(void)setUserName:(NSString *)userName
{
_userName = userName;
@@ -160,6 +160,7 @@
if ([loginViewModel success]) {
[AWordUser sharedInstance].isLogin = YES;
[AWordUser sharedInstance].loginType = 0;
[AWordUser sharedInstance].uid = loginViewModel.uId;
[AWordUser sharedInstance].userName = name;
[AWordUser sharedInstance].userAvatar = figureUrl;
@@ -91,7 +91,7 @@
return;
}
[MBProgressHUD hudWithView:self.view label:@"登录中"];
PropertyEntity* pro = [LoginViewModel requireLoginWithUserName:_userAccountTextField.text withPassWord:_passwordTextField.text];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
@@ -100,6 +100,7 @@
if ([loginViewModel success]) {
[AWordUser sharedInstance].isLogin = YES;
[AWordUser sharedInstance].loginType = 1;
[AWordUser sharedInstance].uid = loginViewModel.uId;
[AWordUser sharedInstance].userName = loginViewModel.userName;
[AWordUser sharedInstance].userAvatar = loginViewModel.figureurl;
@@ -118,6 +119,7 @@
} failedBlock:^(NSError *error) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:nil label:kNetworkErrorTips hidesAfter:1.0];
}];
@@ -111,7 +111,7 @@
}
- (IBAction)userNoticeBtnClick:(id)sender {
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/about.html",Ash_AWord_API_URL]]];
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/notice.html",Ash_AWord_API_URL]]];
[self.navigationController pushViewController:svWebViewController animated:YES];
}
@end
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7531" 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="7520"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RegistAccountViewController">
@@ -20,7 +20,7 @@
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入账号,建议手机号" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="DIX-T3-64d">
<rect key="frame" x="20" y="146" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="0.38" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="hKm-RR-cVC"/>
<constraint firstAttribute="height" constant="30" id="vcd-ch-Bbt"/>
@@ -35,7 +35,7 @@
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="wof-QM-f6K">
<rect key="frame" x="20" y="222" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="0.38" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="l19-BH-UpI"/>
</constraints>
@@ -64,7 +64,7 @@
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="再次输入密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="i7d-va-Xa9">
<rect key="frame" x="20" y="272" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="0.38" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="veS-m2-EXu"/>
</constraints>
@@ -143,7 +143,7 @@
[MBProgressHUD errorHudWithView:nil label:@"昵称不合法" hidesAfter:1.0];
return;
}
[MBProgressHUD hudWithView:self.view label:@"注册中"];
PropertyEntity* pro = [LoginViewModel requireRegistWithUserName:_userAccount withNickName:_nickNameTextField.text withPassword:_passWord withGender:@"" withAvatar:_avatarImage];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
@@ -152,6 +152,7 @@
if ([loginViewModel success]) {
[AWordUser sharedInstance].isLogin = YES;
[AWordUser sharedInstance].loginType = 1;
[AWordUser sharedInstance].uid = loginViewModel.uId;
[AWordUser sharedInstance].userName = _nickNameTextField.text;
[AWordUser sharedInstance].userAvatar = loginViewModel.figureurl;
@@ -170,6 +171,7 @@
} failedBlock:^(NSError *error) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:nil label:kNetworkErrorTips hidesAfter:1.0];
}];
}
@@ -34,7 +34,7 @@
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入昵称长度为2-20" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Kgn-L4-rkT">
<rect key="frame" x="20" y="236" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="gUx-V1-Vp9"/>
</constraints>
@@ -127,9 +127,13 @@
{
[LoginViewController presentLoginViewControllerInView:self success:nil];
}else{
SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init];
setUserInfoViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:setUserInfoViewController animated:YES];
if([AWordUser sharedInstance].loginType == 1)
{
SetUserInfoViewController* setUserInfoViewController = [[SetUserInfoViewController alloc] init];
setUserInfoViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:setUserInfoViewController animated:YES];
}
}
}
@@ -38,6 +38,7 @@
[MBProgressHUD errorHudWithView:nil label:@"请输入举报内容" hidesAfter:1.0];
return;
}
[MBProgressHUD hudWithView:self.view label:@"举报中"];
PropertyEntity* pro = [LoginViewModel requireReportWith:_msgType withMsgId:_msgId withContent:_reportContentTextView.text];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
@@ -57,6 +58,7 @@
}
} failedBlock:^(NSError *error) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:nil label:kNetworkErrorTips hidesAfter:1.0];
}];
@@ -64,7 +64,7 @@
[MBProgressHUD errorHudWithView:nil label:@"请输入内容" hidesAfter:1.0];
return;
}
[MBProgressHUD hudWithView:self.view label:@"提交中"];
PropertyEntity* pro = [LoginViewModel requireFeedbackWithContent:_contentTextView.text];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
@@ -80,6 +80,7 @@
}else{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:self.view label:kSSoErrorTips hidesAfter:1.0];
}
@@ -98,7 +98,7 @@
[MBProgressHUD errorHudWithView:nil label:@"两次密码输入不同" hidesAfter:1.0];
return;
}
[MBProgressHUD hudWithView:self.view label:@"修改中"];
PropertyEntity* pro = [LoginViewModel requireModifyPassWord:_firstNewPswTextField.text withOldPaaaWord:_oldPassWordTextField.text];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
LoginViewModel* loginViewModel = (LoginViewModel*)viewModel;
@@ -119,6 +119,7 @@
} failedBlock:^(NSError *error) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:nil label:kNetworkErrorTips hidesAfter:1.0];
}];
@@ -40,7 +40,7 @@
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入旧密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="VLn-EO-R7Q">
<rect key="frame" x="20" y="69" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="r6p-MB-pex"/>
</constraints>
@@ -49,7 +49,7 @@
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入新密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="oI7-FJ-x8C">
<rect key="frame" x="20" y="157" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="8X5-Vs-Fmo"/>
</constraints>
@@ -72,7 +72,7 @@
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="再次输入新密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="CXS-bQ-KCx">
<rect key="frame" x="20" y="195" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="4OB-AH-5Og"/>
</constraints>
@@ -35,7 +35,7 @@
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if([AWordUser sharedInstance].isLogin)
if([AWordUser sharedInstance].isLogin && [AWordUser sharedInstance].loginType==1)
return 8;
return 7;
}
@@ -115,11 +115,12 @@
cell.textLabel.text = @"意见反馈";
break;
case 6:
cell.textLabel.text = @"密码修改";
cell.textLabel.text = @"服务条款";
break;
case 7:
cell.textLabel.text = @"服务条款";
case 7:
cell.textLabel.text = @"密码修改";
break;
default:
break;
@@ -150,11 +151,12 @@
[self goFeedback];
break;
case 6:
[self modifyPsw];
break;
case 7:
[self showUserNotice];
break;
case 7:
[self modifyPsw];
break;
default:
break;
}
@@ -173,7 +175,7 @@
}
-(void)showUserNotice
{
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/about.html",Ash_AWord_API_URL]]];
SVWebViewController* svWebViewController = [[SVWebViewController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/notice.html",Ash_AWord_API_URL]]];
[self.navigationController pushViewController:svWebViewController animated:YES];
}
- (void)goToAppraisal
@@ -138,6 +138,7 @@
[MBProgressHUD errorHudWithView:nil label:@"昵称不能为空" hidesAfter:1.0];
return;
}
[MBProgressHUD hudWithView:self.view label:@"修改中"];
NSString* nickName = _nickNameTextField.text;
if (nickName.length <= 0 || [_nickNameTextField.text isEqualToString:@""]) {
nickName = _nickNameTextField.placeholder;
@@ -165,6 +166,7 @@
} failedBlock:^(NSError *error) {
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
[MBProgressHUD errorHudWithView:nil label:kNetworkErrorTips hidesAfter:1.0];
}];
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7531" 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="7520"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SetUserInfoViewController">
@@ -53,7 +53,7 @@
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="f6E-ZQ-vlM">
<rect key="frame" x="20" y="206" width="280" height="30"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.95294117649999999" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="sr9-Uc-JeH"/>
</constraints>