Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
e190d8e9
Commit
e190d8e9
authored
Nov 07, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成star的打分
parent
f46f452d
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
634 additions
and
4 deletions
+634
-4
project.pbxproj
redstar.xcodeproj/project.pbxproj
+58
-0
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Contents.json
redstar/Assets.xcassets/Inspect/close.imageset/Contents.json
+22
-0
close@2x.png
redstar/Assets.xcassets/Inspect/close.imageset/close@2x.png
+0
-0
close@3x.png
redstar/Assets.xcassets/Inspect/close.imageset/close@3x.png
+0
-0
Contents.json
...Assets.xcassets/Inspect/star_after.imageset/Contents.json
+22
-0
star_after@2x.png
...ts.xcassets/Inspect/star_after.imageset/star_after@2x.png
+0
-0
star_after@3x.png
...ts.xcassets/Inspect/star_after.imageset/star_after@3x.png
+0
-0
Contents.json
...ssets.xcassets/Inspect/star_before.imageset/Contents.json
+22
-0
star_before@2x.png
....xcassets/Inspect/star_before.imageset/star_before@2x.png
+0
-0
star_before@3x.png
....xcassets/Inspect/star_before.imageset/star_before@3x.png
+0
-0
CommentView.h
redstar/Classes/Module/Comment/View/CommentView.h
+3
-0
CommentView.m
redstar/Classes/Module/Comment/View/CommentView.m
+15
-2
OnLineViewController.m
...ule/Function/OnLine/ViewController/OnLineViewController.m
+1
-1
AddQuestionFooterView.h
...unction/Question/AddQuestion/View/AddQuestionFooterView.h
+17
-0
AddQuestionFooterView.m
...unction/Question/AddQuestion/View/AddQuestionFooterView.m
+181
-0
AddQuestionViewController.h
...on/AddQuestion/ViewController/AddQuestionViewController.h
+13
-0
AddQuestionViewController.m
...on/AddQuestion/ViewController/AddQuestionViewController.m
+162
-0
QuestionViewController.m
...tion/QuestionList/ViewController/QuestionViewController.m
+4
-1
StarBar.h
redstar/Classes/Tools/StarBar/StarBar.h
+17
-0
StarBar.m
redstar/Classes/Tools/StarBar/StarBar.m
+97
-0
No files found.
redstar.xcodeproj/project.pbxproj
View file @
e190d8e9
...
...
@@ -60,6 +60,9 @@
84E420511BE89D9A00689976
/* InspectTaskSortCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84E420501BE89D9A00689976
/* InspectTaskSortCell.m */
;
};
84F1669B1BE715E40061D350
/* ZanButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84F1669A1BE715E40061D350
/* ZanButton.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 */
;
};
84F57C9C1BECA73800DDEEB1
/* StarBar.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84F57C9B1BECA73800DDEEB1
/* StarBar.m */
;
};
84FD89F21BD9FC71006E442A
/* HomeViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84FD89F11BD9FC71006E442A
/* HomeViewController.m */
;
};
84FD8A071BDA01C4006E442A
/* ChartViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84FD8A061BDA01C4006E442A
/* ChartViewController.m */
;
};
84FD8A0A1BDA01D1006E442A
/* MineViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84FD8A091BDA01D1006E442A
/* MineViewController.m */
;
};
...
...
@@ -194,6 +197,12 @@
84F1669A1BE715E40061D350
/* ZanButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZanButton.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>"
;
};
84F57C4B1BEC785E00DDEEB1
/* AddQuestionViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AddQuestionViewController.m
;
sourceTree
=
"<group>"
;
};
84F57C4E1BEC7AA300DDEEB1
/* AddQuestionFooterView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
AddQuestionFooterView.h
;
sourceTree
=
"<group>"
;
};
84F57C4F1BEC7AA300DDEEB1
/* AddQuestionFooterView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AddQuestionFooterView.m
;
sourceTree
=
"<group>"
;
};
84F57C9A1BECA73800DDEEB1
/* StarBar.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
StarBar.h
;
sourceTree
=
"<group>"
;
};
84F57C9B1BECA73800DDEEB1
/* StarBar.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
StarBar.m
;
sourceTree
=
"<group>"
;
};
84FD89F01BD9FC71006E442A
/* HomeViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
HomeViewController.h
;
sourceTree
=
"<group>"
;
};
84FD89F11BD9FC71006E442A
/* HomeViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
HomeViewController.m
;
sourceTree
=
"<group>"
;
};
84FD8A051BDA01C4006E442A
/* ChartViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ChartViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -348,6 +357,7 @@
8426A4AA1BDF0CD600E5FDF5
/* Question */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C471BEC782D00DDEEB1
/* AddQuestion */
,
8474C5861BE78A85007DCF19
/* QuestionDetail */
,
8474C5891BE78A85007DCF19
/* QuestionList */
,
);
...
...
@@ -707,6 +717,7 @@
84970E261BD8DEFE00C1728A
/* Tools */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C991BECA72C00DDEEB1
/* StarBar */
,
8474C5801BE751A2007DCF19
/* CommonFunc */
,
84F166981BE715D20061D350
/* ZanButton */
,
84DB9BC11BDCD49900822CC4
/* CustomDropMenu */
,
...
...
@@ -910,6 +921,50 @@
path
=
View
;
sourceTree
=
"<group>"
;
};
84F57C471BEC782D00DDEEB1
/* AddQuestion */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C4D1BEC7A8C00DDEEB1
/* View */
,
84F57C481BEC784A00DDEEB1
/* Cell */
,
84F57C491BEC784A00DDEEB1
/* ViewController */
,
);
path
=
AddQuestion
;
sourceTree
=
"<group>"
;
};
84F57C481BEC784A00DDEEB1
/* Cell */
=
{
isa
=
PBXGroup
;
children
=
(
);
path
=
Cell
;
sourceTree
=
"<group>"
;
};
84F57C491BEC784A00DDEEB1
/* ViewController */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C4A1BEC785E00DDEEB1
/* AddQuestionViewController.h */
,
84F57C4B1BEC785E00DDEEB1
/* AddQuestionViewController.m */
,
);
path
=
ViewController
;
sourceTree
=
"<group>"
;
};
84F57C4D1BEC7A8C00DDEEB1
/* View */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C4E1BEC7AA300DDEEB1
/* AddQuestionFooterView.h */
,
84F57C4F1BEC7AA300DDEEB1
/* AddQuestionFooterView.m */
,
);
path
=
View
;
sourceTree
=
"<group>"
;
};
84F57C991BECA72C00DDEEB1
/* StarBar */
=
{
isa
=
PBXGroup
;
children
=
(
84F57C9A1BECA73800DDEEB1
/* StarBar.h */
,
84F57C9B1BECA73800DDEEB1
/* StarBar.m */
,
);
path
=
StarBar
;
sourceTree
=
"<group>"
;
};
84FD89ED1BD9FC5B006E442A
/* Home */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -1182,6 +1237,7 @@
84970DEF1BD8DD8A00C1728A
/* main.m in Sources */
,
8474A01C1BE368D700315F30
/* HomeCellItem.m in Sources */
,
84D8257F1BDD2F7E00CC61F7
/* MineTableFooterView.m in Sources */
,
84F57C501BEC7AA300DDEEB1
/* AddQuestionFooterView.m in Sources */
,
84CF0F1E1BE9B40400C855CE
/* InspectDetailFooterView.m in Sources */
,
84970E281BD8DEFE00C1728A
/* AppDelegate.m in Sources */
,
84AB20A51BE648EC00B66F13
/* PictureViewController.m in Sources */
,
...
...
@@ -1198,6 +1254,8 @@
8474C5921BE78A85007DCF19
/* QuestionViewController.m in Sources */
,
8408261E1BE5D22A0022B795
/* OnLineTableViewCell.m in Sources */
,
8408261A1BE5CEDD0022B795
/* OnLineViewController.m in Sources */
,
84F57C9C1BECA73800DDEEB1
/* StarBar.m in Sources */
,
84F57C4C1BEC785E00DDEEB1
/* AddQuestionViewController.m in Sources */
,
84CF0ED51BE9AC1400C855CE
/* InspectSettleCell.m in Sources */
,
84C957551BDB54D600083584
/* AnnounceViewController.m in Sources */
,
84C9574D1BDB344900083584
/* UIBarButtonItem+Create.m in Sources */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
e190d8e9
No preview for this file type
redstar/Assets.xcassets/Inspect/close.imageset/Contents.json
0 → 100644
View file @
e190d8e9
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"close@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"close@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Inspect/close.imageset/close@2x.png
0 → 100644
View file @
e190d8e9
1.49 KB
redstar/Assets.xcassets/Inspect/close.imageset/close@3x.png
0 → 100644
View file @
e190d8e9
1.84 KB
redstar/Assets.xcassets/Inspect/star_after.imageset/Contents.json
0 → 100644
View file @
e190d8e9
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"star_after@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"star_after@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Inspect/star_after.imageset/star_after@2x.png
0 → 100644
View file @
e190d8e9
1.88 KB
redstar/Assets.xcassets/Inspect/star_after.imageset/star_after@3x.png
0 → 100644
View file @
e190d8e9
2.34 KB
redstar/Assets.xcassets/Inspect/star_before.imageset/Contents.json
0 → 100644
View file @
e190d8e9
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"star_before@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"star_before@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Inspect/star_before.imageset/star_before@2x.png
0 → 100644
View file @
e190d8e9
2.53 KB
redstar/Assets.xcassets/Inspect/star_before.imageset/star_before@3x.png
0 → 100644
View file @
e190d8e9
3.44 KB
redstar/Classes/Module/Comment/View/CommentView.h
View file @
e190d8e9
...
...
@@ -7,6 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "StarBar.h"
@interface
CommentView
:
UIView
<
UITextViewDelegate
>
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
...
...
@@ -18,4 +19,6 @@
@property
(
nonatomic
,
strong
)
UIButton
*
sureBtn
;
@property
(
nonatomic
,
strong
)
StarBar
*
starBar
;
@end
redstar/Classes/Module/Comment/View/CommentView.m
View file @
e190d8e9
...
...
@@ -8,6 +8,7 @@
#import "CommentView.h"
#define kStarBarWidth 235
@interface
CommentView
()
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel2
;
...
...
@@ -54,6 +55,8 @@
[
self
.
sureBtn
setTitle
:
@"确定"
forState
:
UIControlStateNormal
];
self
.
starBar
.
starNumber
=
0
;
}
#pragma mark - UITextView Delegate
...
...
@@ -151,8 +154,8 @@
[
self
addConstraint
:
titleLeft
];
// 右边
NSLayoutConstraint
*
title
Right
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
title
Right
];
NSLayoutConstraint
*
title
Width
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
65
];
[
self
addConstraint
:
title
Width
];
// 右边
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_starLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
30
];
...
...
@@ -298,4 +301,14 @@
return
_sureBtn
;
}
-
(
StarBar
*
)
starBar
{
if
(
!
_starBar
)
{
_starBar
=
[[
StarBar
alloc
]
initWithFrame
:
CGRectMake
(
kScreenWidth
-
kStarBarWidth
,
55
,
kStarBarWidth
,
30
)];
[
self
addSubview
:
_starBar
];
}
return
_starBar
;
}
@end
redstar/Classes/Module/Function/OnLine/ViewController/OnLineViewController.m
View file @
e190d8e9
...
...
@@ -116,7 +116,7 @@
if
(
kScreenHeight
==
480
)
{
_footView
=
[[
OnLineFooterView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
400
)];
}
else
{
_footView
=
[[
OnLineFooterView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
(
kScreenHeight
-
100
-
6
3
))];
_footView
=
[[
OnLineFooterView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
(
kScreenHeight
-
100
-
6
4
))];
}
[
_footView
.
saveButton
addTarget
:
self
action
:
@selector
(
saveClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
}
...
...
redstar/Classes/Module/Function/Question/AddQuestion/View/AddQuestionFooterView.h
0 → 100644
View file @
e190d8e9
//
// AddQuestionFooterView.h
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TakePhotoView.h"
@interface
AddQuestionFooterView
:
UIView
@property
(
nonatomic
,
strong
)
UITextView
*
titleTextView
;
@property
(
nonatomic
,
strong
)
TakePhotoView
*
takePhotoView
;
@end
redstar/Classes/Module/Function/Question/AddQuestion/View/AddQuestionFooterView.m
0 → 100644
View file @
e190d8e9
//
// AddQuestionFooterView.m
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AddQuestionFooterView.h"
#define kTakePhotoX 0
#define kTakePhotoY 175
#define kTakePhotoWidth (kScreenWidth - kTakePhotoX * 2)
#define kTakePhotoHeight 130 // 待处理
@interface
AddQuestionFooterView
()
<
UITextViewDelegate
>
@property
(
nonatomic
,
strong
)
UIImageView
*
backImageView1
;
@property
(
nonatomic
,
strong
)
UILabel
*
placeholderLabel1
;
@end
@implementation
AddQuestionFooterView
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
-
(
instancetype
)
initWithFrame
:
(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
[
self
setup
];
}
return
self
;
}
-
(
void
)
setup
{
self
.
backgroundColor
=
kFootViewBackGroundColor
;
UILabel
*
titleLabel
=
[[
UILabel
alloc
]
init
];
titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
.
0
];
titleLabel
.
text
=
@"问题与建议描述"
;
titleLabel
.
textColor
=
kOnLineCellTitleColor
;
[
self
addSubview
:
titleLabel
];
NSLayoutConstraint
*
titleTop
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleTop
];
NSLayoutConstraint
*
titleLeft
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
titleLeft
];
NSLayoutConstraint
*
titleRight
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
addConstraint
:
titleRight
];
NSLayoutConstraint
*
titleHeight
=
[
NSLayoutConstraint
constraintWithItem
:
titleLabel
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
50
];
[
self
addConstraint
:
titleHeight
];
UIImage
*
image
=
[
UIImage
imageNamed
:
@"textbox"
];
UIImage
*
resizingName
=
[
image
resizableImageWithCapInsets
:
UIEdgeInsetsMake
(
1
,
1
,
24
,
24
)
resizingMode
:
UIImageResizingModeStretch
];
self
.
backImageView1
.
image
=
resizingName
;
self
.
titleTextView
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
placeholderLabel1
.
text
=
@"请输入文字..."
;
self
.
takePhotoView
.
backgroundColor
=
kSectionBackGroundColor
;
}
#pragma mark - UITextView Delegate
-
(
BOOL
)
textView
:
(
UITextView
*
)
textView
shouldChangeTextInRange
:
(
NSRange
)
range
replacementText
:
(
NSString
*
)
text
{
if
(
!
[
text
isEqualToString
:
@""
])
{
_placeholderLabel1
.
hidden
=
YES
;
}
if
([
text
isEqualToString
:
@""
]
&&
range
.
location
==
0
&&
range
.
length
==
1
)
{
_placeholderLabel1
.
hidden
=
NO
;
}
return
YES
;
}
#pragma mark - lazy loading
-
(
UIImageView
*
)
backImageView1
{
if
(
!
_backImageView1
)
{
_backImageView1
=
[[
UIImageView
alloc
]
init
];
_backImageView1
.
userInteractionEnabled
=
YES
;
_backImageView1
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
addSubview
:
_backImageView1
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView1
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
50
];
[
self
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView1
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
20
];
[
self
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView1
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
20
];
[
self
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_backImageView1
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
120
];
[
self
addConstraint
:
contentHeight
];
}
return
_backImageView1
;
}
-
(
UITextView
*
)
titleTextView
{
if
(
!
_titleTextView
)
{
_titleTextView
=
[[
UITextView
alloc
]
init
];
_titleTextView
.
tag
=
1001
;
_titleTextView
.
delegate
=
self
;
_titleTextView
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_titleTextView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
[
self
.
backImageView1
addSubview
:
_titleTextView
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_titleTextView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView1
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
1
];
[
self
.
backImageView1
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_titleTextView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView1
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
1
];
[
self
.
backImageView1
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleTextView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView1
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
backImageView1
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_titleTextView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
backImageView1
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:-
1
];
[
self
.
backImageView1
addConstraint
:
contentHeight
];
}
return
_titleTextView
;
}
-
(
UILabel
*
)
placeholderLabel1
{
if
(
!
_placeholderLabel1
)
{
_placeholderLabel1
=
[[
UILabel
alloc
]
init
];
_placeholderLabel1
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_placeholderLabel1
.
font
=
[
UIFont
systemFontOfSize
:
15
.
0
];
_placeholderLabel1
.
textColor
=
kOnLineCellDetailColor
;
[
self
.
titleTextView
addSubview
:
_placeholderLabel1
];
NSLayoutConstraint
*
contentTop
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel1
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleTextView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
2
];
[
self
.
titleTextView
addConstraint
:
contentTop
];
NSLayoutConstraint
*
contentLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel1
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleTextView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
5
];
[
self
.
titleTextView
addConstraint
:
contentLeft
];
NSLayoutConstraint
*
contentRight
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel1
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
titleTextView
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
titleTextView
addConstraint
:
contentRight
];
NSLayoutConstraint
*
contentHeight
=
[
NSLayoutConstraint
constraintWithItem
:
_placeholderLabel1
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
30
];
[
self
.
titleTextView
addConstraint
:
contentHeight
];
}
return
_placeholderLabel1
;
}
-
(
TakePhotoView
*
)
takePhotoView
{
if
(
!
_takePhotoView
)
{
_takePhotoView
=
[[
TakePhotoView
alloc
]
initWithFrame
:
CGRectMake
(
kTakePhotoX
,
kTakePhotoY
,
kTakePhotoWidth
,
kTakePhotoHeight
)];
[
self
addSubview
:
_takePhotoView
];
}
return
_takePhotoView
;
}
@end
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.h
0 → 100644
View file @
e190d8e9
//
// AddQuestionViewController.h
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
AddQuestionViewController
:
UIViewController
@end
redstar/Classes/Module/Function/Question/AddQuestion/ViewController/AddQuestionViewController.m
0 → 100644
View file @
e190d8e9
//
// AddQuestionViewController.m
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AddQuestionViewController.h"
#import "OnLineTableViewCell.h"
#import "AddQuestionFooterView.h"
#import "CheckPicViewController.h"
#define kAddQuestionCell @"addQuestionTableViewCell"
@interface
AddQuestionViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
TakePhotoDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
AddQuestionFooterView
*
footerView
;
@property
(
nonatomic
,
strong
)
NSArray
*
titleArray
;
@end
@implementation
AddQuestionViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
UILabel
*
customLab
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
40
,
30
)];
[
customLab
setTextColor
:[
UIColor
whiteColor
]];
[
customLab
setText
:
@"新问题提报"
];
customLab
.
font
=
[
UIFont
boldSystemFontOfSize
:
19
];
self
.
navigationItem
.
titleView
=
customLab
;
self
.
titleArray
=
[
NSArray
arrayWithObjects
:
@"选择对应专业组"
,
@"选择问题分类"
,
nil
];
[
self
addTableView
];
// takePhoto按钮点击事件
[
self
.
footerView
.
takePhotoView
.
btn
addTarget
:
self
action
:
@selector
(
addNew
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
footerView
.
takePhotoView
.
delegate
=
self
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Methods
-
(
void
)
addTableView
{
[
self
.
tableView
registerClass
:[
OnLineTableViewCell
class
]
forCellReuseIdentifier
:
kAddQuestionCell
];
self
.
tableView
.
tableFooterView
=
self
.
footerView
;
}
-
(
void
)
addNew
:
(
UIButton
*
)
sender
{
if
(
!
[
self
.
footerView
.
takePhotoView
deleClose
:
sender
])
{
self
.
footerView
.
takePhotoView
.
editTag
=
-
1
;
if
(
!
[
UIImagePickerController
isSourceTypeAvailable
:
UIImagePickerControllerSourceTypeCamera
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
@"Unable to find the camera"
delegate
:
nil
cancelButtonTitle
:
nil
otherButtonTitles
:
@"OK"
,
nil
];
[
alert
show
];
}
else
{
UIImagePickerController
*
picker
=
[[
UIImagePickerController
alloc
]
init
];
picker
.
delegate
=
self
.
footerView
.
takePhotoView
;
picker
.
sourceType
=
UIImagePickerControllerSourceTypeCamera
;
picker
.
modalTransitionStyle
=
UIModalTransitionStyleFlipHorizontal
;
picker
.
videoQuality
=
UIImagePickerControllerQualityTypeLow
;
[
self
presentViewController
:
picker
animated
:
YES
completion
:
nil
];
}
}
}
#pragma mark - TakePhoto Delegate
-
(
void
)
takePhotoShowPicture
:
(
UIButton
*
)
btn
{
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
checkVC
.
checkImage
=
btn
.
imageView
.
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
}
#pragma mark - TableView Delegate/DateSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_titleArray
.
count
;
}
// cell显示的内容
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
OnLineTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
kAddQuestionCell
];
if
(
!
cell
)
{
cell
=
[[
OnLineTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kAddQuestionCell
];
}
cell
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
_titleArray
[
indexPath
.
row
]];
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
return
cell
;
}
// cell的高度
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
50
;
}
#pragma mark - lazy loading
-
(
UITableView
*
)
tableView
{
if
(
!
_tableView
)
{
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectZero
];
_tableView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
_tableView
.
showsVerticalScrollIndicator
=
NO
;
_tableView
.
showsHorizontalScrollIndicator
=
NO
;
[
self
.
view
addSubview
:
_tableView
];
NSLayoutConstraint
*
tableTop
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableTop
];
NSLayoutConstraint
*
tableLeft
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableLeft
];
NSLayoutConstraint
*
tableRight
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeRight
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeRight
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableRight
];
NSLayoutConstraint
*
tableBottom
=
[
NSLayoutConstraint
constraintWithItem
:
_tableView
attribute
:
NSLayoutAttributeBottom
relatedBy
:
NSLayoutRelationEqual
toItem
:
self
.
view
attribute
:
NSLayoutAttributeBottom
multiplier
:
1
.
0
constant
:
0
];
[
self
.
view
addConstraint
:
tableBottom
];
}
return
_tableView
;
}
-
(
AddQuestionFooterView
*
)
footerView
{
if
(
!
_footerView
)
{
if
(
kScreenHeight
==
480
)
{
_footerView
=
[[
AddQuestionFooterView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
400
)];
}
else
{
_footerView
=
[[
AddQuestionFooterView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
(
kScreenHeight
-
100
-
64
))];
}
}
return
_footerView
;
}
/*
#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
redstar/Classes/Module/Function/Question/QuestionList/ViewController/QuestionViewController.m
View file @
e190d8e9
...
...
@@ -11,6 +11,8 @@
#import "MenuButton.h"
#import "QuestionDetailViewController.h"
#import "AddQuestionViewController.h"
#import <AFNetworking.h>
#define kQuestionListCell @"questionListTableViewCell"
...
...
@@ -82,7 +84,8 @@
-
(
void
)
addClick
:
(
UIButton
*
)
sender
{
AddQuestionViewController
*
addQuestionVC
=
[[
AddQuestionViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
addQuestionVC
animated
:
YES
];
}
#pragma mark - UItableView Delegate/DataSource
...
...
redstar/Classes/Tools/StarBar/StarBar.h
0 → 100644
View file @
e190d8e9
//
// StarBar.h
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
StarBar
:
UIView
@property
(
nonatomic
,
assign
)
NSInteger
starNumber
;
// 默认显示亮的星星
@property
(
nonatomic
,
assign
)
BOOL
enable
;
// 是否可以触摸
@end
redstar/Classes/Tools/StarBar/StarBar.m
0 → 100644
View file @
e190d8e9
//
// StarBar.m
// redstar
//
// Created by admin on 15/11/6.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "StarBar.h"
#define ZOOM 0.7f
@interface
StarBar
()
@property
(
nonatomic
,
strong
)
UIView
*
bottomView
;
@property
(
nonatomic
,
strong
)
UIView
*
topView
;
@property
(
nonatomic
,
assign
)
CGFloat
starWidth
;
@end
@implementation
StarBar
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
userInteractionEnabled
=
YES
;
self
.
bottomView
=
[[
UIView
alloc
]
initWithFrame
:
self
.
bounds
];
self
.
bottomView
.
userInteractionEnabled
=
NO
;
[
self
addSubview
:
self
.
bottomView
];
self
.
topView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectZero
];
self
.
topView
.
clipsToBounds
=
YES
;
self
.
topView
.
userInteractionEnabled
=
NO
;
[
self
addSubview
:
self
.
topView
];
// 添加手势
UITapGestureRecognizer
*
tap
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
tap
:
)];
UIPanGestureRecognizer
*
pan
=
[[
UIPanGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
pan
:
)];
[
self
addGestureRecognizer
:
tap
];
[
self
addGestureRecognizer
:
pan
];
CGFloat
width
=
frame
.
size
.
width
/
7
.
0
;
self
.
starWidth
=
width
;
for
(
int
i
=
0
;
i
<
5
;
i
++
){
UIImageView
*
img
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
frame
.
size
.
height
*
ZOOM
,
frame
.
size
.
height
*
ZOOM
)];
img
.
center
=
CGPointMake
((
i
+
1
.
5
)
*
width
,
frame
.
size
.
height
/
2
);
img
.
image
=
[
UIImage
imageNamed
:
@"star_before"
];
[
self
.
bottomView
addSubview
:
img
];
UIImageView
*
img2
=
[[
UIImageView
alloc
]
initWithFrame
:
img
.
frame
];
img2
.
center
=
img
.
center
;
img2
.
image
=
[
UIImage
imageNamed
:
@"star_after"
];
[
self
.
topView
addSubview
:
img2
];
}
self
.
enable
=
YES
;
}
return
self
;
}
-
(
void
)
setStarNumber
:(
NSInteger
)
starNumber
{
if
(
_starNumber
!=
starNumber
)
{
_starNumber
=
starNumber
;
self
.
topView
.
frame
=
CGRectMake
(
0
,
0
,
self
.
starWidth
*
(
starNumber
+
1
),
self
.
bounds
.
size
.
height
);
}
}
-
(
void
)
tap
:(
UITapGestureRecognizer
*
)
gesture
{
if
(
self
.
enable
)
{
CGPoint
point
=
[
gesture
locationInView
:
self
];
NSInteger
count
=
(
int
)(
point
.
x
/
self
.
starWidth
)
+
1
;
self
.
topView
.
frame
=
CGRectMake
(
0
,
0
,
self
.
starWidth
*
count
,
self
.
bounds
.
size
.
height
);
if
(
count
>
5
)
{
_starNumber
=
5
;
}
else
{
_starNumber
=
count
-
1
;
}
}
}
-
(
void
)
pan
:(
UIPanGestureRecognizer
*
)
gesture
{
if
(
self
.
enable
)
{
CGPoint
point
=
[
gesture
locationInView
:
self
];
NSInteger
count
=
(
int
)(
point
.
x
/
self
.
starWidth
);
if
(
count
>=
0
&&
count
<=
5
&&
_starNumber
!=
count
)
{
self
.
topView
.
frame
=
CGRectMake
(
0
,
0
,
self
.
starWidth
*
(
count
+
1
),
self
.
bounds
.
size
.
height
);
_starNumber
=
count
;
}
}
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment