设置与帮助

改动头像, 改动password, 移动客服, 帮助, 声明, 关于我们.


代码

//
// IndexSetting600ViewController.h
// SymptomChecker
//
// Created by wang on 2015-7-21.
//
// #import "CYTableViewController.h" @interface IndexSetting600ViewController : CYTableViewController @end
//
// IndexSetting600ViewController.m
// SymptomChecker
//
// Created by wang on 2015-7-21.
//
// #import "IndexSetting600ViewController.h"
#import "UserCenter600Item.h" #import "UserInfoEditingItem.h" // 改动头像
#import "PortraitPickerViewController.h" // 照片视图 #import "ModifyPasswordViewController.h" // 改动password
#import "LocalPasswordViewController.h" #import "CYWebFromLocalViewController.h" // 帮助/声明
#import "CYAboutUsViewController.h" // 关于我们 #define kViewRadio viewWidth()/320 @interface IndexSetting600ViewController () <PortraitPickerViewControllerDelegate> @end @implementation IndexSetting600ViewController { UserFigureEditingItem *_figureItem; // 改动头像
PortraitPickerViewController *_portraitPickerViewController; // 改动头像视图 Setting600Item *_changeSecret; // 改动登录password
Setting600Item *_chunyuTel; // 移动客服
Setting600Item *_helpItem; // 帮助
Setting600Item *_shengMing; // 声明
Setting600Item *_aboutUs; // 关于我们 Setting600SeparateItem *_separateItem; // 空白切割cell FilledColorButton *_logoutButton; // 注销button UIView *_logoutFooterView;
} - (id) initWithQuery:(NSDictionary *)query {
self = [super initWithQuery: query];
if (self) {
self.title = @"设置与帮助";
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(createModel)
name:kRegisterLocalPassword
object:nil];
}
return self;
} - (void) dealloc {
[[NSNotificationCenter defaultCenter] removeObserver: self];
} - (void) viewDidLoad {
[super viewDidLoad];
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
[self createTableItems]; // 确保item已经创建出来
} - (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear: animated];
} //
// 创建一次仅仅需
//
- (void) createTableItems { CY_DEFINE_SELF_BAR(self); User* user = [User currentUser]; // 改动头像
_figureItem = [[UserFigureEditingItem alloc] initWithTitle:@"头像" value:[user.matPhoto getMediaUrl]];
[self.tableViewActions attachToObject:_figureItem
tapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {
[_self editUserFigure];
return YES;
}]; // 改动登录password
_changeSecret = [[Setting600Item alloc] initWithTitle: @"改动登录password"];
_changeSecret.type = kSetting600Top;
[self.tableViewActions attachToObject: _changeSecret
tapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {
ModifyPasswordViewController *controller = [ModifyPasswordViewController new];
[_self cyPresentViewController:controller
animated:YES];
return NO;
}]; // 移动客服
_chunyuTel = [[Setting600Item alloc] initWithTitle: @"移动客服"];
_chunyuTel.type = kSetting600Middle;
[self.tableViewActions attachToObject: _chunyuTel
tapBlock: ^BOOL(id object, id target, NSIndexPath *indexPath) {
NSString* feedBackPhoneNumber = @"4001100866";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [NSString stringWithFormat: @"tel://%@", feedBackPhoneNumber]]];
return YES;
}]; // 帮助
_helpItem = [[Setting600Item alloc] initWithTitle: @"帮助"];
_helpItem.type = kSetting600Middle;
[self.tableViewActions attachToObject: _helpItem
tapBlock: ^BOOL(id object, id target, NSIndexPath *indexPath) {
CYWebFromLocalViewController* controller = [[CYWebFromLocalViewController alloc] initWithQuery:@{@"title" : @"帮助", @"local_name" : @"help"}];
[self.navigationController pushViewController:controller animated:YES]; return YES;
}]; // 声明
_shengMing = [[Setting600Item alloc] initWithTitle: @"声明"];
_shengMing.type = kSetting600Middle;
[self.tableViewActions attachToObject:_shengMing
tapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {
CYWebFromLocalViewController* controller = [[CYWebFromLocalViewController alloc] initWithQuery:@{@"title" : @"声明", @"local_name" : @"statement"}];
[self.navigationController pushViewController:controller animated:YES]; return YES;
}]; // 关于我们
_aboutUs = [[Setting600Item alloc] initWithTitle: @"关于我们"];
_aboutUs.type = kSetting600Bottom;
[self.tableViewActions attachToObject:_aboutUs
tapBlock:^BOOL(id object, id target, NSIndexPath *indexPath) {
CYAboutUsViewController* controller = [[CYAboutUsViewController alloc] initWithQuery:@{@"title" : @"关于我们", @"local_name" : @"about"}];
[self.navigationController pushViewController:controller animated:YES];
return YES;
}]; // 切割
_separateItem = [[Setting600SeparateItem alloc] init]; // 底部视图
_logoutFooterView = [UIView viewWithFrame:CGRectMake(0, 0, self.view.width, 92*kViewRadio)
andBkColor:[UIColor clearColor]];
self.tableView.tableFooterView = _logoutFooterView; // 版本号信息
UILabel *versionLabel = [UILabel labelWithFrame:CGRectMake(0, 8*kViewRadio, viewWidth(), 12*kViewRadio)
fontSize:11
fontColor:RGBCOLOR_HEX(0x522121)
text:[NSString stringWithFormat: @"当前版本号 :%@", @"1.0.0"]
];
[versionLabel setTextAlignment:NSTextAlignmentCenter];
[_logoutFooterView addSubview:versionLabel]; CGRect logoutRect = CGRectMake(16*kViewRadio,
versionLabel.bottom+16*kViewRadio,
viewWidth()-32*kViewRadio,
44*kViewRadio);
// 注销button
_logoutButton = [[FilledColorButton alloc] initWithFrame: logoutRect
color: RGBCOLOR_HEX(0xe85454)
highlightedColor: RGBCOLOR_HEX(0xa43939)
textColor: [UIColor whiteColor]
title: @"注销"
fontSize: 16*kViewRadio
isBold: YES];
[_logoutButton addTarget: self
action: @selector(onLogOutBtnpressed:)
forControlEvents: UIControlEventTouchUpInside];
[_logoutFooterView addSubview:_logoutButton]; } - (void)editUserFigure {
_portraitPickerViewController = [[PortraitPickerViewController alloc] initWithParent:self];
_portraitPickerViewController.delegate = self;
[_portraitPickerViewController showOptions];
} - (void) createModel { NSArray *dataItems; if ([User hasLoggedIn]) {
dataItems = @[_separateItem,
_figureItem, // 改动头像
_separateItem,
_changeSecret,// 改动登录password
_chunyuTel, // 移动客服
_helpItem, // 帮助
_shengMing, // 声明
_aboutUs, // 关于我们
_separateItem];
} else {
_logoutButton.hidden = YES;
_logoutFooterView.height = 40; dataItems = @[_separateItem,
_chunyuTel, // 移动客服
_helpItem, // 帮助
_shengMing, // 声明
_aboutUs, // 关于我们
_separateItem];
} self.tableViewModel = [[NITableViewModel alloc] initWithListArray:dataItems
delegate:self.cellFactory];
} #pragma mark - btn-selectors
// 点击注销
- (void) onLogOutBtnpressed:(UIButton*) sender {
NIDPRINTMETHODNAME(); // 登出
[[AutoLoginManager sharedInstance] logout]; // 更新当前的界面
[self createModel]; [self backToLastController: nil]; // 让别的地方改变UI
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationUserLogout
object:nil]; // 获取未登录的badge
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationCheckBadge
object:nil];
} @end

