Commit b9a5a2c8 authored by 曹云霄's avatar 曹云霄

登陆、重置密码、忘记密码接口调试

parent 4bf3a3c4
//
// ChangePasswordViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/9.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
/**
* 取消按钮
*/
@protocol CancelButtondelegate <NSObject>
- (void)cancelButtonClick;
@end
@interface ChangePasswordViewController : BaseViewController
/**
* 用户名
*/
@property (weak, nonatomic) IBOutlet UITextField *userName;
/**
* 旧密码
*/
@property (weak, nonatomic) IBOutlet UITextField *oldPassWord;
/**
* 新密码
*/
@property (weak, nonatomic) IBOutlet UITextField *NewPassWord;
/**
* 取消按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
/**
* 确认修改
*/
@property (weak, nonatomic) IBOutlet UIButton *sureChangeButton;
@property (nonatomic,assign) id<CancelButtondelegate>delegate;
@end
//
// ChangePasswordViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/9.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ChangePasswordViewController.h"
@interface ChangePasswordViewController ()
@end
@implementation ChangePasswordViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self uiConfigAction];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - UI
- (void)uiConfigAction
{
self.userName.layer.masksToBounds = YES;
self.userName.layer.cornerRadius = kCornerRadius;
self.oldPassWord.layer.masksToBounds = YES;
self.oldPassWord.layer.cornerRadius = kCornerRadius;
self.NewPassWord.layer.masksToBounds = YES;
self.NewPassWord.layer.cornerRadius = kCornerRadius;
self.cancelButton.layer.masksToBounds = YES;
self.cancelButton.layer.cornerRadius = kCornerRadius;
self.sureChangeButton.layer.masksToBounds = YES;
self.sureChangeButton.layer.cornerRadius = kCornerRadius;
}
#pragma mark -取消按钮
- (IBAction)cancelButtonClick:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(cancelButtonClick)]) {
[self.delegate cancelButtonClick];
}
}
#pragma amrk -确认修改按钮
- (IBAction)sureChangeButtonClick:(UIButton *)sender {
if (self.userName.text.length == 0) {
[self ErrorMBProgressView:@"账户名不能为空"];
}
else if (self.oldPassWord.text.length == 0)
{
[self ErrorMBProgressView:@"旧密码不能为空"];
}
else if (self.NewPassWord.text.length == 0)
{
[self ErrorMBProgressView:@"新密码不能为空"];
}
ModifyPasswordRequest *modify = [[ModifyPasswordRequest alloc]init];
modify.oldPassword = self.oldPassWord.text;
modify.Password = self.NewPassWord.text;
//修改密码
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/modifyPassword"] WithRequestType:0 WithParameter:modify WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
}];
}
/*
#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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChangePasswordViewController">
<connections>
<outlet property="NewPassWord" destination="TJV-CB-Mqw" id="SaI-nb-f0s"/>
<outlet property="cancelButton" destination="0eq-Wo-sGl" id="ci8-5b-oY1"/>
<outlet property="oldPassWord" destination="pXm-yF-r4F" id="yxA-Zo-zo2"/>
<outlet property="sureChangeButton" destination="Uy9-G9-RqB" id="6yk-9i-HQ3"/>
<outlet property="userName" destination="I7F-SJ-w3C" id="uNM-v8-eeN"/>
<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="260" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="User-Profile" id="kKr-u3-FRr">
<rect key="frame" x="10" y="20" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账户名" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" id="I7F-SJ-w3C">
<rect key="frame" x="38" y="12" width="210" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="p5A-4a-qsN">
<rect key="frame" x="10" y="60" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="旧密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" id="pXm-yF-r4F">
<rect key="frame" x="38" y="53" width="210" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="ETT-6B-Tnz">
<rect key="frame" x="10" y="100" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="新密码" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" id="TJV-CB-Mqw">
<rect key="frame" x="38" y="92" width="210" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="0eq-Wo-sGl">
<rect key="frame" x="10" y="138" width="80" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.34901960780000002" green="0.67450980390000004" blue="0.86274509799999999" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="取消">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancelButtonClick:" destination="-1" eventType="touchUpInside" id="84g-jP-oYL"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Uy9-G9-RqB">
<rect key="frame" x="168" y="138" width="80" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.34901960784313724" green="0.67450980392156867" blue="0.86274509803921573" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="确认修改">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="sureChangeButtonClick:" destination="-1" eventType="touchUpInside" id="gVs-MV-AHp"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="397" y="76"/>
</view>
</objects>
<resources>
<image name="Lock-0" width="17" height="21"/>
<image name="User-Profile" width="17" height="17"/>
</resources>
</document>
...@@ -42,4 +42,28 @@ ...@@ -42,4 +42,28 @@
@property (weak, nonatomic) IBOutlet UIButton *loginButton; @property (weak, nonatomic) IBOutlet UIButton *loginButton;
/**
* 用户名背景View
*/
@property (weak, nonatomic) IBOutlet UIView *userNameBackview;
/**
* 密码背景View
*/
@property (weak, nonatomic) IBOutlet UIView *passWordBackview;
@end @end
...@@ -46,29 +46,101 @@ ...@@ -46,29 +46,101 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
[self uiConfigAction];
} }
#pragma mark -登陆 #pragma mark - 布局
- (IBAction)LoginButtonClick:(UIButton *)sender { - (void)uiConfigAction
{
self.loginButton.layer.masksToBounds = YES;
self.loginButton.layer.cornerRadius = kCornerRadius;
self.userNameBackview.layer.masksToBounds = YES;
self.userNameBackview.layer.cornerRadius = kCornerRadius;
self.passWordBackview.layer.masksToBounds = YES;
self.passWordBackview.layer.cornerRadius = kCornerRadius;
self.userNameLoginView.layer.masksToBounds = YES;
self.userNameLoginView.layer.cornerRadius = 10;
self.forgotPasswordButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
RightViewController *rightVC = [[RightViewController alloc]init];
rightVC.delegate = self;
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:self.customtabbar rightDrawerViewController:rightVC];
[self.drawerController setMaximumRightDrawerWidth:RightWidth];
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
SHARED_APPDELEGATE.mmdrawer = self.drawerController;
SHARED_APPDELEGATE.window.rootViewController = self.drawerController;
self.userName.text = @"sh1";
self.passWord.text = @"123456";
}
#pragma mark -登陆
- (IBAction)LoginButtonClick:(UIButton *)sender {
if (self.userName.text.length == 0) {
[self ErrorMBProgressView:@"用户名不能为空"];
return;
}else if (self.passWord.text.length == 0)
{
[self ErrorMBProgressView:@"密码不能为空"];
return;
}
[self judgeUserNameAndPassword];
} }
#pragma mark -设置根视图控制器
- (void)SetTheRootViewController
{
RightViewController *rightVC = [[RightViewController alloc]init];
rightVC.delegate = self;
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:self.customtabbar rightDrawerViewController:rightVC];
[self.drawerController setMaximumRightDrawerWidth:RightWidth];
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
SHARED_APPDELEGATE.mmdrawer = self.drawerController;
SHARED_APPDELEGATE.window.rootViewController = self.drawerController;
}
#pragma mark -判断用户名密码是否正确
- (void)judgeUserNameAndPassword
{
[self CreateMBProgressHUDLoding];
NSString *URL = [NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/login"];
LoginInfo *login = [[LoginInfo alloc]init];
login.username = self.userName.text;
login.password = self.passWord.text;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:URL WithRequestType:0 WithParameter:login WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
LoginResult *result = [[LoginResult alloc] initWithDictionary:returnValue[@"data"]];
[self SetTheRootViewController];
NSLog(@"成功");
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
NSLog(@"%@",errorCodeValue);
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
#pragma mark -RightVCselectedDelegate 方法 #pragma mark -RightVCselectedDelegate 方法
- (void)SelectedControllerWithIndex:(NSString *)Name - (void)SelectedControllerWithIndex:(NSString *)Name
...@@ -103,15 +175,21 @@ ...@@ -103,15 +175,21 @@
#pragma mark -忘记密码 #pragma mark -忘记密码
- (IBAction)ForgotpasswordButtonClick:(UIButton *)sender { - (IBAction)ForgotpasswordButtonClick:(UIButton *)sender {
self.identityView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]firstObject]; self.identityView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]firstObject];
//判断登陆界面是否已经输入了用户名
if (self.userName.text.length != 0) {
self.identityView.userName.text = self.userName.text;
}
self.identityView.layer.masksToBounds = YES;
self.identityView.layer.cornerRadius = 10;
[self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside]; [self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self.identityView.nextButton addTarget:self action:@selector(NextButtonClick) forControlEvents:UIControlEventTouchUpInside]; [self.identityView.nextButton addTarget:self action:@selector(NextButtonClick) forControlEvents:UIControlEventTouchUpInside];
self.identityView.alpha = 0; self.identityView.alpha = 0;
...@@ -122,8 +200,6 @@ ...@@ -122,8 +200,6 @@
self.identityView.alpha = 1; self.identityView.alpha = 1;
}]; }];
} }
...@@ -151,19 +227,85 @@ ...@@ -151,19 +227,85 @@
- (void)NextButtonClick - (void)NextButtonClick
{ {
self.resetPasswordView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]lastObject]; self.resetPasswordView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]lastObject];
self.resetPasswordView.layer.masksToBounds = YES;
self.resetPasswordView.layer.cornerRadius = 10;
self.resetPasswordView.frame = self.userNameLoginView.frame; self.resetPasswordView.frame = self.userNameLoginView.frame;
[self.resetPasswordView.backValidationView addTarget:self action:@selector(backButonClick) forControlEvents:UIControlEventTouchUpInside]; [self.resetPasswordView.backValidationView addTarget:self action:@selector(backButonClick) forControlEvents:UIControlEventTouchUpInside];
[self.resetPasswordView.resetPasswordNextButton addTarget:self action:@selector(ChangPassWordRequest) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.resetPasswordView]; [self.view addSubview:self.resetPasswordView];
self.resetPasswordView.alpha = 0; self.resetPasswordView.alpha = 0;
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
self.resetPasswordView.alpha = 1; self.resetPasswordView.alpha = 1;
}];
}
#pragma mark -修改密码
- (void)ChangPassWordRequest
{
NSLog(@"%@",self.resetPasswordView.newpass.text);
NSLog(@"%@",self.resetPasswordView.confirmNewpass.text);
if (self.resetPasswordView.newpass.text.length == 0) {
[self ErrorMBProgressView:@"新密码为空"];
return;
}else if (self.resetPasswordView.confirmNewpass.text.length == 0)
{
[self ErrorMBProgressView:@"确认密码为空"];
return;
}
if (![self.resetPasswordView.newpass.text isEqualToString:self.resetPasswordView.confirmNewpass.text]) {
[self ErrorMBProgressView:@"两次密码不相同"];
return;
}
//调用短信发送接口
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
[manager GET:[NSString stringWithFormat:@"%@%@",ServerAddress,@"com.gomore.opple.rest.system.RsSystemService#sendSms(1234)"] parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"%@",responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"%@",error);
}]; }];
//重置密码接口
ResetPasswordRequest *passwrod = [[ResetPasswordRequest alloc]init];
passwrod.Password = self.resetPasswordView.newpass.text;
passwrod.Password = self.resetPasswordView.confirmNewpass.text;
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/employee/resetPassword"] WithRequestType:0 WithParameter:passwrod WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[self ErrorMBProgressView:returnValue[@"message"]];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
}];
} }
#pragma mark -返回验证信息界面 #pragma mark -返回验证信息界面
- (void)backButonClick - (void)backButonClick
{ {
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
@property (weak, nonatomic) IBOutlet UIButton *nextButton; @property (weak, nonatomic) IBOutlet UIButton *nextButton;
/*************************重置密码 /*************************重置密码
******************************************/ ******************************************/
...@@ -72,15 +73,40 @@ ...@@ -72,15 +73,40 @@
/**
* 账户名背景
*/
@property (weak, nonatomic) IBOutlet UIView *userNameBackView;
/**
* 绑定的手机号背景
*/
@property (weak, nonatomic) IBOutlet UIView *PhoneNumberBackView;
/**
* 验证码背景
*/
@property (weak, nonatomic) IBOutlet UIView *VerificationBackView;
/**
* 新密码背景View
*/
@property (weak, nonatomic) IBOutlet UIView *NewpasswordBackView;
/**
* 确认新密码背景View
*/
@property (weak, nonatomic) IBOutlet UIView *determineBackView;
/**
* 重置密码下一步
*/
@property (weak, nonatomic) IBOutlet UIButton *resetPasswordNextButton;
......
...@@ -18,4 +18,30 @@ ...@@ -18,4 +18,30 @@
} }
*/ */
- (void)awakeFromNib
{
[self uiConfigAction];
}
#pragma mark -布局
- (void)uiConfigAction
{
self.userNameBackView.layer.masksToBounds = YES;
self.userNameBackView.layer.cornerRadius = kCornerRadius;
self.PhoneNumberBackView.layer.masksToBounds = YES;
self.PhoneNumberBackView.layer.cornerRadius = kCornerRadius;
self.VerificationBackView.layer.masksToBounds = YES;
self.VerificationBackView.layer.cornerRadius = kCornerRadius;
self.nextButton.layer.masksToBounds = YES;
self.nextButton.layer.cornerRadius = kCornerRadius;
self.NewpasswordBackView.layer.masksToBounds = YES;
self.NewpasswordBackView.layer.cornerRadius = kCornerRadius;
self.determineBackView.layer.masksToBounds = YES;
self.determineBackView.layer.cornerRadius = kCornerRadius;
self.resetPasswordNextButton.layer.masksToBounds = YES;
self.resetPasswordNextButton.layer.cornerRadius = kCornerRadius;
}
@end @end
This diff is collapsed.
...@@ -56,6 +56,37 @@ ...@@ -56,6 +56,37 @@
} }
#pragma mark -筛选风格
- (IBAction)screeningStyleButtonClick:(UIButton *)sender {
PopoverViewController *popover = [[PopoverViewController alloc]init];
popover.datasArray = @[@"你好",@"你好"];
popover.contentSize = CGSizeMake(150, 300);
popover.preferredContentSize = CGSizeMake(150, 300);
popover.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = popover.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = popover.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:sender];
[self presentViewController:popover animated:YES completion:nil];
}
#pragma mark -房型风格
- (IBAction)HouseStyleButtonClick:(UIButton *)sender {
PopoverViewController *popover = [[PopoverViewController alloc]init];
popover.datasArray = @[@"你好",@"你好"];
popover.contentSize = CGSizeMake(150, 300);
popover.preferredContentSize = CGSizeMake(150, 300);
popover.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = popover.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = popover.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:sender];
[self presentViewController:popover animated:YES completion:nil];
}
......
...@@ -18,13 +18,19 @@ ...@@ -18,13 +18,19 @@
#import "AllCustomerViewController.h" #import "AllCustomerViewController.h"
#import "CustomerOrderViewController.h" #import "CustomerOrderViewController.h"
#import "UserViewController.h" #import "UserViewController.h"
#import "ChangePasswordViewController.h"
@interface CustomTabbarController ()<TabbarButtonClickdelegate,UIPopoverPresentationControllerDelegate> @interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate>
@property (nonatomic,strong) NSArray *identifierArray; @property (nonatomic,strong) NSArray *identifierArray;
@property (nonatomic,strong) NSArray *controllerArray; @property (nonatomic,strong) NSArray *controllerArray;
/**
* 保存按钮引用
*/
@property (nonatomic,strong) UIButton *Newbutton;
@end @end
@implementation CustomTabbarController @implementation CustomTabbarController
...@@ -124,7 +130,7 @@ ...@@ -124,7 +130,7 @@
#pragma amrk -TabbarButtonClickdelegate代理 #pragma amrk -TabbarButtonClickdelegate代理
- (void)ButtonClickAction:(NSInteger)Buttontag withButton:(UIButton *)button - (void)ButtonClickAction:(NSInteger)Buttontag withButton:(UIButton *)button
{ {
_Newbutton = button;
switch (Buttontag) { switch (Buttontag) {
//右侧视图 //右侧视图
...@@ -139,15 +145,14 @@ ...@@ -139,15 +145,14 @@
{ {
UserViewController *userVC = [[UserViewController alloc]init]; UserViewController *userVC = [[UserViewController alloc]init];
userVC.delegate = self;
userVC.preferredContentSize = CGSizeMake(260, 170); userVC.preferredContentSize = CGSizeMake(260, 170);
userVC.modalPresentationStyle = UIModalPresentationPopover; userVC.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = userVC.popoverPresentationController; UIPopoverPresentationController *pop = userVC.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny; pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = userVC.view; pop.sourceView = userVC.view;
pop.delegate = self; pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
pop.sourceRect = button.frame;
[self presentViewController:userVC animated:YES completion:nil]; [self presentViewController:userVC animated:YES completion:nil];
} }
break; break;
...@@ -171,16 +176,45 @@ ...@@ -171,16 +176,45 @@
} }
} }
- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller #pragma mark -修改密码点击
{ // 此处为不适配(如果选择其他,会自动视频屏幕,上面设置的大小就毫无意义了) - (void)changPasswordButtonClick
{
return UIModalPresentationNone; [self dismissViewControllerAnimated:NO completion:^{
ChangePasswordViewController *changpassword = [[ChangePasswordViewController alloc]init];
changpassword.delegate = self;
changpassword.preferredContentSize = CGSizeMake(260, 180);
changpassword.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = changpassword.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = changpassword.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:_Newbutton];
[self presentViewController:changpassword animated:YES completion:nil];
}];
} }
#pragma mark -取消按钮
- (void)cancelButtonClick
{
[self dismissViewControllerAnimated:NO completion:^{
UserViewController *userVC = [[UserViewController alloc]init];
userVC.delegate = self;
userVC.preferredContentSize = CGSizeMake(260, 170);
userVC.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *pop = userVC.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = userVC.view;
pop.barButtonItem = [[UIBarButtonItem alloc]initWithCustomView:_Newbutton];
[self presentViewController:userVC animated:YES completion:nil];
}];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
......
...@@ -8,6 +8,61 @@ ...@@ -8,6 +8,61 @@
#import "BaseViewController.h" #import "BaseViewController.h"
@protocol ChangpasswordDelegate <NSObject>
/**
* 修改密码
*/
- (void)changPasswordButtonClick;
@end
@interface UserViewController : BaseViewController @interface UserViewController : BaseViewController
@property (nonatomic,assign) id<ChangpasswordDelegate> delegate;
/**
* 用户头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *userHeader;
/**
* 账户名
*/
@property (weak, nonatomic) IBOutlet UITextField *userName;
/**
* 密码
*/
@property (weak, nonatomic) IBOutlet UITextField *passWord;
/**
* 切换账户
*/
@property (weak, nonatomic) IBOutlet UIButton *switchUser;
/**
* 注销
*/
@property (weak, nonatomic) IBOutlet UIButton *cancellationButton;
/**
* 修改密码
*/
@property (weak, nonatomic) IBOutlet UIButton *changePassword;
@end @end
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
// //
#import "UserViewController.h" #import "UserViewController.h"
#import "ChangePasswordViewController.h"
@interface UserViewController () @interface UserViewController ()
...@@ -17,9 +19,64 @@ ...@@ -17,9 +19,64 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.userName.layer.masksToBounds = YES;
self.userName.layer.cornerRadius = kCornerRadius;
self.userName.layer.borderWidth = 1;
self.userName.layer.borderColor = kMainBlueColor.CGColor;
self.passWord.layer.masksToBounds = YES;
self.passWord.layer.cornerRadius = kCornerRadius;
self.passWord.layer.borderWidth = 1;
self.passWord.layer.borderColor = kMainBlueColor.CGColor;
self.cancellationButton.layer.masksToBounds = YES;
self.cancellationButton.layer.cornerRadius = kCornerRadius;
self.switchUser.layer.masksToBounds = YES;
self.switchUser.layer.cornerRadius = kCornerRadius;
self.changePassword.layer.masksToBounds = YES;
self.changePassword.layer.cornerRadius = kCornerRadius;
self.changePassword.layer.borderWidth = 1;
self.changePassword.layer.borderColor = kMainBlueColor.CGColor;
}
#pragma mark -修改密码
- (IBAction)ChangPasswordButtonClick:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(changPasswordButtonClick)]) {
[self.delegate changPasswordButtonClick];
}
} }
#pragma mark -注销
- (IBAction)cancellationButtonClick:(UIButton *)sender {
}
#pragma mark -切换账户
- (IBAction)switchUserButtonClick:(UIButton *)sender {
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
This diff is collapsed.
...@@ -79,7 +79,11 @@ ...@@ -79,7 +79,11 @@
29EAAEA51CDC7F7000C4DBA2 /* CustomerOrderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAEA41CDC7F7000C4DBA2 /* CustomerOrderTableViewCell.m */; }; 29EAAEA51CDC7F7000C4DBA2 /* CustomerOrderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAEA41CDC7F7000C4DBA2 /* CustomerOrderTableViewCell.m */; };
29EAAEAA1CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAEA91CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m */; }; 29EAAEAA1CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAEA91CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m */; };
29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 29EAAEAB1CDCA28300C4DBA2 /* city.json */; }; 29EAAEAC1CDCA28300C4DBA2 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 29EAAEAB1CDCA28300C4DBA2 /* city.json */; };
745C665EA695DD3EC6271ADE /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC80D439AC474587DD59064 /* libPods.a */; }; 29EC331A1CE023D5005F0C13 /* ChangePasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EC33181CE023D5005F0C13 /* ChangePasswordViewController.m */; };
29EC331B1CE023D5005F0C13 /* ChangePasswordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29EC33191CE023D5005F0C13 /* ChangePasswordViewController.xib */; };
29EC331F1CE02AFA005F0C13 /* PopoverViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EC331E1CE02AFA005F0C13 /* PopoverViewController.m */; };
29EC33271CE07018005F0C13 /* opple_objc_json_client.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EC33261CE07018005F0C13 /* opple_objc_json_client.m */; };
86076CC959C487B30F69CC32 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18E6D8479D48A4650167EAF2 /* libPods.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -87,6 +91,7 @@ ...@@ -87,6 +91,7 @@
0447085D1CD7C06B00555827 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; }; 0447085D1CD7C06B00555827 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
0447085F1CD7C1E800555827 /* MainSetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainSetViewController.h; sourceTree = "<group>"; }; 0447085F1CD7C1E800555827 /* MainSetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainSetViewController.h; sourceTree = "<group>"; };
044708601CD7C1E800555827 /* MainSetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainSetViewController.m; sourceTree = "<group>"; }; 044708601CD7C1E800555827 /* MainSetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainSetViewController.m; sourceTree = "<group>"; };
18E6D8479D48A4650167EAF2 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
2906B5D51CD89246000849B4 /* ClientDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientDetailsTableViewCell.h; sourceTree = "<group>"; }; 2906B5D51CD89246000849B4 /* ClientDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientDetailsTableViewCell.h; sourceTree = "<group>"; };
2906B5D61CD89246000849B4 /* ClientDetailsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientDetailsTableViewCell.m; sourceTree = "<group>"; }; 2906B5D61CD89246000849B4 /* ClientDetailsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClientDetailsTableViewCell.m; sourceTree = "<group>"; };
2928F7E21CD085F40036D761 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; }; 2928F7E21CD085F40036D761 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
...@@ -211,9 +216,15 @@ ...@@ -211,9 +216,15 @@
29EAAEA81CDC7FE800C4DBA2 /* AllCutomerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllCutomerTableViewCell.h; sourceTree = "<group>"; }; 29EAAEA81CDC7FE800C4DBA2 /* AllCutomerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllCutomerTableViewCell.h; sourceTree = "<group>"; };
29EAAEA91CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AllCutomerTableViewCell.m; sourceTree = "<group>"; }; 29EAAEA91CDC7FE800C4DBA2 /* AllCutomerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AllCutomerTableViewCell.m; sourceTree = "<group>"; };
29EAAEAB1CDCA28300C4DBA2 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = "<group>"; }; 29EAAEAB1CDCA28300C4DBA2 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = "<group>"; };
29EC33171CE023D5005F0C13 /* ChangePasswordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangePasswordViewController.h; sourceTree = "<group>"; };
29EC33181CE023D5005F0C13 /* ChangePasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChangePasswordViewController.m; sourceTree = "<group>"; };
29EC33191CE023D5005F0C13 /* ChangePasswordViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ChangePasswordViewController.xib; sourceTree = "<group>"; };
29EC331D1CE02AFA005F0C13 /* PopoverViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverViewController.h; sourceTree = "<group>"; };
29EC331E1CE02AFA005F0C13 /* PopoverViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverViewController.m; sourceTree = "<group>"; };
29EC33251CE07018005F0C13 /* opple_objc_json_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opple_objc_json_client.h; sourceTree = "<group>"; };
29EC33261CE07018005F0C13 /* opple_objc_json_client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = opple_objc_json_client.m; sourceTree = "<group>"; };
CA5ED00287EA4EE622158E3C /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; CA5ED00287EA4EE622158E3C /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
D537F80EFAB9298B3ADA241A /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; D537F80EFAB9298B3ADA241A /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
DDC80D439AC474587DD59064 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -221,7 +232,7 @@ ...@@ -221,7 +232,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
745C665EA695DD3EC6271ADE /* libPods.a in Frameworks */, 86076CC959C487B30F69CC32 /* libPods.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -310,6 +321,8 @@ ...@@ -310,6 +321,8 @@
2928F7DE1CD085430036D761 /* Tools */ = { 2928F7DE1CD085430036D761 /* Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
29EC33241CE06FD1005F0C13 /* Jastor */,
29EC331C1CE02ADC005F0C13 /* popoverController */,
29EAAEAB1CDCA28300C4DBA2 /* city.json */, 29EAAEAB1CDCA28300C4DBA2 /* city.json */,
2949BABF1CD305340049385A /* MMDrawerManager */, 2949BABF1CD305340049385A /* MMDrawerManager */,
2949BAC31CD3086F0049385A /* weibo.png */, 2949BAC31CD3086F0049385A /* weibo.png */,
...@@ -585,6 +598,9 @@ ...@@ -585,6 +598,9 @@
29834EC21CDF76C1001A484F /* UserViewController.h */, 29834EC21CDF76C1001A484F /* UserViewController.h */,
29834EC31CDF76C1001A484F /* UserViewController.m */, 29834EC31CDF76C1001A484F /* UserViewController.m */,
29834EC41CDF76C1001A484F /* UserViewController.xib */, 29834EC41CDF76C1001A484F /* UserViewController.xib */,
29EC33171CE023D5005F0C13 /* ChangePasswordViewController.h */,
29EC33181CE023D5005F0C13 /* ChangePasswordViewController.m */,
29EC33191CE023D5005F0C13 /* ChangePasswordViewController.xib */,
); );
name = XXuserController; name = XXuserController;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -804,10 +820,28 @@ ...@@ -804,10 +820,28 @@
name = view; name = view;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
29EC331C1CE02ADC005F0C13 /* popoverController */ = {
isa = PBXGroup;
children = (
29EC331D1CE02AFA005F0C13 /* PopoverViewController.h */,
29EC331E1CE02AFA005F0C13 /* PopoverViewController.m */,
);
name = popoverController;
sourceTree = "<group>";
};
29EC33241CE06FD1005F0C13 /* Jastor */ = {
isa = PBXGroup;
children = (
29EC33251CE07018005F0C13 /* opple_objc_json_client.h */,
29EC33261CE07018005F0C13 /* opple_objc_json_client.m */,
);
name = Jastor;
sourceTree = "<group>";
};
4333C4B25549A396FC0CD944 /* Frameworks */ = { 4333C4B25549A396FC0CD944 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
DDC80D439AC474587DD59064 /* libPods.a */, 18E6D8479D48A4650167EAF2 /* libPods.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -898,6 +932,7 @@ ...@@ -898,6 +932,7 @@
29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */, 29834EC61CDF76C1001A484F /* UserViewController.xib in Resources */,
29706DB41CD082990003C412 /* Assets.xcassets in Resources */, 29706DB41CD082990003C412 /* Assets.xcassets in Resources */,
29706DAF1CD082990003C412 /* Main.storyboard in Resources */, 29706DAF1CD082990003C412 /* Main.storyboard in Resources */,
29EC331B1CE023D5005F0C13 /* ChangePasswordViewController.xib in Resources */,
29360C311CDDC487002A5D89 /* ScreeningView.xib in Resources */, 29360C311CDDC487002A5D89 /* ScreeningView.xib in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -957,6 +992,7 @@ ...@@ -957,6 +992,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
29EC331F1CE02AFA005F0C13 /* PopoverViewController.m in Sources */,
29BB276C1CD9DE74009A0813 /* FollowHeartViewController.m in Sources */, 29BB276C1CD9DE74009A0813 /* FollowHeartViewController.m in Sources */,
2928F8381CD09E730036D761 /* CustomButton.m in Sources */, 2928F8381CD09E730036D761 /* CustomButton.m in Sources */,
2998763F1CD9985B00C90D0A /* AttachmentInformationTableViewCell.m in Sources */, 2998763F1CD9985B00C90D0A /* AttachmentInformationTableViewCell.m in Sources */,
...@@ -990,12 +1026,14 @@ ...@@ -990,12 +1026,14 @@
29706DA61CD082990003C412 /* main.m in Sources */, 29706DA61CD082990003C412 /* main.m in Sources */,
29A938251CDAE31200F21E54 /* ProductDetailsHeaderView.m in Sources */, 29A938251CDAE31200F21E54 /* ProductDetailsHeaderView.m in Sources */,
299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */, 299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */,
29EC331A1CE023D5005F0C13 /* ChangePasswordViewController.m in Sources */,
2962D07D1CD1E4490058829D /* NSArray+Objectwithindex.m in Sources */, 2962D07D1CD1E4490058829D /* NSArray+Objectwithindex.m in Sources */,
299876391CD9981800C90D0A /* GoodsInformationTableViewCell.m in Sources */, 299876391CD9981800C90D0A /* GoodsInformationTableViewCell.m in Sources */,
2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */, 2949BABD1CD2EFA00049385A /* InformationTableViewCell.m in Sources */,
29706DB21CD082990003C412 /* Lighting.xcdatamodeld in Sources */, 29706DB21CD082990003C412 /* Lighting.xcdatamodeld in Sources */,
29834EB91CDF1FB3001A484F /* screeningFirstView.m in Sources */, 29834EB91CDF1FB3001A484F /* screeningFirstView.m in Sources */,
299249401CDB4D1D00786B1E /* AddaddressViewController.m in Sources */, 299249401CDB4D1D00786B1E /* AddaddressViewController.m in Sources */,
29EC33271CE07018005F0C13 /* opple_objc_json_client.m in Sources */,
299249371CDB3C6500786B1E /* GenerateOrdersViewController.m in Sources */, 299249371CDB3C6500786B1E /* GenerateOrdersViewController.m in Sources */,
2992493A1CDB3E4500786B1E /* GenerateOrdersTableViewCell.m in Sources */, 2992493A1CDB3E4500786B1E /* GenerateOrdersTableViewCell.m in Sources */,
2962D0811CD1E6010058829D /* UIView+Frame.m in Sources */, 2962D0811CD1E6010058829D /* UIView+Frame.m in Sources */,
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="muj-av-1uQ"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="muj-av-1uQ">
<rect key="frame" x="203" y="178" width="92" height="30"/> <rect key="frame" x="222" y="178" width="92" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="忘记密码?"> <state key="normal" title="忘记密码?">
...@@ -52,28 +52,36 @@ ...@@ -52,28 +52,36 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" id="Kpu-wY-Kir"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" id="Kpu-wY-Kir">
<rect key="frame" x="25" y="0.0" width="245" height="40"/> <rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.93725490199999995" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Lock-0" id="Kfr-XI-9d4">
<rect key="frame" x="10" y="12" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
</view> </view>
<view contentMode="scaleToFill" id="cXU-l9-ciP"> <view contentMode="scaleToFill" id="cXU-l9-ciP">
<rect key="frame" x="25" y="67" width="270" height="40"/> <rect key="frame" x="25" y="67" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账户名" textAlignment="natural" minimumFontSize="17" id="9uf-mj-khK"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账户名" textAlignment="natural" minimumFontSize="17" id="9uf-mj-khK">
<rect key="frame" x="27" y="0.0" width="245" height="40"/> <rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.93725490199999995" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="User-Profile" id="zFU-by-fY3">
<rect key="frame" x="10" y="12" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="0.7124683436" blue="0.054982668810000003" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
...@@ -86,7 +94,9 @@ ...@@ -86,7 +94,9 @@
<outlet property="forgotPasswordButton" destination="muj-av-1uQ" id="bGD-TM-2t6"/> <outlet property="forgotPasswordButton" destination="muj-av-1uQ" id="bGD-TM-2t6"/>
<outlet property="loginButton" destination="gRP-i4-Dn9" id="td3-dH-PmD"/> <outlet property="loginButton" destination="gRP-i4-Dn9" id="td3-dH-PmD"/>
<outlet property="passWord" destination="Kpu-wY-Kir" id="bjj-yD-hPz"/> <outlet property="passWord" destination="Kpu-wY-Kir" id="bjj-yD-hPz"/>
<outlet property="passWordBackview" destination="OwJ-fx-zq1" id="9sf-eC-K2U"/>
<outlet property="userName" destination="9uf-mj-khK" id="qn3-Uu-2RF"/> <outlet property="userName" destination="9uf-mj-khK" id="qn3-Uu-2RF"/>
<outlet property="userNameBackview" destination="cXU-l9-ciP" id="jft-mb-H7b"/>
<outlet property="userNameLoginView" destination="4F7-r1-Ukj" id="q2K-9l-FHt"/> <outlet property="userNameLoginView" destination="4F7-r1-Ukj" id="q2K-9l-FHt"/>
</connections> </connections>
</viewController> </viewController>
...@@ -96,6 +106,8 @@ ...@@ -96,6 +106,8 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="Lock-0" width="17" height="21"/>
<image name="User-Profile" width="17" height="17"/>
<image name="登录" width="1500" height="1125"/> <image name="登录" width="1500" height="1125"/>
</resources> </resources>
</document> </document>
{
"images" : [
{
"idiom" : "universal",
"filename" : "Checkmark.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Checkmark@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Checkmark@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Error.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Error@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Error@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Lock-0.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Lock-@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Mail.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Mail@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Phone.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Phone@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "User-Profile.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "User-Profile@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict/> <dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
......
...@@ -15,6 +15,7 @@ PODS: ...@@ -15,6 +15,7 @@ PODS:
- AFNetworking/UIKit (3.1.0): - AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- IQKeyboardManager (4.0.2) - IQKeyboardManager (4.0.2)
- jastor (0.2.1)
- Masonry (0.6.4) - Masonry (0.6.4)
- MBProgressHUD (0.9.2) - MBProgressHUD (0.9.2)
- MJExtension (3.0.10) - MJExtension (3.0.10)
...@@ -39,6 +40,7 @@ PODS: ...@@ -39,6 +40,7 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
- IQKeyboardManager (~> 4.0.0) - IQKeyboardManager (~> 4.0.0)
- jastor (~> 0.2.1)
- Masonry (~> 0.6.4) - Masonry (~> 0.6.4)
- MBProgressHUD (~> 0.9.2) - MBProgressHUD (~> 0.9.2)
- MJExtension (~> 3.0.10) - MJExtension (~> 3.0.10)
...@@ -50,6 +52,7 @@ DEPENDENCIES: ...@@ -50,6 +52,7 @@ DEPENDENCIES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
IQKeyboardManager: 2341089c4ae25fa2fa82ce356a259fcd267dc6b6 IQKeyboardManager: 2341089c4ae25fa2fa82ce356a259fcd267dc6b6
jastor: fe9ff71f4b683698253d6a0d9a2561987fd9aff3
Masonry: 281802d04d787ea2973179ee8bcb50500579ede2 Masonry: 281802d04d787ea2973179ee8bcb50500579ede2
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1 MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548 MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
/** /**
* MBProgressHUD等待视图 * MBProgressHUD等待视图
*/ */
- (void)CreateMBProgressHUDLoding:(NSString *)ShowText; - (void)CreateMBProgressHUDLoding;
/** /**
* 移除MBProgressHUD等待视图 * 移除MBProgressHUD等待视图
*/ */
- (void)RemoveMBProgressHUDLoding:(NSString *)Endstring; - (void)RemoveMBProgressHUDLoding;
/** /**
* 渐隐提示框待回调Block * 渐隐提示框待回调Block
...@@ -47,9 +47,15 @@ ...@@ -47,9 +47,15 @@
/**
* 成功等待视图
*/
- (void)SuccessMBProgressView:(NSString *)successString;
/**
* 失败等待视图
*/
- (void)ErrorMBProgressView:(NSString *)errorString;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#pragma mark -渐隐提示框回调 #pragma mark -渐隐提示框回调
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed - (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed
{ {
MBProgressHUD *hud = [[MBProgressHUD alloc]initWithView:self.view]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.labelText = Text; hud.labelText = Text;
hud.animationType = MBProgressHUDAnimationZoom; hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText; hud.mode = MBProgressHUDModeText;
...@@ -59,12 +59,8 @@ ...@@ -59,12 +59,8 @@
} }
#pragma mark -显示MBProgressHUD等待视图 #pragma mark -显示MBProgressHUD等待视图
- (void)CreateMBProgressHUDLoding:(NSString *)ShowText - (void)CreateMBProgressHUDLoding
{ {
if(ShowText==nil)
{
ShowText = @"加载中";
}
self.TCHud.animationType = MBProgressHUDAnimationZoom; self.TCHud.animationType = MBProgressHUDAnimationZoom;
self.TCHud.mode = MBProgressHUDModeIndeterminate; self.TCHud.mode = MBProgressHUDModeIndeterminate;
self.TCHud.color = [UIColor clearColor]; self.TCHud.color = [UIColor clearColor];
...@@ -73,15 +69,50 @@ ...@@ -73,15 +69,50 @@
} }
#pragma mark -移除MBProgressHUD等待视图 #pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding:(NSString *)Endstring; - (void)RemoveMBProgressHUDLoding;
{ {
if (Endstring != nil) {
self.TCHud.labelText = Endstring;
}
[self.TCHud hide:YES afterDelay:1]; [self.TCHud hide:YES afterDelay:1];
self.TCHud = nil; self.TCHud = nil;
} }
#pragma mark -显示成功的提示框
- (void)SuccessMBProgressView:(NSString *)successString
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
// Set the custom view mode to show any view.
hud.mode = MBProgressHUDModeCustomView;
// Set an image view with a checkmark.
UIImage *image = [[UIImage imageNamed:@"Checkmark"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
hud.customView = [[UIImageView alloc] initWithImage:image];
// Looks a bit nicer if we make it square.
hud.square = YES;
// Optional label text.
hud.activityIndicatorColor = kMainBlueColor;
hud.labelFont = [UIFont systemFontOfSize:12];
hud.labelText = successString;
[hud hide:YES afterDelay:1];
}
#pragma mark -显示错误的提示框
- (void)ErrorMBProgressView:(NSString *)errorString
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
// Set the custom view mode to show any view.
hud.mode = MBProgressHUDModeCustomView;
// Set an image view with a checkmark.
UIImage *image = [[UIImage imageNamed:@"Error"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
hud.customView = [[UIImageView alloc] initWithImage:image];
// Looks a bit nicer if we make it square.
hud.square = YES;
// Optional label text.
hud.activityIndicatorColor = kMainBlueColor;
hud.labelFont = [UIFont systemFontOfSize:12];
hud.labelText = errorString;
[hud hide:YES afterDelay:1];
}
#pragma mark -结束MJRfresh刷新 #pragma mark -结束MJRfresh刷新
- (void)endRefreshingForTableView:(UIScrollView *)TableView - (void)endRefreshingForTableView:(UIScrollView *)TableView
{ {
......
...@@ -7,12 +7,13 @@ ...@@ -7,12 +7,13 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "Jastor.h"
#import "opple_objc_json_client.h"
//定义返回数据的block类型 //定义返回数据的block类型
typedef void (^ReturnValueBlock) (id returnValue); typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (id errorCodeValue); typedef void (^ErrorCodeBlock) (id errorCodeValue);
typedef void (^FailureBlock)(); typedef void (^FailureBlock)(id error);
//定义请求类型 //定义请求类型
...@@ -46,7 +47,7 @@ typedef enum { ...@@ -46,7 +47,7 @@ typedef enum {
*/ */
- (void)NetworkRequestWithURL:(NSString *) requestURLString - (void)NetworkRequestWithURL:(NSString *) requestURLString
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter WithParameter:(Jastor *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock; WithFailureBlock:(FailureBlock) failureBlock;
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#import "NetworkRequestClassManager.h" #import "NetworkRequestClassManager.h"
#import "AppDelegate.h" #import "AppDelegate.h"
@implementation NetworkRequestClassManager @implementation NetworkRequestClassManager
...@@ -50,7 +52,7 @@ static NetworkRequestClassManager *manager = nil; ...@@ -50,7 +52,7 @@ static NetworkRequestClassManager *manager = nil;
- (void)NetworkRequestWithURL:(NSString *) requestURLString - (void)NetworkRequestWithURL:(NSString *) requestURLString
WithRequestType:(NetworkRequestType) requestType WithRequestType:(NetworkRequestType) requestType
WithParameter:(NSDictionary *) parameter WithParameter:(Jastor *) jastorobject
WithReturnValueBlock:(ReturnValueBlock) successBlock WithReturnValueBlock:(ReturnValueBlock) successBlock
WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock WithErrorCodeBlock:(ErrorCodeBlock) errorCodeBlock
WithFailureBlock:(FailureBlock) failureBlock WithFailureBlock:(FailureBlock) failureBlock
...@@ -58,8 +60,10 @@ static NetworkRequestClassManager *manager = nil; ...@@ -58,8 +60,10 @@ static NetworkRequestClassManager *manager = nil;
{ {
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.requestSerializer = [AFHTTPRequestSerializer serializer]; manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer]; manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.requestSerializer.timeoutInterval = 10.0f;
[manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
//网络检测 //网络检测
if (SHARED_APPDELEGATE.Networkstatus == false) { if (SHARED_APPDELEGATE.Networkstatus == false) {
...@@ -70,18 +74,19 @@ static NetworkRequestClassManager *manager = nil; ...@@ -70,18 +74,19 @@ static NetworkRequestClassManager *manager = nil;
if (requestType == 0) { if (requestType == 0) {
[manager POST:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [manager POST:requestURLString parameters:[jastorobject toDictionary] progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
successBlock(responseObject); successBlock(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failureBlock(error); failureBlock(error);
}]; }];
}else if (requestType == 1){ }else if (requestType == 1){
[manager GET:requestURLString parameters:parameter progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [manager GET:requestURLString parameters:[jastorobject toDictionary] progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
successBlock(responseObject); successBlock(responseObject);
......
//
// PopoverViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/9.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
/**
* 点击cell代理方法,返回indexpath.row
*/
@protocol ReturnTableviewcellIndexpathdelegate <NSObject>
- (void)returnCellindexpathwithrow:(NSInteger)index;
@end
@interface PopoverViewController : BaseViewController
/**
* 传入数据源
*/
@property (nonatomic,strong) NSArray *datasArray;
/**
* 代理
*/
@property (nonatomic,assign) id<ReturnTableviewcellIndexpathdelegate>delegate;
/**
* 传入CGsize
*/
@property (nonatomic,assign) CGSize contentSize;
@end
//
// PopoverViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/9.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PopoverViewController.h"
@interface PopoverViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView *popoverTableView;
@end
@implementation PopoverViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.popoverTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.contentSize.width, self.contentSize.height) style:UITableViewStylePlain];
self.popoverTableView.dataSource = self;
self.popoverTableView.delegate = self;
self.popoverTableView.tableFooterView = [UIView new];
[self.view addSubview:self.popoverTableView];
[self.popoverTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"popovercell"];
}
#pragma mark - UITableViewDataSource
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"popovercell" forIndexPath:indexPath];
cell.textLabel.text = [self.datasArray objectAtIndex_opple:indexPath.row];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.datasArray.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([self.delegate respondsToSelector:@selector(returnCellindexpathwithrow:)]) {
[self.delegate returnCellindexpathwithrow:indexPath.row];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
#import "ShoppingViewController.h" #import "ShoppingViewController.h"
#import "ClientViewController.h" #import "ClientViewController.h"
#import "Masonry.h" #import "Masonry.h"
#import "PopoverViewController.h"
#import "Jastor.h"
#import "opple_objc_json_client.h"
// Include any system framework and library headers here that should be included in all compilation units. // Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
...@@ -102,7 +105,7 @@ ...@@ -102,7 +105,7 @@
/** /**
* 默认圆角系数 * 默认圆角系数
*/ */
#define kCornerRadius 3 #define kCornerRadius 5
/** /**
...@@ -117,6 +120,11 @@ ...@@ -117,6 +120,11 @@
#define kSelectedCornerRadius 20 #define kSelectedCornerRadius 20
/**
* 服务器地址
*/
#define ServerAddress @"http://service.bloem.cn/opple-web/app"
......
This diff is collapsed.
#import "opple_objc_json_client.h"
@implementation PageRows
@synthesize page;
@synthesize rows;
@synthesize total;
@end
@implementation RsResponse
@synthesize code;
@synthesize message;
@synthesize data;
@end
@implementation LoginInfo
@synthesize username;
@synthesize password;
@end
@implementation ModifyPasswordRequest
@synthesize employeeId;
@synthesize oldPassword;
@synthesize Password;
@end
@implementation GoodsCategory
@synthesize identifier;
@synthesize name;
@synthesize children;
+ (Class)children_class {
return [GoodsCategory class];
}
@end
@implementation GoodsFilter
@synthesize styles;
@synthesize categories;
@synthesize space;
@synthesize material;
@synthesize price;
+ (Class)styles_class {
return [NSString class];
}
+ (Class)categories_class {
return [GoodsCategory class];
}
+ (Class)space_class {
return [NSString class];
}
+ (Class)material_class {
return [NSString class];
}
+ (Class)price_class {
return [NSDecimalNumber class];
}
@end
@implementation HotTagResponse
@synthesize list;
+ (Class)list_class {
return [TOHottagEntity class];
}
@end
@implementation OrderBill
@synthesize datapage;
@synthesize order;
@synthesize orderdetailList;
+ (Class)orderdetailList_class {
return [TOOrderdetailEntity class];
}
@end
@implementation SceneCondition
@synthesize styleEquals;
@synthesize spaceEquals;
@synthesize page;
@end
@implementation TOConsumerEntity
@synthesize identifier;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize sysOrgCode;
@synthesize name;
@synthesize mobile;
@synthesize province;
@synthesize city;
@synthesize country;
@synthesize address;
@synthesize picture;
@synthesize lastVisitedTime;
@end
@implementation TOHottagEntity
@synthesize identifier;
@synthesize name;
@end
@implementation TOOrderdetailEntity
@synthesize identifier;
@synthesize goodsId;
@synthesize goodsCode;
@synthesize goodsName;
@synthesize goodsCover;
@synthesize goodsSpec;
@synthesize goodsBrand;
@synthesize goodsNum;
@synthesize goodsPrice;
@synthesize goodsTotalPrice;
@synthesize orderId;
@end
@implementation TOShopcartEntity
@synthesize identifier;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize updateName;
@synthesize updateBy;
@synthesize updateDate;
@synthesize sysOrgCode;
@synthesize goodsId;
@synthesize goodsCode;
@synthesize goodsName;
@synthesize goodsCover;
@synthesize goodsSpec;
@synthesize goodsBrand;
@synthesize goodsSellerPrice;
@synthesize goodsNum;
@synthesize goodsPrice;
@synthesize goodsTotalPrice;
@synthesize consumerId;
@end
@implementation IdEntity
@synthesize identifier;
@end
#ifndef DEF_SortDirection_M
#define DEF_SortDirection_M
NSString * const SORTDIRECTION_ASC = @"asc";
NSString * const SORTDIRECTION_DESC = @"desc";
#endif /* DEF_SortDirection_M */
@implementation TOSceneEntity
@synthesize identifier;
@synthesize sceneCode;
@synthesize name;
@synthesize pricure;
@synthesize category;
@synthesize style;
@synthesize space;
@end
@implementation TOOrderEntity
@synthesize identifier;
@synthesize createName;
@synthesize createBy;
@synthesize createDate;
@synthesize updateName;
@synthesize updateBy;
@synthesize updateDate;
@synthesize sysOrgCode;
@synthesize orderNumber;
@synthesize orderTime;
@synthesize guideId;
@synthesize orderState;
@synthesize consumerId;
@synthesize goodsNum;
@synthesize orderPrice;
@synthesize receiverName;
@synthesize receiverMobile;
@synthesize receiverAddress;
@synthesize isBill;
@synthesize billType;
@synthesize billTitle;
@synthesize payType;
@end
@implementation TOGoodsEntity
@synthesize identifier;
@synthesize createDate;
@synthesize onlineTime;
@synthesize company;
@synthesize code;
@synthesize name;
@synthesize number;
@synthesize categoryId;
@synthesize brandId;
@synthesize keyword;
@synthesize guidePrice;
@synthesize tagPrice;
@synthesize costPrice;
@synthesize state;
@synthesize inv;
@synthesize detailedIntro;
@synthesize weight;
@synthesize unit;
@synthesize productProfile;
@synthesize power;
@synthesize colorTemperature;
@synthesize spec;
@synthesize function;
@synthesize material;
@synthesize lightSource;
@synthesize goodsStyle;
@synthesize series;
@synthesize area;
@synthesize size;
@synthesize space;
@synthesize installMethod;
@synthesize lightNumber;
@synthesize pictures;
@end
@implementation GoodsCondition
@synthesize nameLike;
@synthesize categoryEquals;
@synthesize styleEquals;
@synthesize spaceEquals;
@synthesize materialEqueals;
@synthesize startprice;
@synthesize endprice;
@synthesize page;
@end
@implementation ResetPasswordRequest
@synthesize username;
@synthesize smsCode;
@synthesize Password;
@end
@implementation LoginResult
@synthesize employee;
@synthesize commission;
@end
@implementation ConsumerQueryCondition
@synthesize nameEquals;
@synthesize nameLike;
@synthesize mobileEquals;
@synthesize page;
@end
@implementation ExceptionCode
@synthesize code;
@synthesize message;
@end
@implementation DataPage
@synthesize total;
@synthesize page;
@synthesize rows;
@synthesize sort;
@synthesize order;
@end
@implementation TSUserOrg
@synthesize tsUser;
@synthesize tsDepart;
@end
@implementation SceneResponse
@synthesize list;
+ (Class)list_class {
return [TOSceneEntity class];
}
@end
@implementation ShopCartResponse
@synthesize shopcart;
+ (Class)shopcart_class {
return [TOShopcartEntity class];
}
@end
@implementation TSBaseUser
@synthesize departid;
@synthesize signature;
@synthesize browser;
@synthesize userKey;
@synthesize status;
@synthesize activitiSync;
@synthesize password;
@synthesize userName;
@synthesize realName;
@synthesize currentDepart;
@synthesize userOrgList;
+ (Class)userOrgList_class {
return [TSUserOrg class];
}
@end
@implementation TSDepart
@synthesize TSPDepart;
@synthesize departname;
@synthesize description;
@synthesize TSDeparts;
@synthesize orgCode;
@synthesize orgType;
@synthesize mobile;
@synthesize fax;
@synthesize address;
+ (Class)TSDeparts_class {
return [TSDepart class];
}
@end
@implementation OrderResponse
@synthesize orderBillList;
+ (Class)orderBillList_class {
return [OrderBill class];
}
@end
@implementation GoodsResponse
@synthesize categories;
+ (Class)categories_class {
return [TOGoodsEntity class];
}
@end
@implementation ConsumerPageResult
@synthesize results;
+ (Class)results_class {
return [TOConsumerEntity class];
}
@end
@implementation TSUser
@synthesize signatureFile;
@synthesize mobilePhone;
@synthesize officePhone;
@synthesize email;
@synthesize createDate;
@synthesize createBy;
@synthesize createName;
@synthesize updateDate;
@synthesize updateBy;
@synthesize updateName;
@end
@implementation TOEmployee
@synthesize positions;
@end
...@@ -9,3 +9,4 @@ pod 'Masonry', '~> 0.6.4' ...@@ -9,3 +9,4 @@ pod 'Masonry', '~> 0.6.4'
pod 'MJRefresh', '~> 3.1.0' pod 'MJRefresh', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5' pod 'SDWebImage', '~> 3.7.5'
pod 'AFNetworking', '~> 3.1.0' pod 'AFNetworking', '~> 3.1.0'
pod 'jastor', '~> 0.2.1'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment