Commit 2f53445b authored by Sandy's avatar Sandy

客户管理 界面搭建

parent 66309bf1
......@@ -145,6 +145,10 @@
19DC6B2B1CC0CEDD0064A9FD /* MBTextFieldWithFontAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B231CC0CEDD0064A9FD /* MBTextFieldWithFontAdapter.m */; };
19DC6B2C1CC0CEDD0064A9FD /* MBTextViewWithFontAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B251CC0CEDD0064A9FD /* MBTextViewWithFontAdapter.m */; };
19DC6B2D1CC0CEDD0064A9FD /* MBFontAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B281CC0CEDD0064A9FD /* MBFontAdapter.m */; };
19DC6B361CC0D5FF0064A9FD /* CustomerManagementViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B351CC0D5FF0064A9FD /* CustomerManagementViewController.m */; };
19DC6B391CC0DB490064A9FD /* JavenSortView.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B381CC0DB490064A9FD /* JavenSortView.m */; };
19DC6B3D1CC0E06C0064A9FD /* CustomerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DC6B3B1CC0E06C0064A9FD /* CustomerTableViewCell.m */; };
19DC6B3E1CC0E06C0064A9FD /* CustomerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19DC6B3C1CC0E06C0064A9FD /* CustomerTableViewCell.xib */; };
19DCCB591C9A9EB30072C3BF /* IBTAudioController.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DCCB0C1C9A9EB30072C3BF /* IBTAudioController.m */; };
19DCCB5A1C9A9EB30072C3BF /* IBTAudioRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DCCB0E1C9A9EB30072C3BF /* IBTAudioRecorder.m */; };
19DCCB5B1C9A9EB30072C3BF /* IBTAudioServicesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 19DCCB101C9A9EB30072C3BF /* IBTAudioServicesManager.m */; };
......@@ -487,6 +491,13 @@
19DC6B251CC0CEDD0064A9FD /* MBTextViewWithFontAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBTextViewWithFontAdapter.m; sourceTree = "<group>"; };
19DC6B271CC0CEDD0064A9FD /* MBFontAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBFontAdapter.h; sourceTree = "<group>"; };
19DC6B281CC0CEDD0064A9FD /* MBFontAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBFontAdapter.m; sourceTree = "<group>"; };
19DC6B341CC0D5FF0064A9FD /* CustomerManagementViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomerManagementViewController.h; sourceTree = "<group>"; };
19DC6B351CC0D5FF0064A9FD /* CustomerManagementViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomerManagementViewController.m; sourceTree = "<group>"; };
19DC6B371CC0DB490064A9FD /* JavenSortView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenSortView.h; sourceTree = "<group>"; };
19DC6B381CC0DB490064A9FD /* JavenSortView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenSortView.m; sourceTree = "<group>"; };
19DC6B3A1CC0E06C0064A9FD /* CustomerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomerTableViewCell.h; sourceTree = "<group>"; };
19DC6B3B1CC0E06C0064A9FD /* CustomerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomerTableViewCell.m; sourceTree = "<group>"; };
19DC6B3C1CC0E06C0064A9FD /* CustomerTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomerTableViewCell.xib; sourceTree = "<group>"; };
19DCCACD1C9A9AD60072C3BF /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
19DCCB0B1C9A9EB30072C3BF /* IBTAudioController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IBTAudioController.h; sourceTree = "<group>"; };
19DCCB0C1C9A9EB30072C3BF /* IBTAudioController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IBTAudioController.m; sourceTree = "<group>"; };
......@@ -1162,6 +1173,8 @@
19632DAD1CB38FFC0024A8A1 /* HTTPCilent.m */,
191AEE171CBB83EF00F5E535 /* UserInfo.h */,
191AEE181CBB83EF00F5E535 /* UserInfo.m */,
19DC6B371CC0DB490064A9FD /* JavenSortView.h */,
19DC6B381CC0DB490064A9FD /* JavenSortView.m */,
);
path = Global;
sourceTree = "<group>";
......@@ -1277,6 +1290,32 @@
path = util;
sourceTree = "<group>";
};
19DC6B2E1CC0D5190064A9FD /* CustomerManagement */ = {
isa = PBXGroup;
children = (
19DC6B341CC0D5FF0064A9FD /* CustomerManagementViewController.h */,
19DC6B351CC0D5FF0064A9FD /* CustomerManagementViewController.m */,
);
path = CustomerManagement;
sourceTree = "<group>";
};
19DC6B2F1CC0D5260064A9FD /* CustomerManagement */ = {
isa = PBXGroup;
children = (
19DC6B3A1CC0E06C0064A9FD /* CustomerTableViewCell.h */,
19DC6B3B1CC0E06C0064A9FD /* CustomerTableViewCell.m */,
19DC6B3C1CC0E06C0064A9FD /* CustomerTableViewCell.xib */,
);
path = CustomerManagement;
sourceTree = "<group>";
};
19DC6B301CC0D5330064A9FD /* CustomerManagement */ = {
isa = PBXGroup;
children = (
);
path = CustomerManagement;
sourceTree = "<group>";
};
19DCCA851C9A95E70072C3BF /* Home */ = {
isa = PBXGroup;
children = (
......@@ -1290,6 +1329,7 @@
19DCCA861C9A95E70072C3BF /* Model */ = {
isa = PBXGroup;
children = (
19DC6B301CC0D5330064A9FD /* CustomerManagement */,
19DC6AFA1CBF867E0064A9FD /* JavenShopModel.h */,
19DC6AFB1CBF867E0064A9FD /* JavenShopModel.m */,
1900A3441CB6305100B2B7C4 /* Commodity */,
......@@ -1303,6 +1343,7 @@
19DCCA871C9A95E70072C3BF /* View */ = {
isa = PBXGroup;
children = (
19DC6B2F1CC0D5260064A9FD /* CustomerManagement */,
19DC6B101CC0ACB70064A9FD /* MyTeams */,
1900A3431CB6156F00B2B7C4 /* StoreManagerment */,
191383361CAB961B005F6440 /* Order */,
......@@ -1324,6 +1365,7 @@
19DCCA881C9A95E70072C3BF /* ViewController */ = {
isa = PBXGroup;
children = (
19DC6B2E1CC0D5190064A9FD /* CustomerManagement */,
19DC6B0C1CC0A9340064A9FD /* MyTeams */,
199B4D901CAE6F3500451E0E /* StoreManagerment */,
1979754E1CAB6F4700407E3F /* Order */,
......@@ -1779,6 +1821,7 @@
1900A3421CB6059000B2B7C4 /* introductionViewController.xib in Resources */,
199B4D6A1CABBEF400451E0E /* OrderDetailTopView.xib in Resources */,
199BC7B81C9ADD5500E4E0B8 /* ToLoginViewController.xib in Resources */,
19DC6B3E1CC0E06C0064A9FD /* CustomerTableViewCell.xib in Resources */,
1913833B1CAB96D4005F6440 /* OrderTableViewCell.xib in Resources */,
1979751C1CA8CDF300407E3F /* CommodityDetailBottomView.xib in Resources */,
19632DB31CB39B250024A8A1 /* SelectPhotoView.xib in Resources */,
......@@ -1916,6 +1959,7 @@
19DCCB721C9A9EB30072C3BF /* IBTUINavigationController.m in Sources */,
19DCCB641C9A9EB30072C3BF /* IBTTableViewUserInfo.m in Sources */,
19DCCBD91C9AA0450072C3BF /* IBTTextFieldCell.m in Sources */,
19DC6B391CC0DB490064A9FD /* JavenSortView.m in Sources */,
19DCCB741C9A9EB30072C3BF /* IBTUISearchBar.m in Sources */,
192861041CBF825100FA6E85 /* JavenOwner.m in Sources */,
19DCCBDB1C9AA0450072C3BF /* GXFButtonAndLineView.m in Sources */,
......@@ -1924,6 +1968,7 @@
191AEE111CBB818600F5E535 /* UserInfoCreateInfo.m in Sources */,
19ADD3801CA4D38B00EE6E5A /* SortView.m in Sources */,
191AEE881CBCF8E000F5E535 /* CommoditySearchViewController.m in Sources */,
19DC6B361CC0D5FF0064A9FD /* CustomerManagementViewController.m in Sources */,
19DCCBC81C9AA0450072C3BF /* NSMutableArray+SafeInsert.m in Sources */,
19DCCBFA1C9AA2180072C3BF /* UIActionSheet+Blocks.m in Sources */,
19DCCBCA1C9AA0450072C3BF /* NSString+TrimmingAdditions.m in Sources */,
......@@ -2001,6 +2046,7 @@
19DCCB651C9A9EB30072C3BF /* IBTBadgeView.m in Sources */,
19DCCBEF1C9AA1D50072C3BF /* QueryOrder.m in Sources */,
19DC6B0F1CC0AA7D0064A9FD /* MyTeamViewController.m in Sources */,
19DC6B3D1CC0E06C0064A9FD /* CustomerTableViewCell.m in Sources */,
19DCCB5E1C9A9EB30072C3BF /* IBTModel.m in Sources */,
19DCCBD51C9AA0450072C3BF /* UITableViewCell+Helper.m in Sources */,
19DC6B2C1CC0CEDD0064A9FD /* MBTextViewWithFontAdapter.m in Sources */,
......
//
// CustomerTableViewCell.h
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomerTableViewCell : UITableViewCell
@end
//
// CustomerTableViewCell.m
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CustomerTableViewCell.h"
@implementation CustomerTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="110" id="KGk-i7-Jjw" customClass="CustomerTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="375" height="110"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="375" height="109"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="team_icon" translatesAutoresizingMaskIntoConstraints="NO" id="pvt-ct-mi8">
<rect key="frame" x="13" y="18" width="94" height="73"/>
<constraints>
<constraint firstAttribute="width" constant="129" id="bHh-Wt-O1J"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="bHh-Wt-O1J"/>
</mask>
</variation>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="18253432522" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pwt-qX-7g4">
<rect key="frame" x="112" y="18" width="122" height="23"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单总数:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5XS-Sk-n6g" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="112" y="56" width="85" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="8" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3bd-RB-h0V" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="197" y="56" width="11" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收入总计:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0K4-NW-0GC" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="216" y="56" width="85" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="32.89" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cfg-Yj-Odk" customClass="MBLabelWithFontAdapter">
<rect key="frame" x="301" y="56" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="3bd-RB-h0V" firstAttribute="leading" secondItem="5XS-Sk-n6g" secondAttribute="trailing" id="0Wo-I5-m3A"/>
<constraint firstItem="0K4-NW-0GC" firstAttribute="leading" secondItem="3bd-RB-h0V" secondAttribute="trailing" constant="8" id="777-Y1-0sK"/>
<constraint firstItem="Cfg-Yj-Odk" firstAttribute="centerY" secondItem="0K4-NW-0GC" secondAttribute="centerY" id="Aeu-AR-P9w"/>
<constraint firstItem="pwt-qX-7g4" firstAttribute="top" secondItem="pvt-ct-mi8" secondAttribute="top" id="BFk-3n-8Oz"/>
<constraint firstAttribute="bottomMargin" secondItem="pvt-ct-mi8" secondAttribute="bottom" constant="10" id="JuT-Dm-8nM"/>
<constraint firstItem="5XS-Sk-n6g" firstAttribute="leading" secondItem="pwt-qX-7g4" secondAttribute="leading" id="VIi-vp-LNf"/>
<constraint firstItem="3bd-RB-h0V" firstAttribute="centerY" secondItem="5XS-Sk-n6g" secondAttribute="centerY" id="Zcq-dD-Ld6"/>
<constraint firstItem="0K4-NW-0GC" firstAttribute="centerY" secondItem="5XS-Sk-n6g" secondAttribute="centerY" id="fxJ-cS-7rA"/>
<constraint firstItem="pwt-qX-7g4" firstAttribute="leading" secondItem="pvt-ct-mi8" secondAttribute="trailing" constant="5" id="gur-Ai-o3L"/>
<constraint firstAttribute="bottomMargin" secondItem="5XS-Sk-n6g" secondAttribute="bottom" constant="24" id="q9w-IX-k6y"/>
<constraint firstItem="Cfg-Yj-Odk" firstAttribute="leading" secondItem="0K4-NW-0GC" secondAttribute="trailing" id="qYK-QT-W1E"/>
<constraint firstItem="pvt-ct-mi8" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="5" id="v4x-dD-DNg"/>
<constraint firstItem="pvt-ct-mi8" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="10" id="yLM-1G-dB1"/>
</constraints>
</tableViewCellContentView>
<point key="canvasLocation" x="307.5" y="338"/>
</tableViewCell>
</objects>
<resources>
<image name="team_icon" width="94" height="94"/>
</resources>
</document>
......@@ -7,10 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "JavenShopModel.h"
@interface HomeTopView : UIView
- (void)updateTopViewInfo:(id)userInfo;
- (void)updateTopViewInfo:(JavenShopModel *)shop;
@end
......@@ -21,10 +21,10 @@
- (void)updateTopViewInfo:(id)userInfo {
- (void)updateTopViewInfo:(JavenShopModel *)shop {
[self.imageViewUserIcon sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
self.labelName.text = @"";
self.labelSubTitle.text = @"";
self.labelName.text = shop.name;
self.labelSubTitle.text = shop.internalBaseClassDescription;
}
/*
// Only override drawRect: if you perform custom drawing.
......
//
// CustomerManagementViewController.h
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface CustomerManagementViewController : IBTUIViewController
@end
//
// CustomerManagementViewController.m
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CustomerManagementViewController.h"
#import "UITableView+Category.h"
#import "JavenSortView.h"
#import "CustomerTableViewCell.h"
#define kCellId @"CustomerTableViewCell.h"
@interface CustomerManagementViewController ()<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UISearchBar *searchBar;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) JavenSortView *sortView;
@end
@implementation CustomerManagementViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = kBacroundColor;
[self setUpSearchBar];
[self setUpSortView];
[self setUptableView];
// Do any additional setup after loading the view.
}
- (void)setUpSearchBar {
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth - 60, 35)];//allocate titleView
UIColor *color = self.navigationController.navigationBar.barTintColor;
[titleView setBackgroundColor:color];
self.searchBar = [[UISearchBar alloc] init];
self.searchBar.tintColor = kTextColorLiteGray;
self.searchBar.backgroundColor = kRandomColor;
self.searchBar.delegate = self;
self.searchBar.placeholder = @"请输入手机号";
self.searchBar.frame = CGRectMake(0, 0, kWidth - 60, 35);
self.searchBar.centerX = titleView.centerX;
self.searchBar.backgroundImage = [UIImage imageWithColor:color];
[titleView addSubview:self.searchBar];
self.navigationItem.titleView = titleView;
}
- (void)setUpSortView {
NSArray *arrLeftTitles = @[@"全部客户",@"今日新增客户",@"本周新增客户"];
NSArray *arrRightTitles = @[@"默认排序",@"订单数从高到低",@"收入从高到低"];
self.sortView = [JavenSortView sortViewLeftTitles:arrLeftTitles rightTitles:arrRightTitles];
self.sortView.frame = CGRectMake(0, 0, kWidth, 40);
[self.view addSubview:self.sortView];
}
- (void)setUptableView {
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"CustomerTableViewCell" cellId:kCellId];
[self.view addSubview:self.tableView];
self.tableView.sd_layout.topSpaceToView(self.sortView,0).leftEqualToView(self.view).rightEqualToView(self.view).bottomEqualToView(self.view);
}
#pragma mark =========== tableview delegate ===========
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId forIndexPath:indexPath];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 110;
}
#pragma mark =========== searchbar delegate ===========
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
[self.searchBar endEditing:YES];
}
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
self.searchBar.showsCancelButton = YES;
return YES;
}
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar
{
self.searchBar.showsCancelButton = NO;
return YES;
}
- (void)cancelSearchAction {
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -16,6 +16,8 @@
#import "OrderViewController.h"
#import "StoreManagermentViewController.h"
#import "MyTeamViewController.h"
#import "CustomerManagementViewController.h"
#define kHomeCollectionViewID @"HomeCollectionViewID"
#define kCollectionViewHeadHeight 350
......@@ -141,7 +143,10 @@
break;
case 2://客户管理
{
CustomerManagementViewController *customerVC = [[CustomerManagementViewController alloc] init];
customerVC.isShowNavigationBar = YES;
customerVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:customerVC animated:YES];
}
break;
......@@ -149,6 +154,7 @@
{
MyTeamViewController *myTeamVC = [[MyTeamViewController alloc] init];
myTeamVC.isShowNavigationBar = YES;
myTeamVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:myTeamVC animated:YES];
}
......
......@@ -11,7 +11,7 @@
#import "HomeCollectionViewController.h"
#import "JavenShopModel.h"
@interface HomeViewController ()
@property (nonatomic, strong) HomeTopView *viewHomeTop;
@property (nonatomic, strong) JavenShopModel *shopModel;
@end
......@@ -39,7 +39,7 @@
weakSelf.shopModel = [JavenShopModel modelObjectWithDictionary:responseObject[@"shop"]];
}
CLog(@"%p",weakSelf.shopModel);
[weakSelf.viewHomeTop updateTopViewInfo:weakSelf.shopModel];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
......@@ -48,6 +48,7 @@
- (void)setUpView {
HomeTopView *viewHomeTop = [HomeTopView viewWithNibName:@"HomeTopView"];
self.viewHomeTop = viewHomeTop;
[self.view addSubview:viewHomeTop];
viewHomeTop.sd_layout.topEqualToView(self.view).leftEqualToView(self.view).rightEqualToView(self.view).heightIs(150);
[viewHomeTop updateLayout];
......
......@@ -30,7 +30,7 @@
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 1;
layout.itemSize = CGSizeMake(kWidth / 3, kWidth * 2 / 3);
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64 - 49) collectionViewLayout:layout];
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64) collectionViewLayout:layout];
self.collectionView.contentInset = UIEdgeInsetsMake(140, 0, 0, 0);
self.collectionView.backgroundColor = kBacroundColor;
self.collectionView.delegate = self;
......
......@@ -82,12 +82,14 @@
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[HTTPCilent shareCilent] POST:@"app/resellerRegister" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
ToLoginViewController *toLoginVC = [[ToLoginViewController alloc] initWithNibName:@"ToLoginViewController" bundle:[NSBundle mainBundle]];
[weakSelf.navigationController pushViewController:toLoginVC animated:YES];
[[NSUserDefaults standardUserDefaults] setObject:weakSelf.phoneNumberTextFiled.text forKey:@"userName"];
[[NSUserDefaults standardUserDefaults] setObject:[weakSelf.passwordTextFiled.text MD5String] forKey:@"passWord"];
[[NSUserDefaults standardUserDefaults] synchronize];
[weakSelf.navigationController popViewControllerAnimated:YES];
[MBProgressHUD hideHUDForView:self.view animated:YES];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
}
......
......@@ -47,7 +47,7 @@
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[weakSelf presentViewController:baseVC animated:YES completion:nil];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
......
......@@ -100,6 +100,7 @@
// 快速显示一个提示信息
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.labelText = message;
hud.mode = MBProgressHUDModeText;
// 隐藏时候从父控件中移除
hud.removeFromSuperViewOnHide = YES;
// YES代表需要蒙版效果
......
//
// JavenSortView.h
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^sortBlock)(BOOL);
typedef void (^selectedRow)(NSInteger);
@interface JavenSortView : UIView
@property (nonatomic, copy) sortBlock leftSortAction;
@property (nonatomic, copy) sortBlock rightAction;
@property (nonatomic, copy) selectedRow rightTableSelect;
@property (nonatomic, copy) selectedRow leftTableSelect;
+ (instancetype)sortViewLeftTitles:(NSArray *)leftTitles rightTitles:(NSArray *)rightTitles;
- (void)hide;;
- (void)defaultSelectISLeft:(BOOL)isLeft row:(NSInteger)row;
@end
//
// JavenSortView.m
// ALand
//
// Created by Z on 16/4/15.
// Copyright © 2016年 Z. All rights reserved.
//
#import "JavenSortView.h"
#import "CoverShadowView.h"
#import "IBTUIViewController.h"
@interface JavenSortView ()
<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, assign) CGFloat clickCount;
@property (nonatomic, assign) CGFloat rightClickCount;
@property (nonatomic, strong) CoverShadowView *coverView;
@property (nonatomic, strong) UIButton *leftBtn;
@property (nonatomic, strong) UIButton *rightBtn;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *arrTitles;
@property (nonatomic, strong) NSArray *arrLeft;
@property (nonatomic, strong) NSArray *arrRight;
@property (nonatomic, assign) NSInteger selectedMark;
@property (nonatomic, strong) CoverShadowView *viewTopCover;
@property (nonatomic, assign) BOOL isTableOpen;
@property (nonatomic, assign) BOOL isLeft;
@property (nonatomic, assign) BOOL isLeftOpen;
@end
@implementation JavenSortView
+ (instancetype)sortViewLeftTitles:(NSArray *)leftTitles rightTitles:(NSArray *)rightTitles
{
JavenSortView *sortView = [[JavenSortView alloc] initSortViewLeftTitles:leftTitles rightTitles:rightTitles];
return sortView;
}
- (instancetype)initSortViewLeftTitles:(NSArray *)leftTitles rightTitles:(NSArray *)rightTitles {
self = [super init];
self.arrLeft = leftTitles;
self.arrRight = rightTitles;
UIView *grayLine = [UIView new];
[self addSubview:grayLine];
grayLine.sd_layout.topSpaceToView(self, 5).bottomSpaceToView(self, 5).centerXEqualToView(self).centerYEqualToView(self).widthIs(1);
grayLine.backgroundColor = kBacroundColor;
self.backgroundColor = kSysWhite;
UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self addSubview:leftButton];
self.leftBtn = leftButton;
[leftButton setTitle:[NSString stringWithFormat:@"%@ ", leftTitles[0]] forState:UIControlStateNormal];
[leftButton setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[leftButton setImage:[UIImage imageNamed:@"downIcon"] forState:UIControlStateNormal];
[leftButton addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
leftButton.imageView.tintColor = kTextColorGray;
leftButton.imageEdgeInsets = UIEdgeInsetsMake(0, 115, 0, 0);
leftButton.sd_layout.topEqualToView(self).leftEqualToView(self).rightSpaceToView(grayLine,0).bottomEqualToView(self);
[leftButton updateLayout];
self.rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self addSubview:self.rightBtn];
[self.rightBtn setTitle:[NSString stringWithFormat:@"%@ ", rightTitles[0]] forState:UIControlStateNormal];
[self.rightBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[self.rightBtn setImage:[UIImage imageNamed:@"downIcon"] forState:UIControlStateNormal];
self.rightBtn.imageView.tintColor = kTextColorGray;
self.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 115, 0, 0); self.rightBtn.sd_layout.leftSpaceToView(grayLine,0).topEqualToView(self).bottomEqualToView(self).rightEqualToView(self);
[self.rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
UIView *viewGrayBottom = [UIView new];
viewGrayBottom.backgroundColor = kCutLineColorLiteGray;
[self addSubview:viewGrayBottom];
viewGrayBottom.sd_layout.bottomEqualToView(self).leftEqualToView(self).rightEqualToView(self).heightIs(1);
return self;
}
- (CoverShadowView *)coverView {
if (!_coverView) {
_coverView = [[CoverShadowView alloc] initWithSpaceToTop:self.bottom + 64];
[self.window addSubview:_coverView];
WS(weakSelf)
_coverView.tapAction = ^{
[weakSelf hide];
};
}
return _coverView;
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.bottom + 64, ScreenSize.width, 0) style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"reuseIdentifier"];
[self.window addSubview:_tableView];
[self showTableView];
}
return _tableView;
}
#pragma mark ==============animate==============
- (void)showTableView {
[self.coverView show];
[self setOtherUserInteraction:NO];
WS(weakSelf)
self.isTableOpen = YES;
[UIView animateWithDuration:0.3 delay:0 options:(UIViewAnimationOptionCurveEaseIn) animations:^{
weakSelf.tableView.height = 44 * weakSelf.arrTitles.count;
[weakSelf.tableView reloadData];
} completion:nil];
}
- (void)hideTableView {
[self.coverView hide];
[self setOtherUserInteraction:YES];
self.isTableOpen = NO;
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.tableView.height = 0;
}];
}
//设置界面上其它的按钮是否可以点击
- (void)setOtherUserInteraction:(BOOL)state {
// [self viewController].navigationItem.leftBarButtonItem.enabled = state;
// [self viewController].navigationItem.rightBarButtonItem.enabled = state;
//[self viewController].view.userInteractionEnabled = state;
}
#pragma mark ==============table delegate==============
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return self.arrTitles.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
self.selectedMark = indexPath.row;
[tableView reloadData];
NSString *space;
if (self.arrTitles == self.arrLeft) {
space = @"left";
[self leftAction:nil];
[self setLeftBtnTitle:self.arrTitles[indexPath.row]];
[self.leftBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
[self.rightBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
self.leftTableSelect(indexPath.row);
self.isLeft = YES;
}else{
space = @"right";
[self rightBtnAction];
[self.rightBtn setTitle:[NSString stringWithFormat:@"%@ ",self.arrTitles[indexPath.row]] forState:UIControlStateNormal];
[self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
self.rightTableSelect(indexPath.row);
self.isLeft = NO;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];
cell.textLabel.text = self.arrTitles[indexPath.row];
// Configure the cell...
cell.tintColor = kCustomGreenColor;
if (self.isLeft == self.isLeftOpen) {
if (self.selectedMark == indexPath.row) {
cell.textLabel.textColor = kCustomGreenColor;
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
}else{
cell.textLabel.textColor = [UIColor blackColor];
[cell setAccessoryType:UITableViewCellAccessoryNone];
}
}else{
cell.textLabel.textColor = [UIColor blackColor];
[cell setAccessoryType:UITableViewCellAccessoryNone];
}
return cell;
}
- (void)setLeftBtnTitle:(NSString *)str {
//只是为了让标题位置正确
[self.leftBtn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];
if (str.length > 4) {
self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 130, 0, 0);
self.leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
}else{
self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 115, 0, 0);
self.leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
}
}
- (void)leftAction:(UIButton *)btn {
[self rightIconAnimateToDefault];
_arrTitles = _arrLeft;
if (self.clickCount != M_PI) {
[self showTableView];
self.isLeftOpen = YES;
}else{
[self hideTableView];
self.isLeftOpen = NO;
}
[self iconAnimate];
}
- (void)rightBtnAction {
[self leftIconAnimateToDefault];
_arrTitles = _arrRight;
if (self.rightClickCount != M_PI) {
[self showTableView];
self.isLeftOpen = NO;
}else{
[self hideTableView];
self.isLeftOpen = NO;
}
[self rightIconAnimate];
}
#pragma mark =========== animate ===========
//控制左边的按钮上的剪头动画
- (void)iconAnimate {
self.clickCount = self.clickCount + M_PI;
if (self.clickCount > M_PI * 2 ) {
self.clickCount = M_PI;
}
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.leftBtn.imageView.transform = CGAffineTransformMakeRotation(weakSelf.clickCount);
}];
}
- (void)leftIconAnimateToDefault {
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.leftBtn.imageView.transform = CGAffineTransformMakeRotation(M_PI);
}];
}
- (void)rightIconAnimateToDefault {
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.rightBtn.imageView.transform = CGAffineTransformMakeRotation(M_PI);
}];
}
- (void)rightIconAnimate {
self.rightClickCount = self.rightClickCount + M_PI;
if (self.rightClickCount > M_PI * 2 ) {
self.rightClickCount = M_PI;
}
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
weakSelf.rightBtn.imageView.transform = CGAffineTransformMakeRotation(weakSelf.rightClickCount);
}];
}
- (UIViewController *)viewController
{
for (UIView* next = [self superview]; next; next = next.superview) {
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[IBTUIViewController class]]) {
return (UIViewController *)nextResponder;
}
}
return nil;
}
- (void)hide {
if (self.isTableOpen == YES) {
if (_arrTitles == _arrLeft) {
[self leftAction:nil];
}else{
[self rightBtnAction];
}
}
}
- (void)defaultSelectISLeft:(BOOL)isLeft row:(NSInteger)row
{
if (isLeft) {
self.isLeft = YES;
self.arrTitles = self.arrLeft;
[self setLeftBtnTitle:self.arrTitles[row]];
[self.leftBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
[self.rightBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
self.isLeft = YES;
}else{
self.isLeft = NO;
self.arrTitles = self.arrRight;
[self.rightBtn setTitle:[NSString stringWithFormat:@"%@ ",self.arrTitles[row]] forState:UIControlStateNormal];
[self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
[self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
self.isLeft = NO;
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
......@@ -74,6 +74,8 @@
}
- (void)popAction {
[self.view endEditing:YES];
[self.navigationController.navigationBar endEditing:YES];
[self.navigationController popViewControllerAnimated:YES];
}
......
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