Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Macalline
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
张杰
Macalline
Commits
74de6228
Commit
74de6228
authored
Apr 07, 2016
by
753147900@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企划修改
parent
ad029853
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
746 additions
and
63 deletions
+746
-63
BRNetworkMgr.m
Macalline/Classes/Utilities/BRNetworkMgr.m
+0
-2
NoticeListViewController.m
...Classes/ViewControllers/Notice/NoticeListViewController.m
+3
-1
SettingViewController.m
...e/Classes/ViewControllers/Setting/SettingViewController.m
+1
-1
SANewHomeViewController.h
...wControllers/SmallArea/SASystem/SANewHomeViewController.h
+15
-0
SANewHomeViewController.m
...wControllers/SmallArea/SASystem/SANewHomeViewController.m
+360
-19
NewHomeViewController.h
...ne/Classes/ViewControllers/System/NewHomeViewController.h
+15
-0
NewHomeViewController.m
...ne/Classes/ViewControllers/System/NewHomeViewController.m
+349
-38
TabBarViewController.m
...ine/Classes/ViewControllers/TabBar/TabBarViewController.m
+3
-2
No files found.
Macalline/Classes/Utilities/BRNetworkMgr.m
View file @
74de6228
...
@@ -175,11 +175,9 @@
...
@@ -175,11 +175,9 @@
}];
}];
[
operation
setUserInfo
:@{
@"interface"
:
interface
,
kDealExtraWhenErrorOcur
:
@NO
}];
[
operation
setUserInfo
:@{
@"interface"
:
interface
,
kDealExtraWhenErrorOcur
:
@NO
}];
[
self
.
operationQueue
addOperation
:
operation
];
[
self
.
operationQueue
addOperation
:
operation
];
[
self
.
operationQueue
setSuspended
:
YES
];
[
self
.
operationQueue
setSuspended
:
YES
];
[
operation
pause
];
[
operation
pause
];
return
operation
;
return
operation
;
}
}
...
...
Macalline/Classes/ViewControllers/Notice/NoticeListViewController.m
View file @
74de6228
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
self
=
[
super
initWithNibName
:
nibNameOrNil
bundle
:
nibBundleOrNil
];
self
=
[
super
initWithNibName
:
nibNameOrNil
bundle
:
nibBundleOrNil
];
if
(
self
)
{
if
(
self
)
{
// Custom initialization
// Custom initialization
self
.
title
=
@"公告信息"
;
//
self.title = @"公告信息";
}
}
return
self
;
return
self
;
}
}
...
@@ -205,6 +205,7 @@
...
@@ -205,6 +205,7 @@
-
(
void
)
selectNoticeDatas
-
(
void
)
selectNoticeDatas
{
{
_tableType
=
@"notice"
;
_tableType
=
@"notice"
;
DLog
(
@"userID:%@"
,[
DataMgr
getInstance
].
userID
);
_noticeArr
=
[
DBDaoMgr
fetchNoticeByUserId
:[
DataMgr
getInstance
].
userID
];
_noticeArr
=
[
DBDaoMgr
fetchNoticeByUserId
:[
DataMgr
getInstance
].
userID
];
[
self
.
tableVContent
reloadData
];
[
self
.
tableVContent
reloadData
];
if
(
_noticeArr
.
count
!=
0
)
{
if
(
_noticeArr
.
count
!=
0
)
{
...
@@ -225,6 +226,7 @@
...
@@ -225,6 +226,7 @@
params
:
nil
params
:
nil
dataType
:
BRNetMgrDataTypeJSON
dataType
:
BRNetMgrDataTypeJSON
method
:
BRNetMgrMethodPost
];
method
:
BRNetMgrMethodPost
];
[
self
.
networkMgr
startOperation
:
operation
];
[
self
.
networkMgr
startOperation
:
operation
];
}
}
...
...
Macalline/Classes/ViewControllers/Setting/SettingViewController.m
View file @
74de6228
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
self
=
[
super
initWithNibName
:
nibNameOrNil
bundle
:
nibBundleOrNil
];
self
=
[
super
initWithNibName
:
nibNameOrNil
bundle
:
nibBundleOrNil
];
if
(
self
)
{
if
(
self
)
{
// Custom initialization
// Custom initialization
self
.
title
=
@"我"
;
//
self.title = @"我";
}
}
return
self
;
return
self
;
}
}
...
...
Macalline/Classes/ViewControllers/SmallArea/SASystem/SANewHomeViewController.h
View file @
74de6228
...
@@ -13,5 +13,20 @@
...
@@ -13,5 +13,20 @@
@property
(
nonatomic
,
strong
)
NSString
*
finishedTaskCount
;
@property
(
nonatomic
,
strong
)
NSString
*
finishedTaskCount
;
@property
(
nonatomic
,
strong
)
NSString
*
progress
;
@property
(
nonatomic
,
strong
)
NSString
*
progress
;
@property
(
nonatomic
,
strong
)
NSString
*
dayCount
;
@property
(
nonatomic
,
strong
)
NSString
*
dayCount
;
@property
(
nonatomic
,
strong
)
NSArray
*
arrContents
;
@property
(
nonatomic
,
strong
)
NSArray
*
noticeArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UIView
*
leftView
;
@end
@end
@interface
SACheckListCell
:
BaseTableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
lblcontent
;
@property
(
nonatomic
,
strong
)
UILabel
*
lblTitle
;
@property
(
nonatomic
,
strong
)
UILabel
*
lblCreateTime
;
@property
(
nonatomic
,
strong
)
UIView
*
viewCreateTime
;
@property
(
nonatomic
,
strong
)
UIView
*
viewLine
;
@property
(
nonatomic
,
strong
)
UIView
*
view
;
@property
(
nonatomic
,
strong
)
UIImageView
*
imageview
;
@end
Macalline/Classes/ViewControllers/SmallArea/SASystem/SANewHomeViewController.m
View file @
74de6228
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#import "SATaskListViewController.h"
#import "SATaskListViewController.h"
#import "DBDaoMgr.h"
#import "DBDaoMgr.h"
#import "BackGroundMusicViewController.h"
#import "BackGroundMusicViewController.h"
#import "NoteDetailViewController.h"
@interface
SANewHomeViewController
()
@interface
SANewHomeViewController
()
{
{
...
@@ -22,9 +23,11 @@
...
@@ -22,9 +23,11 @@
UILabel
*
lblNum
;
UILabel
*
lblNum
;
UIImageView
*
prcessImage
;
UIImageView
*
prcessImage
;
UIView
*
prcessBgView
;
UIView
*
prcessBgView
;
UIImageView
*
typePickerViewbg
;
UIView
*
cxView
;
UIView
*
cxView
;
UIView
*
dayView
;
UIView
*
dayView
;
}
}
@end
@end
...
@@ -50,7 +53,7 @@
...
@@ -50,7 +53,7 @@
UIView
*
headView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
self
.
view
.
frame
),
200
)];
UIView
*
headView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
self
.
view
.
frame
),
200
)];
headView
.
backgroundColor
=
[
UIColor
colorWithRed
:
0
.
9608
green
:
0
.
9608
blue
:
0
.
9608
alpha
:
1
];
headView
.
backgroundColor
=
[
UIColor
colorWithRed
:
0
.
9608
green
:
0
.
9608
blue
:
0
.
9608
alpha
:
1
];
[
self
.
view
addSubview
:
headView
];
[
self
.
view
addSubview
:
headView
];
UIImageView
*
headbg
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
self
.
view
.
frame
),
200
)];
UIImageView
*
headbg
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
self
.
view
.
frame
),
200
)];
headbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/smallAreaNav_bg.png"
];
headbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/smallAreaNav_bg.png"
];
[
headView
addSubview
:
headbg
];
[
headView
addSubview
:
headbg
];
...
@@ -63,10 +66,13 @@
...
@@ -63,10 +66,13 @@
[
lblTitle
autoAlignAxis
:
ALAxisVertical
toSameAxisOfView
:
headView
];
[
lblTitle
autoAlignAxis
:
ALAxisVertical
toSameAxisOfView
:
headView
];
[
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
25
];
[
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
25
];
UIImageView
*
typePickerViewbg
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
75
,
CGRectGetWidth
(
self
.
view
.
frame
),
40
)];
typePickerViewbg
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
75
,
CGRectGetWidth
(
self
.
view
.
frame
),
40
)];
typePickerViewbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/tab_home_left_xiaoqu.png"
];
typePickerViewbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/tab_home_left_xiaoqu.png"
];
[
headView
addSubview
:
typePickerViewbg
];
[
headView
addSubview
:
typePickerViewbg
];
NSArray
*
arrTitles
=
@[
@"企划在线检查"
,
@"查询考核"
];
NSArray
*
arrTitles
=
@[
@"企划在线检查"
,
@"查询考核"
];
TypePickerView
*
typePickerView
=
[[
TypePickerView
alloc
]
initWithFrame
:
TypePickerView
*
typePickerView
=
[[
TypePickerView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
50
,
CGRectGetWidth
(
self
.
view
.
frame
),
40
)];
CGRectMake
(
0
,
50
,
CGRectGetWidth
(
self
.
view
.
frame
),
40
)];
...
@@ -96,11 +102,23 @@
...
@@ -96,11 +102,23 @@
[
weakSelf
typePickerViewClickAtIndex
:
index
];
[
weakSelf
typePickerViewClickAtIndex
:
index
];
};
};
[
self
customLeftView
];
_tableView
=
[
self
tableView
];
[
UIApplication
showLoadingView
:
@"正在加载数据"
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
reloadUI
)
name
:
@"reloadNumber"
object
:
nil
];
}
#pragma mark init View
-
(
void
)
customLeftView
{
_leftView
=
[
self
leftView
];
UIView
*
descView
=
[[
UIView
alloc
]
init
];
UIView
*
descView
=
[[
UIView
alloc
]
init
];
descView
.
backgroundColor
=
[
UIColor
colorWithRed
:
0
.
1569
green
:
0
.
6235
blue
:
0
.
7216
alpha
:
1
];
descView
.
backgroundColor
=
[
UIColor
colorWithRed
:
0
.
1569
green
:
0
.
6235
blue
:
0
.
7216
alpha
:
1
];
[
head
View
addSubview
:
descView
];
[
_left
View
addSubview
:
descView
];
[
descView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdge
Top
];
[
descView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdge
Bottom
];
[
descView
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
typePickerView
withOffset
:-
2
];
lblNum
=
[[
UILabel
alloc
]
init
];
lblNum
=
[[
UILabel
alloc
]
init
];
lblNum
.
text
=
@"33"
;
lblNum
.
text
=
@"33"
;
...
@@ -120,7 +138,7 @@
...
@@ -120,7 +138,7 @@
btnUnRead
=
[[
UIButton
alloc
]
init
];
btnUnRead
=
[[
UIButton
alloc
]
init
];
[
btnUnRead
setBackgroundImage
:[
UIImage
imageNamed
:
@"TabBar/bg_notes_home.png"
]
forState
:
UIControlStateNormal
];
[
btnUnRead
setBackgroundImage
:[
UIImage
imageNamed
:
@"TabBar/bg_notes_home.png"
]
forState
:
UIControlStateNormal
];
// [btnUnRead setTitle:@"您有4个待审核任务" forState:UIControlStateNormal];
// [btnUnRead setTitle:@"您有4个待审核任务" forState:UIControlStateNormal];
btnUnRead
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
10
];
btnUnRead
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
10
];
[
descView
addSubview
:
btnUnRead
];
[
descView
addSubview
:
btnUnRead
];
[
btnUnRead
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
10
];
[
btnUnRead
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
10
];
...
@@ -167,11 +185,9 @@
...
@@ -167,11 +185,9 @@
bgImage
.
image
=
[
UIImage
imageNamed
:
@"NavBar/progress_bar.png"
];
bgImage
.
image
=
[
UIImage
imageNamed
:
@"NavBar/progress_bar.png"
];
[
prcessBgView
addSubview
:
bgImage
];
[
prcessBgView
addSubview
:
bgImage
];
UIScrollView
*
scrollerView
=
[[
UIScrollView
alloc
]
init
];
UIScrollView
*
scrollerView
=
[[
UIScrollView
alloc
]
init
WithFrame
:
CGRectMake
(
0
,
80
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
)
-
200
)
];
scrollerView
.
backgroundColor
=
[
UIColor
clearColor
];
scrollerView
.
backgroundColor
=
[
UIColor
clearColor
];
[
self
.
view
addSubview
:
scrollerView
];
[
_leftView
addSubview
:
scrollerView
];
[
scrollerView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdgeTop
];
[
scrollerView
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
headView
];
UILabel
*
lblCX
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
0
,
320
,
25
)];
UILabel
*
lblCX
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
0
,
320
,
25
)];
lblCX
.
textColor
=
[
UIColor
colorWithRed
:
0
.
9529
green
:
0
.
6471
blue
:
0
.
2118
alpha
:
1
];
lblCX
.
textColor
=
[
UIColor
colorWithRed
:
0
.
9529
green
:
0
.
6471
blue
:
0
.
2118
alpha
:
1
];
...
@@ -204,14 +220,13 @@
...
@@ -204,14 +220,13 @@
UIButton
*
btn
=
[
self
creatBtnWithIndex
:
i
withType
:
@"rc"
];
UIButton
*
btn
=
[
self
creatBtnWithIndex
:
i
withType
:
@"rc"
];
[
dayView
addSubview
:
btn
];
[
dayView
addSubview
:
btn
];
}
}
scrollerView
.
contentSize
=
CGSizeMake
(
w
*
3
,
h
*
3
+
50
);
scrollerView
.
contentSize
=
CGSizeMake
(
w
*
3
,
h
*
3
+
50
);
[
UIApplication
showLoadingView
:
@"正在加载数据"
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
reloadUI
)
name
:
@"reloadNumber"
object
:
nil
];
}
}
#pragma --------------------- 刷新UI -----------------------
#pragma --------------------- 刷新UI -----------------------
-
(
void
)
reloadUI
-
(
void
)
reloadUI
{
{
...
@@ -538,7 +553,16 @@
...
@@ -538,7 +553,16 @@
-
(
void
)
typePickerViewClickAtIndex
:
(
int
)
index
-
(
void
)
typePickerViewClickAtIndex
:
(
int
)
index
{
{
NSLog
(
@"click:%d"
,
index
);
if
(
index
==
0
){
[
_tableView
setHidden
:
true
];
[
_leftView
setHidden
:
false
];
typePickerViewbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/tab_home_left_xiaoqu.png"
];
}
else
{
[
_tableView
setHidden
:
false
];
[
_leftView
setHidden
:
true
];
typePickerViewbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/tab_home_right_xiaoqu.png"
];
}
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
{
...
@@ -554,10 +578,12 @@
...
@@ -554,10 +578,12 @@
if
([[
UIApplication
getObjectType
:
Number
key
:
kShouldRequestDataWhenBack
]
boolValue
])
{
if
([[
UIApplication
getObjectType
:
Number
key
:
kShouldRequestDataWhenBack
]
boolValue
])
{
[
self
queryInitCount
];
[
UIApplication
saveObject
:
@NO
type
:
Number
key
:
kShouldRequestDataWhenBack
];
[
UIApplication
saveObject
:
@NO
type
:
Number
key
:
kShouldRequestDataWhenBack
];
}
}
[
self
queryInitCount
];
[
self
requestDatas
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
...
@@ -696,7 +722,7 @@
...
@@ -696,7 +722,7 @@
}
}
vc
.
dayCount
=
_dayCount
;
vc
.
dayCount
=
_dayCount
;
[
self
.
rdv_tabBarController
.
navigationController
pushViewController
:
vc
animated
:
YES
];
[
self
.
rdv_tabBarController
.
navigationController
pushViewController
:
vc
animated
:
YES
];
NSLog
(
@"btnTag:%d"
,
sender
.
tag
);
}
}
-
(
void
)
queryInitCount
-
(
void
)
queryInitCount
...
@@ -709,6 +735,29 @@
...
@@ -709,6 +735,29 @@
method
:
BRNetMgrMethodPost
];
method
:
BRNetMgrMethodPost
];
[
self
.
networkMgr
startOperation
:
operation
];
[
self
.
networkMgr
startOperation
:
operation
];
}
}
-
(
void
)
selectNoticeDatas
{
_arrContents
=
[
DBDaoMgr
fetchNoticeByUserId
:[
DataMgr
getInstance
].
userID
];
// _arrContents = [DBDaoMgr fetchNoticeByUserId:@"277"];
[
_tableView
reloadData
];
}
-
(
void
)
requestDatas
{
[
UIApplication
showLoadingView
:
kTextShowInProgress
];
NSString
*
interface
=
@"queryNoticeListEX"
;
NSOperation
*
operation
=
[
self
.
networkMgr
operationWithURL
:
kBaseEXURL
(
interface
)
interface
:
interface
params
:
nil
dataType
:
BRNetMgrDataTypeJSON
method
:
BRNetMgrMethodPost
];
[
self
.
networkMgr
startOperation
:
operation
];
}
#pragma mark ============= BRNetworkMgr Delegate =============
#pragma mark ============= BRNetworkMgr Delegate =============
-
(
void
)
httpOperationSuccess
:
(
AFHTTPRequestOperation
*
)
operation
-
(
void
)
httpOperationSuccess
:
(
AFHTTPRequestOperation
*
)
operation
result
:
(
NSDictionary
*
)
result
result
:
(
NSDictionary
*
)
result
...
@@ -735,10 +784,131 @@
...
@@ -735,10 +784,131 @@
NSNotification
*
notification
=
[
NSNotification
notificationWithName
:
@"reloadNumber"
object
:
nil
userInfo
:
nil
];
NSNotification
*
notification
=
[
NSNotification
notificationWithName
:
@"reloadNumber"
object
:
nil
userInfo
:
nil
];
//通过通知中心发送通知
//通过通知中心发送通知
[[
NSNotificationCenter
defaultCenter
]
postNotification
:
notification
];
[[
NSNotificationCenter
defaultCenter
]
postNotification
:
notification
];
}
else
{
self
.
arrContents
=
result
[
@"noticeList"
];
[
_tableView
reloadData
];
if
(
_arrContents
!=
nil
&&
[
_arrContents
count
]
>
0
){
[
self
setTableViewBackground
:
nil
];
}
else
{
[
self
setTableViewBackground
:
@"pic_zanwushuju.png"
];
}
}
}
}
-
(
void
)
setTableViewBackground
:
(
NSString
*
)
imgName
{
if
(
imgName
!=
nil
){
UIImageView
*
view
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
imgName
]];
_tableView
.
backgroundView
=
view
;
}
}
#pragma mark UITableViewDelegate
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
cellIdentifier
=
@"NoticeListCell"
;
SACheckListCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellIdentifier
];
if
(
!
cell
)
{
cell
=
[[
SACheckListCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellIdentifier
];
}
cell
.
lblTitle
.
text
=
self
.
arrContents
[
indexPath
.
row
][
@"title"
];
cell
.
lblcontent
.
text
=
self
.
arrContents
[
indexPath
.
row
][
@"context"
];
cell
.
lblCreateTime
.
text
=
[
self
.
arrContents
[
indexPath
.
row
][
@"createTime"
]
substringToIndex
:
10
];
if
([
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
isEqualToString
:
@"01"
])
{
cell
.
lblTitle
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
lblCreateTime
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
lblcontent
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
view
.
hidden
=
NO
;
}
else
if
([
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
isEqualToString
:
@"02"
])
{
cell
.
lblTitle
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
lblCreateTime
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
lblcontent
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
view
.
hidden
=
YES
;
}
cell
.
tag
=
100
+
[
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
intValue
];
return
cell
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
strTitle
=
_noticeArr
[
indexPath
.
row
][
@"title"
];
CGFloat
hight1
=
[
strTitle
boundingRectWithSize
:
CGSizeMake
(
215
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
|
NSStringDrawingUsesLineFragmentOrigin
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
]}
context
:
nil
].
size
.
height
;
NSString
*
strContent
=
_noticeArr
[
indexPath
.
row
][
@"content"
];
CGFloat
hight2
=
[
strContent
boundingRectWithSize
:
CGSizeMake
(
275
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
|
NSStringDrawingUsesLineFragmentOrigin
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
13
]}
context
:
nil
].
size
.
height
+
10
+
22
+
10
+
5
;
if
(
hight2
>
20
)
{
return
hight1
+
15
+
40
+
10
;
}
else
{
return
hight1
+
15
+
20
+
10
;
}
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
arrContents
.
count
;
}
#pragma mark ============= UITableView Delegate =============
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
self
.
selectedIndexPath
=
indexPath
;
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
NSString
*
nid
=
_noticeArr
[
indexPath
.
row
][
@"noticeId"
];
[
DBDaoMgr
updateNoticeById
:
nid
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
kShouldReQueryCountInit
object
:
nil
];
// self.selectedIndexPath = indexPath;
//
// [tableView deselectRowAtIndexPath:indexPath animated:YES];
// if ([_tableType isEqualToString:@"notice"]) {
// NSDictionary* dic= self.noticeArr[indexPath.row];
// NoteDetailViewController *detailVC = [[NoteDetailViewController alloc] initWithNotice:dic];
// [self.rdv_tabBarController.navigationController pushViewController:detailVC animated:YES];
// NSString* nid = _noticeArr[indexPath.row][@"noticeId"];
// [DBDaoMgr updateNoticeById:nid];
// [self selectNoticeDatas];
// [[NSNotificationCenter defaultCenter] postNotificationName:kShouldReQueryCountInit object:nil];
// }
// else
// {
NoteDetailViewController
*
detailVC
=
[[
NoteDetailViewController
alloc
]
initWithNibName
:
nil
bundle
:
nil
];
detailVC
.
dictNotice
=
self
.
arrContents
[
indexPath
.
row
];
[
self
.
rdv_tabBarController
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
// }
}
}
#pragma --------------------- Navigation背景 -----------------------
#pragma --------------------- Navigation背景 -----------------------
-
(
void
)
setCustomNavBar
-
(
void
)
setCustomNavBar
{
{
...
@@ -768,4 +938,175 @@
...
@@ -768,4 +938,175 @@
}
}
*/
*/
#pragma mark lazy -load
-
(
UITableView
*
)
tableView
{
if
(
!
_tableView
){
_tableView
=
[[
UITableView
alloc
]
init
];
[
_tableView
setFrame
:
CGRectMake
(
0
,
120
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
))];
_tableView
.
delegate
=
self
;
_tableView
.
backgroundColor
=
[
UIColor
redColor
];
_tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
_tableView
];
}
return
_tableView
;
}
-
(
UIView
*
)
leftView
{
if
(
!
_leftView
){
_leftView
=
[[
UIView
alloc
]
init
];
[
_leftView
setFrame
:
CGRectMake
(
0
,
120
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
))];
[
self
.
view
addSubview
:
_leftView
];
}
return
_leftView
;
}
@end
@end
@implementation
SACheckListCell
-
(
void
)
dealloc
{
self
.
lblTitle
=
nil
;
self
.
lblCreateTime
=
nil
;
self
.
viewLine
=
nil
;
}
-
(
id
)
initWithStyle
:
(
UITableViewCellStyle
)
style
reuseIdentifier
:
(
NSString
*
)
reuseIdentifier
{
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
[
self
.
lblCreateTime
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
12
];
[
self
.
lblCreateTime
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
20
];
[
self
.
lblCreateTime
autoSetDimensionsToSize
:
CGSizeMake
(
80
,
20
)];
[
self
.
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
10
];
[
self
.
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeLeft
withInset
:
20
];
[
self
.
lblTitle
autoPinEdge
:
ALEdgeRight
toEdge
:
ALEdgeLeft
ofView
:
self
.
lblCreateTime
withOffset
:-
5
];
//[self.lblTitle autoPinEdge:ALEdgeRight toEdge:ALEdgeLeft ofView:self.lblCreateTime withOffset:-10];
[
self
.
view
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeTop
ofView
:
self
.
lblTitle
withOffset
:
4
];
[
self
.
view
autoPinEdge
:
ALEdgeRight
toEdge
:
ALEdgeLeft
ofView
:
self
.
lblTitle
withOffset
:-
3
];
[
self
.
view
autoSetDimensionsToSize
:
CGSizeMake
(
6
,
6
)];
[
self
.
lblcontent
autoPinEdgeToSuperviewEdge
:
ALEdgeLeft
withInset
:
20
];
[
self
.
lblcontent
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
25
];
[
self
.
lblcontent
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
self
.
lblTitle
withOffset
:
10
];
[
self
.
viewLine
autoSetDimension
:
ALDimensionHeight
toSize
:
0
.
5
];
// [self.viewLine autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblTitle withOffset:5];
[
self
.
viewLine
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
10
,
0
,
10
)
excludingEdge
:
ALEdgeTop
];
[
self
.
imageview
autoAlignAxis
:
ALAxisHorizontal
toSameAxisOfView
:
self
];
[
self
.
imageview
autoPinEdge
:
ALEdgeLeft
toEdge
:
ALEdgeRight
ofView
:
self
.
lblcontent
withOffset
:
4
];
[
self
.
imageview
autoSetDimensionsToSize
:
CGSizeMake
(
8
,
15
)];
}
return
self
;
}
//- (void)setSelected:(BOOL)selected animated:(BOOL)animated
//{
// [super setSelected:selected animated:animated];
// if (selected) {
// if (self.tag == 101) {//未读
// self.lblCreateTime.backgroundColor = RGBColor(229, 0, 129, 1);
// }else {
// self.lblCreateTime.backgroundColor = [UIColor grayColor];
// }
//
// }
//
//}
//
//- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
//{
// [super setHighlighted:highlighted animated:animated];
// if (highlighted) {
// if (self.tag == 101) {//未读
// self.lblCreateTime.backgroundColor = RGBColor(229, 0, 129, 1);
// }else {
// self.lblCreateTime.backgroundColor = [UIColor grayColor];
// }
// }
//
//}
#pragma mark ============= LazyLoad Properties =============
-
(
UIView
*
)
viewLine
{
if
(
!
_viewLine
)
{
self
.
viewLine
=
[
UIView
newAutoLayoutView
];
_viewLine
.
backgroundColor
=
[
UIColor
lightGrayColor
];
[
self
.
contentView
addSubview
:
_viewLine
];
}
return
_viewLine
;
}
-
(
UIView
*
)
view
{
if
(
!
_view
)
{
self
.
view
=
[
UIView
newAutoLayoutView
];
_view
.
backgroundColor
=
RGBColor
(
246
,
88
,
95
,
1
);
_view
.
layer
.
cornerRadius
=
3
;
[
self
.
contentView
addSubview
:
_view
];
}
return
_view
;
}
-
(
UILabel
*
)
lblcontent
{
if
(
!
_lblcontent
)
{
self
.
lblcontent
=
[
UILabel
newAutoLayoutView
];
self
.
lblcontent
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
lblcontent
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
lblcontent
.
textColor
=
[
UIColor
blackColor
];
self
.
lblcontent
.
font
=
[
UIFont
systemFontOfSize
:
13
];
self
.
lblcontent
.
numberOfLines
=
2
;
[
self
.
contentView
addSubview
:
_lblcontent
];
}
return
_lblcontent
;
}
-
(
UILabel
*
)
lblTitle
{
if
(
!
_lblTitle
)
{
self
.
lblTitle
=
[
UILabel
newAutoLayoutView
];
self
.
lblTitle
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
lblTitle
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
lblTitle
.
textColor
=
[
UIColor
blackColor
];
self
.
lblTitle
.
font
=
[
UIFont
systemFontOfSize
:
15
];
self
.
lblTitle
.
numberOfLines
=
0
;
[
self
.
contentView
addSubview
:
_lblTitle
];
}
return
_lblTitle
;
}
-
(
UILabel
*
)
lblCreateTime
{
if
(
!
_lblCreateTime
)
{
self
.
lblCreateTime
=
[
UILabel
newAutoLayoutView
];
self
.
lblCreateTime
.
textColor
=
[
UIColor
whiteColor
];
self
.
lblCreateTime
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
lblCreateTime
.
font
=
[
UIFont
systemFontOfSize
:
12
];
[
self
.
contentView
addSubview
:
_lblCreateTime
];
}
return
_lblCreateTime
;
}
-
(
UIImageView
*
)
imageview
{
if
(
!
_imageview
)
{
self
.
imageview
=
[
UIImageView
newAutoLayoutView
];
_imageview
.
image
=
[
UIImage
imageNamed
:
@"Task_Point/image_point_arrow.png"
];
[
self
.
contentView
addSubview
:
_imageview
];
}
return
_imageview
;
}
@end
Macalline/Classes/ViewControllers/System/NewHomeViewController.h
View file @
74de6228
...
@@ -9,6 +9,21 @@
...
@@ -9,6 +9,21 @@
#import "BaseScrollTableViewController.h"
#import "BaseScrollTableViewController.h"
@interface
NewHomeViewController
:
BaseScrollTableViewController
@interface
NewHomeViewController
:
BaseScrollTableViewController
@property
(
nonatomic
,
strong
)
NSArray
*
noticeArr
;
@property
(
nonatomic
,
strong
)
NSString
*
unFinishedTaskCount
;
@property
(
nonatomic
,
strong
)
NSString
*
unFinishedTaskCount
;
@property
(
nonatomic
,
strong
)
NSString
*
progress
;
@property
(
nonatomic
,
strong
)
NSString
*
progress
;
@property
(
nonatomic
,
strong
)
NSArray
*
arrContents
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableVContent
;
@property
(
nonatomic
,
strong
)
UIImageView
*
imageVNoResult
;
@end
@end
@interface
CheckListCell
:
BaseTableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
lblcontent
;
@property
(
nonatomic
,
strong
)
UILabel
*
lblTitle
;
@property
(
nonatomic
,
strong
)
UILabel
*
lblCreateTime
;
@property
(
nonatomic
,
strong
)
UIView
*
viewCreateTime
;
@property
(
nonatomic
,
strong
)
UIView
*
viewLine
;
@property
(
nonatomic
,
strong
)
UIView
*
view
;
@property
(
nonatomic
,
strong
)
UIImageView
*
imageview
;
@end
\ No newline at end of file
Macalline/Classes/ViewControllers/System/NewHomeViewController.m
View file @
74de6228
...
@@ -14,8 +14,9 @@
...
@@ -14,8 +14,9 @@
#import "TypePickerView.h"
#import "TypePickerView.h"
#import "TaskListViewController.h"
#import "TaskListViewController.h"
#import "BackGroundMusicViewController.h"
#import "BackGroundMusicViewController.h"
#import "DBDaoMgr.h"
@interface
NewHomeViewController
()
@interface
NewHomeViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
{
{
UIImageView
*
prcessImage
;
UIImageView
*
prcessImage
;
UIView
*
prcessBgView
;
UIView
*
prcessBgView
;
...
@@ -25,6 +26,11 @@
...
@@ -25,6 +26,11 @@
UIView
*
cxView
;
UIView
*
cxView
;
UIView
*
dayView
;
UIView
*
dayView
;
UILabel
*
strnum
;
UILabel
*
strnum
;
UITableView
*
checkList
;
UIView
*
leftView
;
}
}
@end
@end
...
@@ -45,6 +51,7 @@
...
@@ -45,6 +51,7 @@
// Do any additional setup after loading the view.
// Do any additional setup after loading the view.
self
.
navigationItem
.
leftBarButtonItems
=
nil
;
self
.
navigationItem
.
leftBarButtonItems
=
nil
;
self
.
navigationController
.
navigationBarHidden
=
YES
;
self
.
navigationController
.
navigationBarHidden
=
YES
;
// UIView *statusView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
// UIView *statusView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
// statusView.backgroundColor = RGBColor(0, 120, 193, 1);
// statusView.backgroundColor = RGBColor(0, 120, 193, 1);
// [self.view addSubview:statusView];
// [self.view addSubview:statusView];
...
@@ -56,6 +63,7 @@
...
@@ -56,6 +63,7 @@
headbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/top_bg_tab_left.png"
];
headbg
.
image
=
[
UIImage
imageNamed
:
@"NavBar/top_bg_tab_left.png"
];
[
headView
addSubview
:
headbg
];
[
headView
addSubview
:
headbg
];
UILabel
*
lblTitle
=
[[
UILabel
alloc
]
init
];
UILabel
*
lblTitle
=
[[
UILabel
alloc
]
init
];
lblTitle
.
text
=
@"首页"
;
lblTitle
.
text
=
@"首页"
;
lblTitle
.
textColor
=
[
UIColor
whiteColor
];
lblTitle
.
textColor
=
[
UIColor
whiteColor
];
...
@@ -97,12 +105,51 @@
...
@@ -97,12 +105,51 @@
[
weakSelf
typePickerViewClickAtIndex
:
index
];
[
weakSelf
typePickerViewClickAtIndex
:
index
];
};
};
UIView
*
descView
=
[[
UIView
alloc
]
init
];
[
self
initLeftView
];
[
headView
addSubview
:
descView
];
[
self
initRightView
];
[
descView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdgeTop
];
[
descView
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
typePickerView
];
}
-
(
void
)
typePickerViewClickAtIndex
:
(
int
)
index
{
if
(
index
==
0
){
[
checkList
setHidden
:
true
];
[
leftView
setHidden
:
false
];
}
else
{
[
checkList
setHidden
:
false
];
[
leftView
setHidden
:
true
];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
self
.
navigationController
.
navigationBarHidden
=
YES
;
self
.
rdv_tabBarController
.
navigationController
.
navigationBarHidden
=
YES
;
[
self
queryInitCount
];
[
self
requestDatas
];
if
([[
UIApplication
getObjectType
:
Number
key
:
kShouldRequestDataWhenBack
]
boolValue
])
{
//[self.dictTableDatas removeAllObjects];
//[self reRequestTableViewDatas];
[
UIApplication
saveObject
:
@NO
type
:
Number
key
:
kShouldRequestDataWhenBack
];
}
}
-
(
void
)
initLeftView
{
leftView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
120
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
))];
[
leftView
setUserInteractionEnabled
:
true
];
// [leftView setBackgroundColor:[UIColor blueColor]];
[
self
.
view
addSubview
:
leftView
];
//int numbervalue = [_finishedTaskCount intValue]/([_finishedTaskCount intValue]+[_unFinishedTaskCount intValue]);
UIView
*
descView
=
[[
UIView
alloc
]
init
];
[
leftView
addSubview
:
descView
];
[
descView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdgeBottom
];
lblNum
=
[[
UILabel
alloc
]
init
];
lblNum
=
[[
UILabel
alloc
]
init
];
lblNum
.
text
=
@"33"
;
lblNum
.
text
=
@"33"
;
...
@@ -130,7 +177,7 @@
...
@@ -130,7 +177,7 @@
[
btnUnRead
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
10
];
[
btnUnRead
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
10
];
[
btnUnRead
autoAlignAxis
:
ALAxisHorizontal
toSameAxisOfView
:
lblNum
];
[
btnUnRead
autoAlignAxis
:
ALAxisHorizontal
toSameAxisOfView
:
lblNum
];
[
btnUnRead
autoSetDimensionsToSize
:
CGSizeMake
(
107
,
25
)];
[
btnUnRead
autoSetDimensionsToSize
:
CGSizeMake
(
107
,
25
)];
NSString
*
str
=
[
NSString
stringWithFormat
:
@"个任务待上报"
];
NSString
*
str
=
[
NSString
stringWithFormat
:
@"个任务待上报"
];
...
@@ -196,10 +243,10 @@
...
@@ -196,10 +243,10 @@
[
descView
addSubview
:
lbllocation
];
[
descView
addSubview
:
lbllocation
];
[
lbllocation
autoPinEdge
:
ALEdgeBottom
toEdge
:
ALEdgeTop
ofView
:
btnUnRead
withOffset
:-
4
];
[
lbllocation
autoPinEdge
:
ALEdgeBottom
toEdge
:
ALEdgeTop
ofView
:
btnUnRead
withOffset
:-
4
];
[
lbllocation
autoAlignAxis
:
ALEdgeRight
toSameAxisOfView
:
btnUnRead
];
[
lbllocation
autoAlignAxis
:
ALEdgeRight
toSameAxisOfView
:
btnUnRead
];
UIImageView
*
locationImage
=
[[
UIImageView
alloc
]
init
];
UIImageView
*
locationImage
=
[[
UIImageView
alloc
]
init
];
...
@@ -232,11 +279,15 @@
...
@@ -232,11 +279,15 @@
bgImage
.
image
=
[
UIImage
imageNamed
:
@"NavBar/progress_bar.png"
];
bgImage
.
image
=
[
UIImage
imageNamed
:
@"NavBar/progress_bar.png"
];
[
prcessBgView
addSubview
:
bgImage
];
[
prcessBgView
addSubview
:
bgImage
];
UIScrollView
*
scrollerView
=
[[
UIScrollView
alloc
]
init
];
// UIScrollView* scrollerView = [[UIScrollView alloc] init];
UIScrollView
*
scrollerView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
80
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
)
-
200
)];
scrollerView
.
backgroundColor
=
[
UIColor
clearColor
];
scrollerView
.
backgroundColor
=
[
UIColor
clearColor
];
[
self
.
view
addSubview
:
scrollerView
];
[
leftView
addSubview
:
scrollerView
];
[
scrollerView
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
)
excludingEdge
:
ALEdgeTop
];
[
scrollerView
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
headView
];
// [scrollerView autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) excludingEdge:ALEdgeTop];
// [scrollerView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:descView];
// [scrollerView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:leftView];
UILabel
*
lblCX
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
0
,
320
,
25
)];
UILabel
*
lblCX
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
0
,
320
,
25
)];
lblCX
.
textColor
=
[
UIColor
colorWithRed
:
0
.
9529
green
:
0
.
6471
blue
:
0
.
2118
alpha
:
1
];
lblCX
.
textColor
=
[
UIColor
colorWithRed
:
0
.
9529
green
:
0
.
6471
blue
:
0
.
2118
alpha
:
1
];
...
@@ -255,7 +306,7 @@
...
@@ -255,7 +306,7 @@
UIButton
*
btn
=
[
self
creatBtnWithIndex
:
i
withType
:
@"cx"
];
UIButton
*
btn
=
[
self
creatBtnWithIndex
:
i
withType
:
@"cx"
];
[
cxView
addSubview
:
btn
];
[
cxView
addSubview
:
btn
];
}
}
UILabel
*
lblRC
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
h
+
25
,
320
,
25
)];
UILabel
*
lblRC
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
10
,
h
+
25
,
320
,
25
)];
...
@@ -263,7 +314,7 @@
...
@@ -263,7 +314,7 @@
lblRC
.
font
=
[
UIFont
boldSystemFontOfSize
:
14
];
lblRC
.
font
=
[
UIFont
boldSystemFontOfSize
:
14
];
lblRC
.
text
=
@"日常"
;
lblRC
.
text
=
@"日常"
;
[
scrollerView
addSubview
:
lblRC
];
[
scrollerView
addSubview
:
lblRC
];
dayView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
h
+
50
,
w
*
3
,
h
*
2
)];
dayView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
h
+
50
,
w
*
3
,
h
*
2
)];
[
scrollerView
addSubview
:
dayView
];
[
scrollerView
addSubview
:
dayView
];
...
@@ -274,27 +325,6 @@
...
@@ -274,27 +325,6 @@
scrollerView
.
contentSize
=
CGSizeMake
(
w
*
3
,
h
*
3
+
50
);
scrollerView
.
contentSize
=
CGSizeMake
(
w
*
3
,
h
*
3
+
50
);
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
reloadUI
)
name
:
@"reloadNumber"
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
reloadUI
)
name
:
@"reloadNumber"
object
:
nil
];
}
-
(
void
)
typePickerViewClickAtIndex
:
(
int
)
index
{
NSLog
(
@"click:%d"
,
index
);
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
self
.
navigationController
.
navigationBarHidden
=
YES
;
self
.
rdv_tabBarController
.
navigationController
.
navigationBarHidden
=
YES
;
[
self
queryInitCount
];
if
([[
UIApplication
getObjectType
:
Number
key
:
kShouldRequestDataWhenBack
]
boolValue
])
{
//[self.dictTableDatas removeAllObjects];
//[self reRequestTableViewDatas];
[
UIApplication
saveObject
:
@NO
type
:
Number
key
:
kShouldRequestDataWhenBack
];
}
}
}
-
(
void
)
reloadUI
-
(
void
)
reloadUI
...
@@ -552,6 +582,16 @@
...
@@ -552,6 +582,16 @@
}
}
}
}
}
}
[
self
.
view
addSubview
:
leftView
];
}
-
(
void
)
initRightView
{
checkList
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
120
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
)
-
164
)];
// checkList = [[UITableView alloc]init];
checkList
.
delegate
=
self
;
checkList
.
dataSource
=
self
;
[
checkList
setHidden
:
true
];
[
self
.
view
addSubview
:
checkList
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
[
super
didReceiveMemoryWarning
];
...
@@ -649,7 +689,7 @@
...
@@ -649,7 +689,7 @@
lblUndoneNum
.
hidden
=
YES
;
lblUndoneNum
.
hidden
=
YES
;
[
btn
addTarget
:
self
action
:
@selector
(
btnSelcted
:
)
forControlEvents
:
UIControlEventTouch
UpInside
];
[
btn
addTarget
:
self
action
:
@selector
(
btnSelcted
:
)
forControlEvents
:
UIControlEventTouch
Down
];
return
btn
;
return
btn
;
}
}
...
@@ -702,7 +742,6 @@
...
@@ -702,7 +742,6 @@
}
}
}
}
[
self
.
rdv_tabBarController
.
navigationController
pushViewController
:
vc
animated
:
YES
];
[
self
.
rdv_tabBarController
.
navigationController
pushViewController
:
vc
animated
:
YES
];
}
}
-
(
void
)
queryInitCount
-
(
void
)
queryInitCount
...
@@ -715,6 +754,27 @@
...
@@ -715,6 +754,27 @@
method
:
BRNetMgrMethodPost
];
method
:
BRNetMgrMethodPost
];
[
self
.
networkMgr
startOperation
:
operation
];
[
self
.
networkMgr
startOperation
:
operation
];
}
}
-
(
void
)
selectNoticeDatas
{
_arrContents
=
[
DBDaoMgr
fetchNoticeByUserId
:[
DataMgr
getInstance
].
userID
];
// _arrContents = [DBDaoMgr fetchNoticeByUserId:@"277"];
[
checkList
reloadData
];
}
-
(
void
)
requestDatas
{
[
UIApplication
showLoadingView
:
kTextShowInProgress
];
NSString
*
interface
=
@"queryNoticeListEX"
;
NSOperation
*
operation
=
[
self
.
networkMgr
operationWithURL
:
kBaseEXURL
(
interface
)
interface
:
interface
params
:
nil
dataType
:
BRNetMgrDataTypeJSON
method
:
BRNetMgrMethodPost
];
[
self
.
networkMgr
startOperation
:
operation
];
}
#pragma mark ============= BRNetworkMgr Delegate =============
#pragma mark ============= BRNetworkMgr Delegate =============
-
(
void
)
httpOperationSuccess
:
(
AFHTTPRequestOperation
*
)
operation
-
(
void
)
httpOperationSuccess
:
(
AFHTTPRequestOperation
*
)
operation
result
:
(
NSDictionary
*
)
result
result
:
(
NSDictionary
*
)
result
...
@@ -741,6 +801,18 @@
...
@@ -741,6 +801,18 @@
NSNotification
*
notification
=
[
NSNotification
notificationWithName
:
@"reloadNumber"
object
:
nil
userInfo
:
nil
];
NSNotification
*
notification
=
[
NSNotification
notificationWithName
:
@"reloadNumber"
object
:
nil
userInfo
:
nil
];
//通过通知中心发送通知
//通过通知中心发送通知
[[
NSNotificationCenter
defaultCenter
]
postNotification
:
notification
];
[[
NSNotificationCenter
defaultCenter
]
postNotification
:
notification
];
}
else
{
self
.
arrContents
=
result
[
@"noticeList"
];
[
checkList
reloadData
];
if
(
_arrContents
!=
nil
&&
[
_arrContents
count
]
>
0
){
[
self
setTableViewBackground
:
nil
];
}
else
{
[
self
setTableViewBackground
:
@"pic_zanwushuju.png"
];
}
}
}
}
}
...
@@ -761,4 +833,243 @@
...
@@ -761,4 +833,243 @@
}
}
*/
*/
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
cellIdentifier
=
@"NoticeListCell"
;
CheckListCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellIdentifier
];
if
(
!
cell
)
{
cell
=
[[
CheckListCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellIdentifier
];
}
cell
.
lblTitle
.
text
=
self
.
arrContents
[
indexPath
.
row
][
@"title"
];
cell
.
lblcontent
.
text
=
self
.
arrContents
[
indexPath
.
row
][
@"context"
];
cell
.
lblCreateTime
.
text
=
[
self
.
arrContents
[
indexPath
.
row
][
@"createTime"
]
substringToIndex
:
10
];
if
([
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
isEqualToString
:
@"01"
])
{
cell
.
lblTitle
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
lblCreateTime
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
lblcontent
.
textColor
=
[
UIColor
darkGrayColor
];
cell
.
view
.
hidden
=
NO
;
}
else
if
([
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
isEqualToString
:
@"02"
])
{
cell
.
lblTitle
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
lblCreateTime
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
lblcontent
.
textColor
=
[
UIColor
lightGrayColor
];
cell
.
view
.
hidden
=
YES
;
}
cell
.
tag
=
100
+
[
self
.
arrContents
[
indexPath
.
row
][
@"isRead"
]
intValue
];
return
cell
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
strTitle
=
_noticeArr
[
indexPath
.
row
][
@"title"
];
CGFloat
hight1
=
[
strTitle
boundingRectWithSize
:
CGSizeMake
(
215
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
|
NSStringDrawingUsesLineFragmentOrigin
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
15
]}
context
:
nil
].
size
.
height
;
NSString
*
strContent
=
_noticeArr
[
indexPath
.
row
][
@"content"
];
CGFloat
hight2
=
[
strContent
boundingRectWithSize
:
CGSizeMake
(
275
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
|
NSStringDrawingUsesLineFragmentOrigin
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
13
]}
context
:
nil
].
size
.
height
+
10
+
22
+
10
+
5
;
if
(
hight2
>
20
)
{
return
hight1
+
15
+
40
+
10
;
}
else
{
return
hight1
+
15
+
20
+
10
;
}
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
arrContents
.
count
;
}
#pragma mark ============= UITableView Delegate =============
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
self
.
selectedIndexPath
=
indexPath
;
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
NSString
*
nid
=
_noticeArr
[
indexPath
.
row
][
@"noticeId"
];
[
DBDaoMgr
updateNoticeById
:
nid
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
kShouldReQueryCountInit
object
:
nil
];
}
-
(
UIImageView
*
)
imageVNoResult
{
if
(
!
_imageVNoResult
)
{
self
.
imageVNoResult
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
200
,
CGRectGetWidth
(
self
.
view
.
frame
),
CGRectGetHeight
(
self
.
view
.
frame
)
-
244
)]
;
_imageVNoResult
.
image
=
[
UIImage
imageNamed
:
@"pic_zanwushuju.png"
];
[
self
.
view
addSubview
:
_imageVNoResult
];
}
return
_imageVNoResult
;
}
-
(
void
)
setTableViewBackground
:
(
NSString
*
)
imgName
{
if
(
imgName
!=
nil
){
UIImageView
*
view
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
imgName
]];
checkList
.
backgroundView
=
view
;
}
}
@end
@end
@implementation
CheckListCell
-
(
void
)
dealloc
{
self
.
lblTitle
=
nil
;
self
.
lblCreateTime
=
nil
;
self
.
viewLine
=
nil
;
}
-
(
id
)
initWithStyle
:
(
UITableViewCellStyle
)
style
reuseIdentifier
:
(
NSString
*
)
reuseIdentifier
{
if
(
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
])
{
[
self
.
lblCreateTime
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
12
];
[
self
.
lblCreateTime
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
20
];
[
self
.
lblCreateTime
autoSetDimensionsToSize
:
CGSizeMake
(
80
,
20
)];
[
self
.
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeTop
withInset
:
10
];
[
self
.
lblTitle
autoPinEdgeToSuperviewEdge
:
ALEdgeLeft
withInset
:
20
];
[
self
.
lblTitle
autoPinEdge
:
ALEdgeRight
toEdge
:
ALEdgeLeft
ofView
:
self
.
lblCreateTime
withOffset
:-
5
];
//[self.lblTitle autoPinEdge:ALEdgeRight toEdge:ALEdgeLeft ofView:self.lblCreateTime withOffset:-10];
[
self
.
view
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeTop
ofView
:
self
.
lblTitle
withOffset
:
4
];
[
self
.
view
autoPinEdge
:
ALEdgeRight
toEdge
:
ALEdgeLeft
ofView
:
self
.
lblTitle
withOffset
:-
3
];
[
self
.
view
autoSetDimensionsToSize
:
CGSizeMake
(
6
,
6
)];
[
self
.
lblcontent
autoPinEdgeToSuperviewEdge
:
ALEdgeLeft
withInset
:
20
];
[
self
.
lblcontent
autoPinEdgeToSuperviewEdge
:
ALEdgeRight
withInset
:
25
];
[
self
.
lblcontent
autoPinEdge
:
ALEdgeTop
toEdge
:
ALEdgeBottom
ofView
:
self
.
lblTitle
withOffset
:
10
];
[
self
.
viewLine
autoSetDimension
:
ALDimensionHeight
toSize
:
0
.
5
];
// [self.viewLine autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.lblTitle withOffset:5];
[
self
.
viewLine
autoPinEdgesToSuperviewEdgesWithInsets
:
UIEdgeInsetsMake
(
0
,
10
,
0
,
10
)
excludingEdge
:
ALEdgeTop
];
[
self
.
imageview
autoAlignAxis
:
ALAxisHorizontal
toSameAxisOfView
:
self
];
[
self
.
imageview
autoPinEdge
:
ALEdgeLeft
toEdge
:
ALEdgeRight
ofView
:
self
.
lblcontent
withOffset
:
4
];
[
self
.
imageview
autoSetDimensionsToSize
:
CGSizeMake
(
8
,
15
)];
}
return
self
;
}
//- (void)setSelected:(BOOL)selected animated:(BOOL)animated
//{
// [super setSelected:selected animated:animated];
// if (selected) {
// if (self.tag == 101) {//未读
// self.lblCreateTime.backgroundColor = RGBColor(229, 0, 129, 1);
// }else {
// self.lblCreateTime.backgroundColor = [UIColor grayColor];
// }
//
// }
//
//}
//
//- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
//{
// [super setHighlighted:highlighted animated:animated];
// if (highlighted) {
// if (self.tag == 101) {//未读
// self.lblCreateTime.backgroundColor = RGBColor(229, 0, 129, 1);
// }else {
// self.lblCreateTime.backgroundColor = [UIColor grayColor];
// }
// }
//
//}
#pragma mark ============= LazyLoad Properties =============
-
(
UIView
*
)
viewLine
{
if
(
!
_viewLine
)
{
self
.
viewLine
=
[
UIView
newAutoLayoutView
];
_viewLine
.
backgroundColor
=
[
UIColor
lightGrayColor
];
[
self
.
contentView
addSubview
:
_viewLine
];
}
return
_viewLine
;
}
-
(
UIView
*
)
view
{
if
(
!
_view
)
{
self
.
view
=
[
UIView
newAutoLayoutView
];
_view
.
backgroundColor
=
RGBColor
(
246
,
88
,
95
,
1
);
_view
.
layer
.
cornerRadius
=
3
;
[
self
.
contentView
addSubview
:
_view
];
}
return
_view
;
}
-
(
UILabel
*
)
lblcontent
{
if
(
!
_lblcontent
)
{
self
.
lblcontent
=
[
UILabel
newAutoLayoutView
];
self
.
lblcontent
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
lblcontent
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
lblcontent
.
textColor
=
[
UIColor
blackColor
];
self
.
lblcontent
.
font
=
[
UIFont
systemFontOfSize
:
13
];
self
.
lblcontent
.
numberOfLines
=
2
;
[
self
.
contentView
addSubview
:
_lblcontent
];
}
return
_lblcontent
;
}
-
(
UILabel
*
)
lblTitle
{
if
(
!
_lblTitle
)
{
self
.
lblTitle
=
[
UILabel
newAutoLayoutView
];
self
.
lblTitle
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
lblTitle
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
lblTitle
.
textColor
=
[
UIColor
blackColor
];
self
.
lblTitle
.
font
=
[
UIFont
systemFontOfSize
:
15
];
self
.
lblTitle
.
numberOfLines
=
0
;
[
self
.
contentView
addSubview
:
_lblTitle
];
}
return
_lblTitle
;
}
-
(
UILabel
*
)
lblCreateTime
{
if
(
!
_lblCreateTime
)
{
self
.
lblCreateTime
=
[
UILabel
newAutoLayoutView
];
self
.
lblCreateTime
.
textColor
=
[
UIColor
whiteColor
];
self
.
lblCreateTime
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
lblCreateTime
.
font
=
[
UIFont
systemFontOfSize
:
12
];
[
self
.
contentView
addSubview
:
_lblCreateTime
];
}
return
_lblCreateTime
;
}
-
(
UIImageView
*
)
imageview
{
if
(
!
_imageview
)
{
self
.
imageview
=
[
UIImageView
newAutoLayoutView
];
_imageview
.
image
=
[
UIImage
imageNamed
:
@"Task_Point/image_point_arrow.png"
];
[
self
.
contentView
addSubview
:
_imageview
];
}
return
_imageview
;
}
@end
Macalline/Classes/ViewControllers/TabBar/TabBarViewController.m
View file @
74de6228
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
self
.
viewControllers
=
@[
navhomew
,
navNotice
,
navSetting
];
self
.
viewControllers
=
@[
navhomew
,
navNotice
,
navSetting
];
//加载视图资源
[
self
customizeTabBarForController
:
self
];
[
self
customizeTabBarForController
:
self
];
self
.
delegate
=
self
;
self
.
delegate
=
self
;
self
.
hidesBottomBarWhenPushed
=
YES
;
self
.
hidesBottomBarWhenPushed
=
YES
;
...
@@ -273,8 +274,8 @@
...
@@ -273,8 +274,8 @@
// @[[NSString stringWithFormat:@"未完成(%@)", result[@"unFinishedTaskCount"]],
// @[[NSString stringWithFormat:@"未完成(%@)", result[@"unFinishedTaskCount"]],
// [NSString stringWithFormat:@"已完成(%@)", result[@"finishedTaskCount"]]]];
// [NSString stringWithFormat:@"已完成(%@)", result[@"finishedTaskCount"]]]];
// [vcTask reloadItemTitles];
// [vcTask reloadItemTitles];
vcHome
.
unFinishedTaskCount
=
result
[
@"unFinishedTaskCount"
];
//
vcHome.unFinishedTaskCount = result[@"unFinishedTaskCount"];
vcHome
.
progress
=
[
NSString
stringWithFormat
:
@"%@"
,
result
[
@"progress"
]];
//
vcHome.progress = [NSString stringWithFormat:@"%@",result[@"progress"]];
[
DataMgr
getInstance
].
dayCount
=
result
[
@"days"
];
[
DataMgr
getInstance
].
dayCount
=
result
[
@"days"
];
[
DataMgr
getInstance
].
unfinishedTaskCountToDacuxiao
=
result
[
@"dacuxiaoUndoneNum"
];
[
DataMgr
getInstance
].
unfinishedTaskCountToDacuxiao
=
result
[
@"dacuxiaoUndoneNum"
];
...
...
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