Commit c0e7f861 authored by admin's avatar admin

2.4接口完成匹配 登陆界面 我的界面完成

parent 024655c3
......@@ -80,7 +80,6 @@
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84ED5DD71BF2E64300A1BB6D /* ScreenView.m */; };
84F1669B1BE715E40061D350 /* ZanButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F1669A1BE715E40061D350 /* ZanButton.m */; };
84F30DA41BFC19F200CBAD13 /* RankListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F30DA31BFC19F200CBAD13 /* RankListModel.m */; };
84F30DA71BFC1A8E00CBAD13 /* RankCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F30DA61BFC1A8E00CBAD13 /* RankCommentModel.m */; };
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F57C451BEC388A00DDEEB1 /* CommentView.m */; };
84F57C4C1BEC785E00DDEEB1 /* AddQuestionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F57C4B1BEC785E00DDEEB1 /* AddQuestionViewController.m */; };
84F57C501BEC7AA300DDEEB1 /* AddQuestionFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84F57C4F1BEC7AA300DDEEB1 /* AddQuestionFooterView.m */; };
......@@ -257,8 +256,6 @@
84F1669A1BE715E40061D350 /* ZanButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZanButton.m; sourceTree = "<group>"; };
84F30DA21BFC19F200CBAD13 /* RankListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankListModel.h; sourceTree = "<group>"; };
84F30DA31BFC19F200CBAD13 /* RankListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankListModel.m; sourceTree = "<group>"; };
84F30DA51BFC1A8E00CBAD13 /* RankCommentModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankCommentModel.h; sourceTree = "<group>"; };
84F30DA61BFC1A8E00CBAD13 /* RankCommentModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankCommentModel.m; sourceTree = "<group>"; };
84F57C441BEC388A00DDEEB1 /* CommentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentView.h; sourceTree = "<group>"; };
84F57C451BEC388A00DDEEB1 /* CommentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentView.m; sourceTree = "<group>"; };
84F57C4A1BEC785E00DDEEB1 /* AddQuestionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddQuestionViewController.h; sourceTree = "<group>"; };
......@@ -1156,8 +1153,6 @@
children = (
84F30DA21BFC19F200CBAD13 /* RankListModel.h */,
84F30DA31BFC19F200CBAD13 /* RankListModel.m */,
84F30DA51BFC1A8E00CBAD13 /* RankCommentModel.h */,
84F30DA61BFC1A8E00CBAD13 /* RankCommentModel.m */,
);
path = Model;
sourceTree = "<group>";
......@@ -1480,7 +1475,6 @@
buildActionMask = 2147483647;
files = (
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */,
84F30DA71BFC1A8E00CBAD13 /* RankCommentModel.m in Sources */,
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */,
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
......
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "progress-bar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "progress-bar@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "launch_bg_6plus-2.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "launch_bg_6plus-3.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "launch_bg_6-1.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_4.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "launch_bg_6plus-1.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_6.png",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_6plus.png",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "home_logo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "home_logo@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "launch_bg_4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "launch_bg_6plus.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "管理在线平台@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "管理在线平台@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "空白页_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "空白页_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--View Controller-->
......@@ -16,8 +17,104 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch_bg_4" translatesAutoresizingMaskIntoConstraints="NO" id="DpZ-WN-H0P">
<rect key="frame" x="20" y="20" width="560" height="580"/>
<animations/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="title_login" translatesAutoresizingMaskIntoConstraints="NO" id="A2i-wB-g8r">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="26" id="Euo-Fo-mch"/>
<constraint firstAttribute="width" constant="171" id="itp-Ya-XEp"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="Euo-Fo-mch"/>
<exclude reference="itp-Ya-XEp"/>
</mask>
</variation>
<variation key="heightClass=regular">
<mask key="constraints">
<include reference="Euo-Fo-mch"/>
<include reference="itp-Ya-XEp"/>
</mask>
</variation>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_logo" translatesAutoresizingMaskIntoConstraints="NO" id="oO6-pH-ZSn">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="54" id="YJp-uR-hyx"/>
<constraint firstAttribute="width" constant="176" id="ssE-aF-0QO"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="YJp-uR-hyx"/>
<exclude reference="ssE-aF-0QO"/>
</mask>
</variation>
<variation key="heightClass=regular">
<mask key="constraints">
<include reference="YJp-uR-hyx"/>
<include reference="ssE-aF-0QO"/>
</mask>
</variation>
</imageView>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="DpZ-WN-H0P" firstAttribute="top" secondItem="Llm-lL-Icb" secondAttribute="bottom" id="4id-99-KLr"/>
<constraint firstAttribute="trailingMargin" secondItem="DpZ-WN-H0P" secondAttribute="trailing" constant="-20" id="6Cg-Wn-KOF"/>
<constraint firstItem="oO6-pH-ZSn" firstAttribute="centerX" secondItem="DpZ-WN-H0P" secondAttribute="centerX" id="729-ca-TzT"/>
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="DpZ-WN-H0P" secondAttribute="bottom" id="Bhr-0K-M5s"/>
<constraint firstAttribute="trailingMargin" secondItem="DpZ-WN-H0P" secondAttribute="trailing" id="M0q-LH-WaU"/>
<constraint firstItem="A2i-wB-g8r" firstAttribute="top" secondItem="oO6-pH-ZSn" secondAttribute="bottom" constant="34" id="Qd5-HS-fXa"/>
<constraint firstItem="xb3-aO-Qok" firstAttribute="top" secondItem="DpZ-WN-H0P" secondAttribute="bottom" id="VVT-Q7-nEb"/>
<constraint firstItem="DpZ-WN-H0P" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" id="YGe-3w-0mr"/>
<constraint firstItem="DpZ-WN-H0P" firstAttribute="top" secondItem="oO6-pH-ZSn" secondAttribute="bottom" constant="-268" id="eKJ-2Z-k4t"/>
<constraint firstItem="A2i-wB-g8r" firstAttribute="centerX" secondItem="DpZ-WN-H0P" secondAttribute="centerX" id="mKu-nv-35U"/>
<constraint firstItem="DpZ-WN-H0P" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="topMargin" id="pRk-mv-AsV"/>
<constraint firstItem="DpZ-WN-H0P" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" constant="-20" id="tTA-i8-RmJ"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="A2i-wB-g8r"/>
<exclude reference="oO6-pH-ZSn"/>
</mask>
<mask key="constraints">
<exclude reference="6Cg-Wn-KOF"/>
<exclude reference="eKJ-2Z-k4t"/>
<exclude reference="pRk-mv-AsV"/>
<exclude reference="tTA-i8-RmJ"/>
<exclude reference="729-ca-TzT"/>
<exclude reference="Qd5-HS-fXa"/>
<exclude reference="mKu-nv-35U"/>
<exclude reference="Bhr-0K-M5s"/>
</mask>
</variation>
<variation key="heightClass=regular">
<mask key="subviews">
<include reference="A2i-wB-g8r"/>
<include reference="oO6-pH-ZSn"/>
</mask>
<mask key="constraints">
<exclude reference="4id-99-KLr"/>
<include reference="6Cg-Wn-KOF"/>
<exclude reference="M0q-LH-WaU"/>
<exclude reference="YGe-3w-0mr"/>
<include reference="eKJ-2Z-k4t"/>
<include reference="pRk-mv-AsV"/>
<include reference="tTA-i8-RmJ"/>
<include reference="729-ca-TzT"/>
<include reference="Qd5-HS-fXa"/>
<include reference="mKu-nv-35U"/>
<include reference="Bhr-0K-M5s"/>
<exclude reference="VVT-Q7-nEb"/>
</mask>
</variation>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
......@@ -25,4 +122,9 @@
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="home_logo" width="176" height="54"/>
<image name="launch_bg_4" width="640" height="960"/>
<image name="title_login" width="170" height="25"/>
</resources>
</document>
......@@ -51,7 +51,7 @@
-(void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
......
......@@ -34,6 +34,16 @@
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
self.titleArray = [NSArray arrayWithObjects:@"选择对应专业组", @"选择问题分类", nil];
[self addTableView];
......@@ -49,6 +59,14 @@
}
#pragma mark - Private Methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)addTableView
{
[self.tableView registerClass:[OnLineTableViewCell class] forCellReuseIdentifier:kAddQuestionCell];
......
......@@ -68,6 +68,20 @@
[customLab setText:@"问题详情"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)addComment:(UIButton *)sender
......
......@@ -33,6 +33,16 @@
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
[self.tableView registerClass:[InspectSettleCell class] forCellReuseIdentifier:kInspectSettleCell];
self.tableView.tableFooterView = self.footerView;
......@@ -48,7 +58,11 @@
#pragma mark - private Methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - TakePhoto Delegate
- (void)takePhotoShowPicture:(UIButton *)btn
......
......@@ -19,14 +19,13 @@ typedef enum ProgressState : NSUInteger {
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, assign) ProgressState progressState; // 处理进度
@property (nonatomic, strong) UILabel *alreadyLabel;
@property (nonatomic, strong) UILabel *allLabel;
@property (nonatomic, assign) CGFloat multiplier; // 乘数
@property (nonatomic, strong) UIView *alreadyView;
@property (nonatomic, strong) UIImageView *alreadyView;
@property (nonatomic, strong) UIView *allView;
@property (nonatomic, strong) TaskListModel *taskList;
......
......@@ -48,9 +48,11 @@
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", taskList.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", taskList.questionCount];
self.multiplier = taskList.reportCount / taskList.questionCount;
self.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount;
self.allView.backgroundColor = kProgressViewAllBackColor;
self.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
if ([taskList.state isEqualToString:@"initial"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:未处理"];
......@@ -103,21 +105,6 @@
}
}
- (void)setProgressState:(ProgressState)progressState
{
_progressState = progressState;
if (_progressState == ProgressStateUnSettled) {
} else if (_progressState == ProgressStateDealWith) {
} else {
}
}
#pragma mark - lazy Loading
- (UILabel *)titleLabel
{
......@@ -286,10 +273,10 @@
return _allView;
}
- (UIView *)alreadyView
- (UIImageView *)alreadyView
{
if (!_alreadyView) {
_alreadyView = [[UIView alloc] init];
_alreadyView = [[UIImageView alloc] init];
_alreadyView.layer.cornerRadius = 3;
_alreadyView.layer.masksToBounds = YES;
_alreadyView.translatesAutoresizingMaskIntoConstraints = NO;
......
......@@ -101,7 +101,7 @@
self.detailView.shopnameLabel.text = [NSString stringWithFormat:@"%@", taskDetail.store_name];
self.detailView.startDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.beginDate];
self.detailView.overDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.endDate];
self.detailView.multiplier = taskDetail.reportCount / taskDetail.questionCount;
self.detailView.multiplier = (CGFloat)taskDetail.reportCount / taskDetail.questionCount;
if ([taskDetail.state isEqualToString:@"initial"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"未处理 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressUnSettledColor;
......
......@@ -284,7 +284,7 @@
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[self.allView addConstraint:overDateBottom];
NSLayoutConstraint *overDatewidth = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeWidth multiplier:_multiplier constant:0];
NSLayoutConstraint *overDatewidth = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeWidth multiplier:self.multiplier constant:0];
[self.allView addConstraint:overDatewidth];
}
......
......@@ -10,7 +10,6 @@
#import "InspectListCell.h"
@interface InspectTaskViewController : UIViewController
@property (nonatomic, assign) ProgressState progressState;
@property (nonatomic, assign) CGFloat multiplier;
@property (nonatomic, copy) NSString *allNumber;
@property (nonatomic, copy) NSString *alreadyNumber;
......
......@@ -52,6 +52,15 @@
self.navigationController.navigationBar.translucent = NO;
}
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"口碑巡检任务"];
......@@ -70,6 +79,14 @@
#pragma mark - Private Methods
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)requestRankingDetail
{
NSString *url = [NSString stringWithFormat:@"%@%@%@/%@",kRedStarURL, kInspectDetailURL, self.uuid, self.store_uuid];
......
......@@ -41,7 +41,6 @@
- (void)setup
{
self.addressLabel.font = [UIFont systemFontOfSize:14.0];
self.showScrollView.backgroundColor = [UIColor lightGrayColor];
self.titleLabel.font = [UIFont systemFontOfSize:17.0];
self.reportTimeLabel.font = [UIFont systemFontOfSize:14.0];
self.lineView1.backgroundColor = kSeparateLineColor;
......@@ -86,21 +85,22 @@
- (UIScrollView *)showScrollView
{
if (!_showScrollView) {
_showScrollView = [[UIScrollView alloc] init];
_showScrollView.translatesAutoresizingMaskIntoConstraints = NO;
_showScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(20, 41, kScreenWidth - 40, 70)];
_showScrollView.showsHorizontalScrollIndicator = NO;
_showScrollView.showsVerticalScrollIndicator = NO;
[self addSubview:_showScrollView];
NSLayoutConstraint *showTop = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.addressLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:showTop];
NSLayoutConstraint *showLeft = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:showLeft];
NSLayoutConstraint *showRight = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:showRight];
NSLayoutConstraint *showHeight = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:70];
[self addConstraint:showHeight];
// NSLayoutConstraint *showTop = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.addressLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [self addConstraint:showTop];
//
// NSLayoutConstraint *showLeft = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
// [self addConstraint:showLeft];
//
// NSLayoutConstraint *showRight = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self addConstraint:showRight];
//
// NSLayoutConstraint *showHeight = [NSLayoutConstraint constraintWithItem:_showScrollView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:70];
// [self addConstraint:showHeight];
}
return _showScrollView;
}
......
......@@ -48,6 +48,14 @@
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
// 添加tableView
[self addTableView];
......@@ -76,10 +84,39 @@
_workData = workArray;
self.tableView.tableHeaderView = self.rankDetailHeaderView;
[self setupScrollView];
// 注册cell
[self.tableView registerClass:[RankDetailTableCell class] forCellReuseIdentifier:kRankDetailCell];
}
// 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)setupScrollView
{
int imageCount = 5;
CGFloat marginW = 5.0;
CGFloat imageViewW = 90 + 2 * marginW;
CGFloat imageViewH = self.rankDetailHeaderView.rankDetailView.showScrollView.bounds.size.height - 4;
self.rankDetailHeaderView.rankDetailView.showScrollView.contentSize = CGSizeMake(imageCount *imageViewW, imageViewH + 4);
for (int i = 0; i < imageCount; i++) {
UIButton *button = [[UIButton alloc] init];
[button setImage:[UIImage imageNamed:[NSString stringWithFormat:@"0%d", i]] forState:UIControlStateNormal];
button.frame = CGRectMake(i * imageViewW + 2, 2, imageViewW - 2 * marginW, imageViewH);
[button addTarget:self action:@selector(ccilck) forControlEvents:UIControlEventTouchUpInside];
[self.rankDetailHeaderView.rankDetailView.showScrollView addSubview:button];
}
}
- (void)ccilck
{
NSLog(@"test");
}
- (void)showScrollView:(UIButton *)sender
{
RankDetailTableCell * cell = (RankDetailTableCell *)[[sender superview] superview];
......
//
// RankCommentModel.h
// redstar
//
// Created by admin on 15/11/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RankCommentModel : NSObject
@property (nonatomic,copy) NSString *uuid;
@property (nonatomic,copy) NSString *user_uuid;
@property (nonatomic,copy) NSString *user_code;
@property (nonatomic,copy) NSString *user_name;
@property (nonatomic,copy) NSString *comment;
@property (nonatomic,copy) NSString *commentTime;
+ (instancetype)rankCommentModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
@end
//
// RankCommentModel.m
// redstar
//
// Created by admin on 15/11/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankCommentModel.h"
@implementation RankCommentModel
+ (instancetype)rankCommentModelWithDict:(NSDictionary *)dict
{
return [[self alloc] initWithDict:dict];
}
- (instancetype)initWithDict:(NSDictionary *)dict
{
if (self = [super init]) {
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
......@@ -16,8 +16,11 @@
@property (nonatomic,copy) NSString *store_name;
@property (nonatomic,copy) NSString *score;
@property (nonatomic,copy) NSString *reported;
@property (nonatomic,copy) NSString *commentId;
@property (nonatomic,copy) NSString *ranking;
@property (nonatomic,strong) NSDictionary *comments;
@property (nonatomic,strong) NSArray *comments;
+ (instancetype)rankListModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
......
......@@ -7,7 +7,6 @@
//
#import "RankListModel.h"
#import "RankCommentModel.h"
@implementation RankListModel
+ (instancetype)rankListModelWithDict:(NSDictionary *)dict
......
......@@ -12,9 +12,9 @@
#import "HttpClient.h"
#import "RankListModel.h"
#import "RankCommentModel.h"
#define kRankingCell @"RankingTableViewCell"
#define kShopNameBtnTag 15000
@interface RankingListViewController () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
......@@ -23,7 +23,6 @@
@property (nonatomic, strong) NSMutableDictionary *selectedIndexes;
@property (nonatomic, strong) NSMutableArray *allRankListArray;
@property (nonatomic, strong) NSMutableArray *allRankCommentArray;
@end
......@@ -49,12 +48,13 @@
self.navigationItem.leftBarButtonItem = backItem;
self.allRankListArray = [NSMutableArray array];
self.allRankCommentArray = [NSMutableArray array];
if([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
// 初始化容器
self.selectedIndexes = [[NSMutableDictionary alloc] init];
......@@ -96,15 +96,16 @@
NSArray *dataArray = dataDict[@"records"];
for (NSDictionary *ListDict in dataArray) {
RankListModel *rankList = [RankListModel rankListModelWithDict:ListDict];
NSDictionary *commentDict = rankList.comments;
RankCommentModel *rankComment = [RankCommentModel rankCommentModelWithDict:commentDict];
[self.allRankListArray addObject:rankList];
[self.allRankCommentArray addObject:rankComment];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
self.tableView.delegate = self;
self.tableView.dataSource = self;
NSString *shopCount = [NSString stringWithFormat:@"%lu 家", (unsigned long)_allRankListArray.count];
NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopCount];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kShopCountTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(0,shopCount.length - 2)];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(shopCount.length - 2,2)];
_shoppingCountLabel.attributedText = shopAttr;
}];
}
......@@ -136,6 +137,11 @@
- (void)loadMoreInfo:(UIButton *)sender
{
NSInteger key = sender.tag - kShopNameBtnTag;
RankListModel *rankList = _allRankListArray[key];
NSArray *infoArray = rankList.comments;
RankingListCell * cell = (RankingListCell *)[[sender superview] superview];
cell.isDrop = !cell.isDrop;
NSIndexPath * path = [self.tableView indexPathForCell:cell];
......@@ -207,7 +213,7 @@
NSLayoutConstraint *remarkTop = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:remarkTop];
NSLayoutConstraint *remarkLeft = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
NSLayoutConstraint *remarkLeft = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:3];
[cell.contentView addConstraint:remarkLeft];
NSLayoutConstraint *remarkRight = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
......@@ -216,6 +222,14 @@
NSLayoutConstraint *remarkHeight = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[cell.contentView addConstraint:remarkHeight];
if (!infoArray.count == 0) {
NSDictionary *infoDict = infoArray[0];
cell.someoneLabel.text = [NSString stringWithFormat:@"%@", infoDict[@"commentor"]];
cell.dateLabel.text = [NSString stringWithFormat:@"%@", infoDict[@"commentTime"]];
cell.remarkLabel.text = [NSString stringWithFormat:@"评语:%@", infoDict[@"comment"]];
}
} else {
[UIView animateWithDuration:0.2 animations:^{
......@@ -246,7 +260,7 @@
#pragma mark - UITableView DataSource/Delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 7;
return _allRankListArray.count;
}
// cell显示的内容
......@@ -272,8 +286,11 @@
[cell.gradeLabel setAttributedText:rankAttr];
}
[cell.shopNameButton setTitle:@"上海真北店" forState:UIControlStateNormal];
cell.scoreLabel.text = @"98";
RankListModel *rankList = _allRankListArray[indexPath.row];
[cell.shopNameButton setTitle:rankList.store_name forState:UIControlStateNormal];
cell.scoreLabel.text = [NSString stringWithFormat:@"%@", rankList.score];
cell.shopNameButton.tag = (kShopNameBtnTag + indexPath.row);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// 添加点击事件
[cell.shopNameButton addTarget:self action:@selector(loadMoreInfo:) forControlEvents:UIControlEventTouchUpInside];
......@@ -499,11 +516,6 @@
if (!_shoppingCountLabel) {
_shoppingCountLabel = [[UILabel alloc] init];
_shoppingCountLabel.translatesAutoresizingMaskIntoConstraints = NO;
NSString *shopCount = [NSString stringWithFormat:@"21 家"];
NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopCount];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kShopCountTextColor,NSFontAttributeName:[UIFont systemFontOfSize:21.0f]} range:NSMakeRange(0,shopCount.length - 2)];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(shopCount.length - 2,2)];
_shoppingCountLabel.attributedText = shopAttr;
[self.headView addSubview:_shoppingCountLabel];
......
......@@ -36,6 +36,7 @@
#import "InspectListCell.h"
#define kHomeInspectListCell @"homeInspectListsCell"
#import "InspectTaskViewController.h"
#import "TaskListModel.h"
@interface HomeViewController () <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
@property (nonatomic, strong) UIImageView *bgImageView; // 背景
......@@ -393,22 +394,20 @@
if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
}
TaskListModel *taskList = [[TaskListModel alloc] init];
taskList.reportCount = 10;
taskList.questionCount = 13;
cell.taskList = taskList;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _test7Array[indexPath.row]];
cell.startDate.text = [NSString stringWithFormat:@"起始时间:%@", _test8Array[indexPath.row]];
cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _test9Array[indexPath.row]];
if ([_test4Array[indexPath.row] isEqualToString:@"1"]) {
cell.progressState = ProgressStateUnSettled;
} else if ([_test4Array[indexPath.row] isEqualToString:@"2"]) {
cell.progressState = ProgressStateDealWith;
} else {
cell.progressState = ProgressStateOverDue;
}
cell.alreadyLabel.text = [NSString stringWithFormat:@"%@", _test5Array[indexPath.row]];
cell.allLabel.text = [NSString stringWithFormat:@"/%@", _test6Array[indexPath.row]];
CGFloat already = [_test5Array[indexPath.row] floatValue];
CGFloat all = [_test6Array[indexPath.row] floatValue];
cell.multiplier = already / all;
// CGFloat already = [_test5Array[indexPath.row] floatValue];
// CGFloat all = [_test6Array[indexPath.row] floatValue];
// cell.multiplier = already / all;
cell.allView.backgroundColor = kProgressViewAllBackColor;
cell.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
return cell;
......@@ -443,7 +442,6 @@
inspectTaskVC.multiplier = cell.multiplier;
inspectTaskVC.alreadyNumber = cell.alreadyLabel.text;
inspectTaskVC.allNumber = cell.allLabel.text;
inspectTaskVC.progressState = cell.progressState;
[self.navigationController pushViewController:inspectTaskVC animated:YES];
}
......
......@@ -9,6 +9,11 @@
#import "LoginView.h"
@interface LoginView ()
@property (nonatomic, strong) UIImageView *bgImageView;
@property (nonatomic, strong) UIImageView *redStarImageView;
@property (nonatomic, strong) UIImageView *titleImageView;
@property (nonatomic, strong) UIView *passwordView;
@property (nonatomic, strong) UIView *lineView1;
......@@ -25,7 +30,7 @@
self = [super init];
if (self) {
[self addSubviews];
self.backgroundColor = [UIColor colorWithRed:163 / 255.0 green:215 / 255.0 blue:248 / 255.0 alpha:1.0];
//self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background_login"]];
}
return self;
}
......@@ -33,6 +38,13 @@
#pragma mark - Private Methods
- (void)addSubviews
{
UIImage *image = [UIImage imageNamed:@"background_login"];
//image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(700, 374, 600, 374) resizingMode:UIImageResizingModeStretch];
self.bgImageView.image = image;
self.redStarImageView.image = [UIImage imageNamed:@"home_logo"];
self.titleImageView.image = [UIImage imageNamed:@"title_login"];
self.usernameView.backgroundColor = [UIColor whiteColor];
self.passwordView.backgroundColor = [UIColor whiteColor];
......@@ -48,12 +60,96 @@
self.passwordTextFiled.clearButtonMode = UITextFieldViewModeAlways;
[self.retrieveButton setTitle:@"找回密码" forState:UIControlStateNormal];
[self.registerButton setTitle:@"用户注册" forState:UIControlStateNormal];
// [self.retrieveButton setTitle:@"找回密码" forState:UIControlStateNormal];
// [self.registerButton setTitle:@"用户注册" forState:UIControlStateNormal];
}
#pragma mark - layz loading
- (UIImageView *)bgImageView
{
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] init];
}
_bgImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_bgImageView];
[self sendSubviewToBack:_bgImageView];
// 顶端
NSLayoutConstraint *usernameImageViewTop = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self addConstraint:usernameImageViewTop];
// 左边
NSLayoutConstraint *usernameImageViewLeft = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self addConstraint:usernameImageViewLeft];
// 左边
NSLayoutConstraint *usernameImageViewRight = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self addConstraint:usernameImageViewRight];
// 左边
NSLayoutConstraint *usernameImageViewBottom = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:usernameImageViewBottom];
return _bgImageView;
}
- (UIImageView *)redStarImageView
{
if (!_redStarImageView) {
_redStarImageView = [[UIImageView alloc] init];
}
_redStarImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_redStarImageView];
// 顶端
NSLayoutConstraint *usernameImageViewTop = [NSLayoutConstraint constraintWithItem:_redStarImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:112];
[self addConstraint:usernameImageViewTop];
// 左边
NSLayoutConstraint *usernameImageViewLeft = [NSLayoutConstraint constraintWithItem:_redStarImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:(kScreenWidth - 176) / 2];
[self addConstraint:usernameImageViewLeft];
// 底部
NSLayoutConstraint *usernameImageViewHeight = [NSLayoutConstraint constraintWithItem:_redStarImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:54];
[self addConstraint:usernameImageViewHeight];
// 宽度
NSLayoutConstraint *usernameImageViewWidth = [NSLayoutConstraint constraintWithItem:_redStarImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:176];
[self addConstraint:usernameImageViewWidth];
return _redStarImageView;
}
- (UIImageView *)titleImageView
{
if (!_titleImageView) {
_titleImageView = [[UIImageView alloc] init];
}
_titleImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_titleImageView];
// 顶端
NSLayoutConstraint *usernameImageViewTop = [NSLayoutConstraint constraintWithItem:_titleImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:188];
[self addConstraint:usernameImageViewTop];
// 左边
NSLayoutConstraint *usernameImageViewLeft = [NSLayoutConstraint constraintWithItem:_titleImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:(kScreenWidth - 171) / 2];
[self addConstraint:usernameImageViewLeft];
// 底部
NSLayoutConstraint *usernameImageViewHeight = [NSLayoutConstraint constraintWithItem:_titleImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:26];
[self addConstraint:usernameImageViewHeight];
// 宽度
NSLayoutConstraint *usernameImageViewWidth = [NSLayoutConstraint constraintWithItem:_titleImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:171];
[self addConstraint:usernameImageViewWidth];
return _titleImageView;
}
- (UIView *)usernameView
{
if (!_usernameView) {
......@@ -67,7 +163,7 @@
[self addSubview:_usernameView];
// 顶端
NSLayoutConstraint *usenameTop = [NSLayoutConstraint constraintWithItem:_usernameView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:210];
NSLayoutConstraint *usenameTop = [NSLayoutConstraint constraintWithItem:_usernameView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:253];
[self addConstraint:usenameTop];
// 左边
......@@ -98,7 +194,7 @@
[self addSubview:_passwordView];
// 顶端
NSLayoutConstraint *passwordTop = [NSLayoutConstraint constraintWithItem:_passwordView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_usernameView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:15];
NSLayoutConstraint *passwordTop = [NSLayoutConstraint constraintWithItem:_passwordView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_usernameView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:10];
[self addConstraint:passwordTop];
// 左边
......@@ -297,7 +393,7 @@
[self addSubview:_loginButton];
// 顶端
NSLayoutConstraint *loginTop = [NSLayoutConstraint constraintWithItem:_loginButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_passwordView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:15];
NSLayoutConstraint *loginTop = [NSLayoutConstraint constraintWithItem:_loginButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_passwordView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:10];
[self addConstraint:loginTop];
// 左边
......
......@@ -66,6 +66,7 @@
#pragma mark - Private Methods
- (void)requestLogin
{
// 获取上次登陆信息
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"loginMessage"] isEqualToString:@"ok"]) {
NSString *username = [[NSUserDefaults standardUserDefaults] objectForKey:@"username"];
......@@ -73,6 +74,8 @@
HttpClient *httpClient = [[HttpClient alloc] initWithLogin];
UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
[MBProgressHUD showHUDAddedTo:window animated:YES];
[httpClient loginWithUsername:username password:password completion:^(id response, NSError *error) {
NSLog(@"登陆 respo = %@", response);
if ([response[@"message"] isEqualToString:@"ok"]) {
......@@ -84,9 +87,11 @@
[userDefault setObject:(NSDictionary *)response[@"data"] forKey:@"loginData"];
self.rootTBC = [[RootTabBarController alloc] init];
[MBProgressHUD hideHUDForView:window animated:YES];
[self presentViewController:_rootTBC animated:YES completion:nil];
} else {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", response[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[MBProgressHUD hideHUDForView:window animated:YES];
[alertView show];
}
}];
......@@ -108,35 +113,40 @@
*/
- (void)loginButtonClick:(UIButton *)sender
{
// 进入RootTabBar
self.rootTBC = [[RootTabBarController alloc] init];
[self presentViewController:_rootTBC animated:YES completion:nil];
// // 进入RootTabBar
// self.rootTBC = [[RootTabBarController alloc] init];
// [self presentViewController:_rootTBC animated:YES completion:nil];
if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
return;
}
// if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) {
// UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alertView show];
// return;
// }
//
// HttpClient *httpClient = [[HttpClient alloc] initWithLogin];
// [httpClient loginWithUsername:self.loginView.usernameTextFiled.text password:self.loginView.passwordTextFiled.text completion:^(id response, NSError *error) {
// if ([response[@"message"] isEqualToString:@"ok"]) {
//
// // 保存登陆信息
// [[NSUserDefaults standardUserDefaults] setObject:self.loginView.usernameTextFiled.text forKey:@"username"];
// [[NSUserDefaults standardUserDefaults] setObject:self.loginView.passwordTextFiled.text forKey:@"password"];
// [[NSUserDefaults standardUserDefaults] setObject:response[@"message"] forKey:@"loginMessage"];
// [[NSUserDefaults standardUserDefaults] setObject:response[@"data"] forKey:@"loginData"];
//
// // 进入RootTabBar
// self.rootTBC = [[RootTabBarController alloc] init];
// [self presentViewController:_rootTBC animated:YES completion:nil];
//
// } else {
// UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", response[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alertView show];
// }
// }];
HttpClient *httpClient = [[HttpClient alloc] initWithLogin];
UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
[MBProgressHUD showHUDAddedTo:window animated:YES];
[httpClient loginWithUsername:self.loginView.usernameTextFiled.text password:self.loginView.passwordTextFiled.text completion:^(id response, NSError *error) {
if ([response[@"message"] isEqualToString:@"ok"]) {
// 保存登陆信息
[[NSUserDefaults standardUserDefaults] setObject:self.loginView.usernameTextFiled.text forKey:@"username"];
[[NSUserDefaults standardUserDefaults] setObject:self.loginView.passwordTextFiled.text forKey:@"password"];
[[NSUserDefaults standardUserDefaults] setObject:response[@"message"] forKey:@"loginMessage"];
[[NSUserDefaults standardUserDefaults] setObject:response[@"data"] forKey:@"loginData"];
// 进入RootTabBar
self.rootTBC = [[RootTabBarController alloc] init];
[MBProgressHUD hideHUDForView:window animated:YES];
[self presentViewController:_rootTBC animated:YES completion:nil];
} else {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", response[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[MBProgressHUD hideHUDForView:window animated:YES];
[alertView show];
}
}];
}
......
......@@ -23,9 +23,7 @@
#pragma mark - Private Methods
- (void)setup
{
self.backgroundColor = [UIColor greenColor];
self.quitButton.backgroundColor = [UIColor orangeColor];
}
#pragma mark - lazy loading
......@@ -51,7 +49,7 @@
NSLayoutConstraint *quitRight = [NSLayoutConstraint constraintWithItem:_quitButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:quitRight];
NSLayoutConstraint *quitBottom = [NSLayoutConstraint constraintWithItem:_quitButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-20];
NSLayoutConstraint *quitBottom = [NSLayoutConstraint constraintWithItem:_quitButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-45];
[self addConstraint:quitBottom];
return _quitButton;
......
......@@ -10,7 +10,6 @@
@interface MineTableHeaderView : UIView
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *companyLabel;
@property (nonatomic, strong) UILabel *userLabel;
@property (nonatomic, strong) UILabel *numberLabel;
......
......@@ -19,6 +19,7 @@
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor grayColor];
[self setup];
}
return self;
......@@ -28,36 +29,12 @@
#pragma mark - Private Methods
- (void)setup
{
self.backgroundColor = [UIColor purpleColor];
self.userLabel.text = @"用户: 陈宁";
self.numberLabel.text = @"代码: 0005";
self.companyLabel.text = @"公司: 红星美凯龙家居集团股份有限公司公司";
self.iconImageView.backgroundColor = [UIColor blueColor];
self.companyLabel.text = @"公司: 红星美凯龙家居集团股份有限公司";
}
#pragma mark - lazy loading
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
}
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_iconImageView];
NSLayoutConstraint *iconHeight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self addConstraint:iconHeight];
NSLayoutConstraint *iconTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:40];
[self addConstraint:iconTop];
NSLayoutConstraint *iconWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self addConstraint:iconWidth];
NSLayoutConstraint *iconLeft = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:30];
[self addConstraint:iconLeft];
return _iconImageView;
}
- (UILabel *)companyLabel
{
......@@ -76,10 +53,10 @@
NSLayoutConstraint *companyTop = [NSLayoutConstraint constraintWithItem:_companyLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:40];
[self addConstraint:companyTop];
NSLayoutConstraint *companyRight = [NSLayoutConstraint constraintWithItem:_companyLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-30];
NSLayoutConstraint *companyRight = [NSLayoutConstraint constraintWithItem:_companyLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self addConstraint:companyRight];
NSLayoutConstraint *companyLeft = [NSLayoutConstraint constraintWithItem:_companyLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
NSLayoutConstraint *companyLeft = [NSLayoutConstraint constraintWithItem:_companyLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:companyLeft];
return _companyLabel;
......
......@@ -34,15 +34,24 @@
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
self.view.backgroundColor = kMineBackGroundColor;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
self.view.backgroundColor = kSectionBackGroundColor;
self.titleArray = [NSMutableArray arrayWithObjects:@"修改密码",@"配置",@"帮助与反馈",@"关于",@"检查版本更新", nil];
[self setupNav];
[self setupTableView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......@@ -50,13 +59,9 @@
#pragma mark - Prative Methods
- (void)setupNav
{
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleDone target:self action:@selector(backTabBar:)];
}
// 返回上一页面
- (void)backTabBar:(UIBarButtonItem *)sender
- (void)doBack:(UIBarButtonItem *)sender
{
[self dismissViewControllerAnimated:YES completion:nil];
}
......@@ -74,6 +79,11 @@
- (void)quitLoginClick:(UIButton *)sender
{
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
[userDefault removeObjectForKey:@"loginMessage"];
[userDefault removeObjectForKey:@"username"];
[userDefault removeObjectForKey:@"password"];
[self.tabBarController dismissViewControllerAnimated:YES completion:nil];
}
......@@ -93,13 +103,15 @@
// 设置cell右边有个小箭头
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = _titleArray[indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:15.0];
cell.textLabel.textColor = kLightBlack;
return cell;
}
// cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 35;
return 45;
}
// section高度
......@@ -147,7 +159,7 @@
- (MineTableFooterView *)footView
{
if (!_footView) {
_footView = [[MineTableFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 64 - 150 - 20 - 35 * 5)];
_footView = [[MineTableFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 64 - 150 - 20 - 45 * 5)];
}
return _footView;
}
......
......@@ -22,6 +22,11 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
......@@ -41,13 +46,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
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