效果


IOS - 设置与帮助界面的更多相关文章

  1. iOS设置app应用程序文件共享

    1.iOSapp应用程序文件共享 当我们用itnues连接到设备时,在应用程序栏目下面,文件共享下,点击 对应的程序,即可以在程序右边栏目里面看到应用程序共享的数据, 此时,我们可以通过右下角的 添加 ...

  2. IOS 设置定时器

    IOS 设置定时器  自动滚动视图 定时发送坐标信息 即时显示 时钟 NSTimer *timer; - (void)start {//1second 调用一次 timer = [NSTimer sc ...

  3. iOS 设置代理过程

    iOS设置代理的过程 (以模拟 button 作用为例) 1.写协议 新建一个名为 MyButton 的文件,继承于 UIView,在该文件里 声明协议 myDelegate 2.写协议方法 为声明的 ...

  4. iOS设置状态栏样式

    iOS设置状态栏样式可以使用两种方式. 方式一: 直接在需要改变默认状态栏样式的控制器中实现一个方法(其他任何事情都不用做): // 返回状态栏的样式 - (UIStatusBarStyle)pref ...

  5. iOS设置拍照retake和use按钮为中文简体

    iOS设置拍照retake和use按钮为中文简体,设置有两种方式一个是代码直接控制,第二就是xcode配置本机国际化为“china”(简体中文). 本文重点要说的是第二种,这样配置有两个好处,一是操作 ...

  6. iOS 设置View阴影

    iOS 设置View投影 需要设置 颜色 阴影半径 等元素 UIView *shadowView = [[UIView alloc] init]; shadowView.frame = CGRectM ...

  7. iOS 设置UILabel 的内边距

    iOS 设置UILabel 的内边距 - (void)drawTextInRect:(CGRect)rect { UIEdgeInsets insets = {, , , }; [super draw ...

  8. iOS 设置app语言中文,比如 copy中文,拍照按钮cancel 中文

    iOS 设置app语言中文,比如 copy中文,拍照按钮cancel 中文 一:如何设置项目中文环境 targets--->Locatization native development reg ...

  9. iOS 设置字体样式

    1.iOS设置字体样式   label.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:24];   字体名如下: F ...

随机推荐

  1. QQ应用前景与范围文档

    QQ软件 前景与范围文档       当前版本: 版本1 作   者: 李飞 完成日期: 2013年11月3日 1.  业务需求 1.1 应用背景 20世纪后期网络的应用和21世纪的飞速发展,网络已经 ...

  2. navicat创建存储过程报错

    搞了半天这个恶心的报错,最后发现竟然是存储过程的一个varchar类型的参数没给长度,如varchar(64)长度必须指定不然就会报错: mark一记

  3. DVWA--登录页面错误问题 469 | | PHP Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\web\DVWA\dvwa\includes\dvwaPage.inc.php:469

    // MySQL PDO Prepared Statements (for impossible levels) $db = new PDO('mysql:host=' . $_DVWA[ 'db_s ...

  4. 如何实现ADSL宽带用户开机自动拨号与定时拨号

    在宽带拨号网络的环境下,要通过手动拨号认证才能上网.下面给大家介绍怎么设置开机自动拨号上网以及定时拨号上网. 这也是为一个叫CHY的2B准备的技术套餐,不需要用到网上说的自动拨号软件,只要在主机上设置 ...

  5. miller_rabin_素性测试

    摘自:http://blog.csdn.net/pi9nc/article/details/27209455 看了好久没看懂,最后在这篇博客中看明白了. 费马定理的应用,加上二次探测定理. Ferma ...

  6. MFC_2.3 定时器、滑块、进度条控件

    定时器.滑块.进度条控件 1.拖控件 2.绑定变量.默认,然后取名字 3.初始化设置定时器 // 设置滑块和进度条的范围 m_TrackBar.SetRange(0, 1000); m_StaticP ...

  7. CSS绝对定位模拟固定定位

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  8. Java编辑编译及运行环境

    Java编辑编译及运行环境 Microsoft Windows 编辑工具 EditPlus JDK JDK(Java Development Kit,Java开发工具包)安装JDK之后,其中bin文件 ...

  9. Python【每日一问】34

    问: 基础题: 定义函数实现以下功能:求出 0-n 所能组成的奇数个数,位数最多 n+1 (0<n<10),比如键盘输入n=7,求出0-7所能组成的奇数个数 提高题: 有如下分数序列: 2 ...

  10. linux shell脚本学习笔记一

    一.文件比较运算符-e filename 如果 filename存在,则为真 [ -e /var/log/syslog ]-d filename 如果 filename为目录,则为真 [ -d /tm ...