Skip to content

Commit

Permalink
dev里程碑:完成找回密码功能,修复bug。
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyufeng1991 committed Nov 18, 2015
1 parent 3b0182f commit e378238
Show file tree
Hide file tree
Showing 14 changed files with 433 additions and 111 deletions.
8 changes: 7 additions & 1 deletion Oncenote.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
719AF3C01BFB18DE009D602D /* NicknameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 719AF3BF1BFB18DE009D602D /* NicknameViewController.m */; settings = {ASSET_TAGS = (); }; };
719AF3C31BFB5973009D602D /* AboutAppViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 719AF3C21BFB5973009D602D /* AboutAppViewController.m */; settings = {ASSET_TAGS = (); }; };
719AF3C61BFB5E21009D602D /* UpdatePasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 719AF3C51BFB5E21009D602D /* UpdatePasswordViewController.m */; settings = {ASSET_TAGS = (); }; };
719AF3C91BFC4CB3009D602D /* ForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 719AF3C81BFC4CB3009D602D /* ForgetPasswordViewController.m */; settings = {ASSET_TAGS = (); }; };
71A793751BF5B5F000410FFC /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A793741BF5B5F000410FFC /* LoginViewController.m */; settings = {ASSET_TAGS = (); }; };
71A793781BF5CDCA00410FFC /* RegisterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A793771BF5CDCA00410FFC /* RegisterViewController.m */; settings = {ASSET_TAGS = (); }; };
71A7937C1BF5E75600410FFC /* BmobOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A7937B1BF5E75600410FFC /* BmobOperation.m */; settings = {ASSET_TAGS = (); }; };
Expand Down Expand Up @@ -170,6 +171,8 @@
719AF3C21BFB5973009D602D /* AboutAppViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutAppViewController.m; sourceTree = "<group>"; };
719AF3C41BFB5E21009D602D /* UpdatePasswordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdatePasswordViewController.h; sourceTree = "<group>"; };
719AF3C51BFB5E21009D602D /* UpdatePasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UpdatePasswordViewController.m; sourceTree = "<group>"; };
719AF3C71BFC4CB3009D602D /* ForgetPasswordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForgetPasswordViewController.h; sourceTree = "<group>"; };
719AF3C81BFC4CB3009D602D /* ForgetPasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForgetPasswordViewController.m; sourceTree = "<group>"; };
71A793731BF5B5F000410FFC /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
71A793741BF5B5F000410FFC /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
71A793761BF5CDCA00410FFC /* RegisterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -392,10 +395,12 @@
71BEC2891BF8BC100003F173 /* LaunchScreenViewController.m */,
71A793731BF5B5F000410FFC /* LoginViewController.h */,
71A793741BF5B5F000410FFC /* LoginViewController.m */,
717902EF1BF48FC100428756 /* MainViewController.m */,
719AF3C71BFC4CB3009D602D /* ForgetPasswordViewController.h */,
719AF3C81BFC4CB3009D602D /* ForgetPasswordViewController.m */,
71A793761BF5CDCA00410FFC /* RegisterViewController.h */,
71A793771BF5CDCA00410FFC /* RegisterViewController.m */,
717902EE1BF48FC100428756 /* MainViewController.h */,
717902EF1BF48FC100428756 /* MainViewController.m */,
718FF3A11BF623B7009A3F6D /* AddNoteViewController.h */,
718FF3A21BF623B7009A3F6D /* AddNoteViewController.m */,
71BEC27F1BF753080003F173 /* NoteDetailViewController.h */,
Expand Down Expand Up @@ -712,6 +717,7 @@
files = (
719AF3C31BFB5973009D602D /* AboutAppViewController.m in Sources */,
71A793781BF5CDCA00410FFC /* RegisterViewController.m in Sources */,
719AF3C91BFC4CB3009D602D /* ForgetPasswordViewController.m in Sources */,
718FF3A31BF623B7009A3F6D /* AddNoteViewController.m in Sources */,
719AF3BD1BFB10CD009D602D /* SettingList.m in Sources */,
719AF3C61BFB5E21009D602D /* UpdatePasswordViewController.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Oncenote/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@property (strong,nonatomic) NSString *GLOBAL_USERID;//全局的objectID;当前的用户ID;
@property (strong,nonatomic) NSString *GLOBAL_USERNAME;//全局的用户名,也就是手机号;
@property (strong,nonatomic) NSString *GLOBAL_NICKNAME;//全局的昵称;
@property (strong,nonatomic) NSString *GLOBAL_PASSWORD;//全局的密码;

//尝试全局使用一个笔记数组;

Expand Down
91 changes: 89 additions & 2 deletions Oncenote/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<state key="normal" title="忘记密码">
<color key="titleColor" red="0.011764705882352941" green="0.27450980392156865" blue="0.23921568627450979" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="forgetPasswordButtonPressed:" destination="b9I-jw-xEZ" eventType="touchUpInside" id="YYj-u6-aRP"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="awM-KE-PS1">
<rect key="frame" x="102" y="518" width="117" height="30"/>
Expand All @@ -93,7 +96,7 @@
<color key="titleColor" red="0.67450980392156867" green="0.94117647058823528" blue="0.81960784313725488" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<segue destination="FPm-hS-1Zf" kind="modal" id="46d-mX-OvT"/>
<action selector="createAccountButtonPressed:" destination="b9I-jw-xEZ" eventType="touchUpInside" id="f5P-mE-TDv"/>
</connections>
</button>
</subviews>
Expand All @@ -110,6 +113,90 @@
</objects>
<point key="canvasLocation" x="1106" y="-1039"/>
</scene>
<!--Forget Password View Controller-->
<scene sceneID="LxM-of-PV3">
<objects>
<viewController storyboardIdentifier="ForgetPasswordViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ewE-p5-DDy" customClass="ForgetPasswordViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="F7s-Xn-sTK">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入注册时的手机号" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="9id-Va-CrL">
<rect key="frame" x="17" y="57" width="280" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.38823529410000002" green="0.76078431369999999" blue="0.47843137250000001" alpha="0.80133551520000001" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="phonePad"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="输入你的新密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="kW0-rq-BaZ">
<rect key="frame" x="17" y="149" width="280" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.38823529410000002" green="0.76078431369999999" blue="0.47843137250000001" alpha="0.80133551520000001" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="1W1-Dh-Hzt">
<rect key="frame" x="36" y="211" width="242" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.68627450980000004" green="0.89411764709999997" blue="0.78823529410000004" alpha="0.80133551520000001" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="重设密码">
<color key="titleColor" red="0.01176470588" green="0.27450980390000002" blue="0.23921568630000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="resettingPasswordButtonPressed:" destination="ewE-p5-DDy" eventType="touchUpInside" id="HWl-Js-Vfu"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="bIn-TC-ZHv">
<rect key="frame" x="176" y="103" width="121" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.68627450980000004" green="0.89411764709999997" blue="0.78823529410000004" alpha="0.80133551520000001" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="获取验证码">
<color key="titleColor" red="0.01176470588" green="0.27450980390000002" blue="0.23921568630000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="getValidateCodeButtonPressed:" destination="ewE-p5-DDy" eventType="touchUpInside" id="b8U-Jm-QNQ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0d6-5k-g6w">
<rect key="frame" x="99" y="517" width="117" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="或者,登录">
<color key="titleColor" red="0.67450980390000004" green="0.94117647059999998" blue="0.81960784310000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="loginButtonPressed:" destination="ewE-p5-DDy" eventType="touchUpInside" id="c63-ml-2L2"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="FLP-z9-6Xf">
<rect key="frame" x="17" y="103" width="151" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" red="0.38823529410000002" green="0.76078431369999999" blue="0.47843137250000001" alpha="0.80133551520000001" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad"/>
</textField>
</subviews>
<animations/>
<color key="backgroundColor" red="0.27058823529411763" green="0.69019607843137254" blue="0.38039215686274508" alpha="1" colorSpace="calibratedRGB"/>
</view>
<connections>
<outlet property="nowPasswordTextField" destination="kW0-rq-BaZ" id="DCr-sj-SmG"/>
<outlet property="phoneTextField" destination="9id-Va-CrL" id="6Ab-NP-ViZ"/>
<outlet property="validateCodeTextField" destination="FLP-z9-6Xf" id="Ea8-pD-wVX"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4tQ-b8-0yB" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1586" y="-1034"/>
</scene>
<!--Add Note View Controller-->
<scene sceneID="bm8-2D-kFC">
<objects>
Expand Down Expand Up @@ -928,7 +1015,7 @@
<color key="titleColor" red="0.67450980390000004" green="0.94117647059999998" blue="0.81960784310000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<segue destination="b9I-jw-xEZ" kind="modal" id="pLJ-W5-MAZ"/>
<action selector="loginButtonPressed:" destination="FPm-hS-1Zf" eventType="touchUpInside" id="SCv-ct-85a"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" id="ez9-YM-eKQ">
Expand Down
2 changes: 1 addition & 1 deletion Oncenote/BmobOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

+ (void)deleteNoteFromDatabase:(NSString*)tableName noteId:(NSString*)noteId;

+ (void)updateNicknameToUserTable:(NSString*)tableName userId:(NSString*)userId nickname:(NSString*)nickname;
//+ (void)updateNicknameToUserTable:(NSString*)tableName userId:(NSString*)userId nickname:(NSString*)nickname;
@end
30 changes: 15 additions & 15 deletions Oncenote/BmobOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ + (void)deleteNoteFromDatabase:(NSString*)tableName noteId:(NSString*)noteId{
}

#pragma mark - 修改用户的昵称
+ (void)updateNicknameToUserTable:(NSString*)tableName userId:(NSString*)userId nickname:(NSString*)nickname{

BmobQuery *update = [BmobQuery queryWithClassName:tableName];
[update getObjectInBackgroundWithId:userId block:^(BmobObject *object,NSError *error){
if (!error) {
if (object) {
[object setObject:nickname forKey:@"nickname"];

[object updateInBackground];
}
}else{
//进行错误处理
}
}];
}
//+ (void)updateNicknameToUserTable:(NSString*)tableName userId:(NSString*)userId nickname:(NSString*)nickname{
//
// BmobQuery *update = [BmobQuery queryWithClassName:tableName];
// [update getObjectInBackgroundWithId:userId block:^(BmobObject *object,NSError *error){
// if (!error) {
// if (object) {
// [object setObject:nickname forKey:@"nickname"];
//
// [object updateInBackground];
// }
// }else{
// //进行错误处理
// }
// }];
//}



Expand Down
13 changes: 13 additions & 0 deletions Oncenote/ForgetPasswordViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ForgetPasswordViewController.h
// Oncenote
//
// Created by chenyufeng on 15/11/18.
// Copyright © 2015年 chenyufengweb. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ForgetPasswordViewController : UIViewController

@end
Loading

0 comments on commit e378238

Please sign in to comment.