Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Dolphins
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
Dolphins
Commits
b75065f0
Commit
b75065f0
authored
Jul 30, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into lmj_branch
parents
cea7aa3f
84ff71f8
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
401 additions
and
52 deletions
+401
-52
project.pbxproj
Dolphins.xcodeproj/project.pbxproj
+4
-4
xcschememanagement.plist
...angguangyi.xcuserdatad/xcschemes/xcschememanagement.plist
+14
-0
UserInterfaceState.xcuserstate
...a/zhangguangyi.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Breakpoints_v2.xcbkptlist
...gguangyi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+13
-0
ZJGuardViewController.m
Dolphins/Classes/Guard/Controller/ZJGuardViewController.m
+2
-7
ZJAddReminderController.m
...ins/Classes/Reminder/Controller/ZJAddReminderController.m
+3
-4
ZJReminderCareController.m
...ns/Classes/Reminder/Controller/ZJReminderCareController.m
+7
-1
ZJReminderCateAddController.m
...Classes/Reminder/Controller/ZJReminderCateAddController.m
+66
-7
ZJReminderMainController.m
...ns/Classes/Reminder/Controller/ZJReminderMainController.m
+76
-8
ZJReminderTimeController.h
...ns/Classes/Reminder/Controller/ZJReminderTimeController.h
+8
-0
ZJReminderTimeController.m
...ns/Classes/Reminder/Controller/ZJReminderTimeController.m
+38
-5
GYEmptyView.m
Dolphins/Classes/Reminder/Others/GYEmptyView/GYEmptyView.m
+1
-1
QFTimePickerView.m
Dolphins/Classes/Reminder/Others/QFTimePickerView.m
+11
-10
ZJReminder.h
Dolphins/Classes/Reminder/Others/ZJReminder.h
+7
-3
ZJReminderCareCell.xib
Dolphins/Classes/Reminder/View/ZJReminderCareCell.xib
+6
-0
ZJReminderMainCell.h
Dolphins/Classes/Reminder/View/ZJReminderMainCell.h
+3
-0
ZJReminderMainCell.m
Dolphins/Classes/Reminder/View/ZJReminderMainCell.m
+20
-0
TQNetworkTools.h
Dolphins/Classes/Tools/Network/TQNetworkTools.h
+5
-2
TQNetworkTools.m
Dolphins/Classes/Tools/Network/TQNetworkTools.m
+8
-0
xcschememanagement.plist
...angguangyi.xcuserdatad/xcschemes/xcschememanagement.plist
+109
-0
No files found.
Dolphins.xcodeproj/project.pbxproj
View file @
b75065f0
...
...
@@ -1466,13 +1466,13 @@
isa
=
PBXGroup
;
children
=
(
BFCEA59824D115950010B2F0
/* GYEmptyBaseView.h */
,
BFCEA59924D115950010B2F0
/* UIScrollView+GYEmpty.h */
,
BFCEA59A24D115950010B2F0
/* UIView+GYView.h */
,
BFCEA59B24D115950010B2F0
/* GYEmptyView.m */
,
BFCEA59C24D115950010B2F0
/* GYEmptyBaseView.m */
,
BFCEA59924D115950010B2F0
/* UIScrollView+GYEmpty.h */
,
BFCEA59D24D115950010B2F0
/* UIScrollView+GYEmpty.m */
,
BFCEA59E24D115950010B2F0
/* UIView+GYView.m */
,
BFCEA59F24D115950010B2F0
/* GYEmptyView.h */
,
BFCEA59B24D115950010B2F0
/* GYEmptyView.m */
,
BFCEA59A24D115950010B2F0
/* UIView+GYView.h */
,
BFCEA59E24D115950010B2F0
/* UIView+GYView.m */
,
);
path
=
GYEmptyView
;
sourceTree
=
"<group>"
;
...
...
Dolphins.xcodeproj/xcuserdata/zhangguangyi.xcuserdatad/xcschemes/xcschememanagement.plist
0 → 100644
View file @
b75065f0
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
SchemeUserState
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
Dolphins.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
0
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
Dolphins.xcworkspace/xcuserdata/zhangguangyi.xcuserdatad/UserInterfaceState.xcuserstate
View file @
b75065f0
No preview for this file type
Dolphins.xcworkspace/xcuserdata/zhangguangyi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
b75065f0
...
...
@@ -3,4 +3,17 @@
uuid =
"05A8EC5D-3D7B-4194-AF9F-73A026E946A1"
type =
"0"
version =
"2.0"
>
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID =
"Xcode.Breakpoint.ExceptionBreakpoint"
>
<BreakpointContent
uuid =
"5D196504-A57E-4C19-8980-1EA44BF9CEDF"
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
scope =
"1"
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Dolphins/Classes/Guard/Controller/ZJGuardViewController.m
View file @
b75065f0
...
...
@@ -32,21 +32,16 @@
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
self
.
navigationController
setNavigationBarHidden
:
YES
animated
:
YES
];
[
self
requestRemindList
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
_dataSource
=
[[
NSMutableArray
alloc
]
init
];
// _dataSource = @[@{@"title":@"多吃蔬菜", @"image":@"remind_cell_2_3"},
// @{@"title":@"记得起床", @"image":@"remind_cell_3_2"},
// @{@"title":@"多吃水果", @"image":@"remind_cell_2_0"},
// @{@"title":@"多喝水", @"image":@"remind_cell_0_2"},
// @{@"title":@"添加提醒", @"image":@"remind_cell_Add"}].mutableCopy;
[
self
setUI
];
[
self
getFriendList
];
[
self
requestRemindList
];
}
-
(
void
)
setUI
{
...
...
Dolphins/Classes/Reminder/Controller/ZJAddReminderController.m
View file @
b75065f0
...
...
@@ -41,17 +41,16 @@
}
NSDictionary
*
dict
=
@{
@"iconId"
:
@
(
self
.
chooseModel
.
id
),
@"name"
:
self
.
textField
.
text
};
// dict[@"remindTypeInsert"] = @{@"iconId":@(self.chooseModel.id),@"name":self.textField.text}
;
[
MBProgressHUD
showHUD
:
@""
view
:
self
.
view
]
;
[[
TQNetworkTools
shared
]
postWithBodyAction
:
reminderAddRemindType
parameters
:@{}
body
:
dict
success
:^
(
NSDictionary
*
_Nonnull
response
)
{
if
([
response
[
@"status"
]
intValue
]
==
200
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
else
{
[
MBProgressHUD
showMessage
:
@"服务出错,请稍后重试!"
];
}
[
MBProgressHUD
hideHUDForView
:
self
.
view
];
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
[
MBProgressHUD
hideHUDForView
:
self
.
view
];
}];
}
...
...
Dolphins/Classes/Reminder/Controller/ZJReminderCareController.m
View file @
b75065f0
...
...
@@ -9,6 +9,8 @@
#import "ZJReminderCareController.h"
#import "ZJReminderCareCell.h"
#import "ZJFriendModel.h"
#import "GYEmptyView.h"
#import "UIScrollView+GYEmpty.h"
static
NSString
*
const
ZJReminderCareCellID
=
@"ZJReminderCareCellID"
;
@interface
ZJReminderCareController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
...
...
@@ -49,12 +51,17 @@ static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
make
.
bottom
.
mas_equalTo
(
0
);
}];
self
.
tableView
.
gy_emptyView
=
[
GYEmptyView
emptyViewWithImageStr
:
@"mine_emergency_contact_without"
titleStr
:
@" "
detailStr
:
@"您的好友列表没有人哦~"
];
self
.
tableView
.
gy_emptyView
.
autoShowEmptyView
=
NO
;
}
-
(
void
)
requestData
{
[
self
.
dataArray
removeAllObjects
];
[[
TQNetworkTools
shared
]
getWithAction
:
findFriendList
parameters
:@{}
success
:^
(
id
_Nonnull
response
)
{
self
.
tableView
.
gy_emptyView
.
autoShowEmptyView
=
YES
;
if
([[
response
objectForKey
:
@"status"
]
integerValue
]
==
200
){
if
([
response
[
@"result"
][
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
for
(
NSDictionary
*
dict
in
response
[
@"result"
][
@"data"
])
{
...
...
@@ -65,7 +72,6 @@ static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
}
else
{
[
MBProgressHUD
showError
:[
NSString
stringWithFormat
:
@"%@"
,
[
response
objectForKey
:
@"msg"
]]
toView
:
self
.
view
];
}
[
self
.
tableView
reloadData
];
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
...
...
Dolphins/Classes/Reminder/Controller/ZJReminderCateAddController.m
View file @
b75065f0
...
...
@@ -24,7 +24,8 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
@property
(
nonatomic
,
strong
)
ZJFriendModel
*
friendModel
;
@property
(
nonatomic
,
copy
)
NSString
*
timeString
;
@property
(
nonatomic
,
strong
)
NSDictionary
*
weekSetting
;
@property
(
nonatomic
,
strong
)
NSArray
*
ids
;
@end
...
...
@@ -75,6 +76,8 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
[
self
.
dataArray
addObject
:
model
];
}
self
.
weekSetting
=
@{
@"monday"
:
@"1"
,
@"tuesday"
:
@"1"
,
@"wednesday"
:
@"1"
,
@"thursday"
:
@"1"
,
@"friday"
:
@"1"
,
@"saturday"
:
@"1"
,
@"sunday"
:
@"1"
};
[
self
.
tableView
reloadData
];
}
...
...
@@ -93,24 +96,55 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
-
(
void
)
saveButtonAction
:
(
UIButton
*
)
sender
{
NSLog
(
@"%@"
,
self
.
weekSetting
);
if
(
self
.
friendModel
==
nil
)
{
[
MBProgressHUD
showMessage
:
@"请选择关心的人"
];
return
;
}
if
(
self
.
timeString
.
length
==
0
)
{
[
MBProgressHUD
showMessage
:
@"请选择时间"
];
return
;
}
if
(
self
.
weekSetting
.
allKeys
.
count
==
0
)
{
[
MBProgressHUD
showMessage
:
@"请选择重复时间"
];
return
;
}
NSMutableDictionary
*
dict
=
@{}.
mutableCopy
;
// @{@"typeId":@"1", @"status":sender.selected?@"1":@"0", @"friendId":[NSString stringWithFormat:@"%ld", (long)model.friendId], @"id":[NSString stringWithFormat:@"%ld", (long)model.id]}
dict
[
@"typeId"
]
=
@
(
self
.
model
.
id
);
dict
[
@"friendId"
]
=
self
.
friendModel
.
id
;
dict
[
@"friendId"
]
=
self
.
friendModel
.
friendU
id
;
dict
[
@"remindTime"
]
=
self
.
timeString
;
dict
[
@"weekSetting"
]
=
@""
;
dict
[
@"weekSetting"
]
=
self
.
weekSetting
;
NSString
*
json
=
[
self
convertToJsonData
:
dict
];
NSLog
(
@"%@"
,
json
);
[[
TQNetworkTools
shared
]
postWithBodyAction
:
userRemindInfoSet
parameters
:@{}
body
:
dict
success
:^
(
NSDictionary
*
_Nonnull
response
)
{
if
([
response
[
@"status"
]
intValue
]
==
200
)
{
[
MBProgressHUD
showMessage
:
@"添加成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
}];
}
-
(
NSString
*
)
convertToJsonData
:
(
NSDictionary
*
)
dict
{
NSError
*
error
;
NSData
*
jsonData
=
[
NSJSONSerialization
dataWithJSONObject
:
dict
options
:
NSJSONWritingPrettyPrinted
error
:&
error
];
NSString
*
jsonString
;
if
(
!
jsonData
)
{
NSLog
(
@"%@"
,
error
);
}
else
{
jsonString
=
[[
NSString
alloc
]
initWithData
:
jsonData
encoding
:
NSUTF8StringEncoding
];
}
NSMutableString
*
mutStr
=
[
NSMutableString
stringWithString
:
jsonString
];
NSRange
range
=
{
0
,
jsonString
.
length
};
//去掉字符串中的空格
[
mutStr
replaceOccurrencesOfString
:
@" "
withString
:
@""
options
:
NSLiteralSearch
range
:
range
];
NSRange
range2
=
{
0
,
mutStr
.
length
};
//去掉字符串中的换行符
[
mutStr
replaceOccurrencesOfString
:
@"
\n
"
withString
:
@""
options
:
NSLiteralSearch
range
:
range2
];
return
mutStr
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ZJReminderCateAddCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
ZJReminderCateAddCellID
];
...
...
@@ -128,6 +162,7 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
{
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
__weak
typeof
(
self
)
weakSelf
=
self
;
switch
(
indexPath
.
row
)
{
case
0
:
{
// 关心的人
...
...
@@ -156,7 +191,6 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
break
;
case
3
:
{
// 提醒时间
__weak
typeof
(
self
)
weakSelf
=
self
;
QFTimePickerView
*
pickerView
=
[[
QFTimePickerView
alloc
]
initDatePackerWithStartHour
:
@"00"
endHour
:
@"24"
period
:
1
response
:^
(
NSString
*
str
)
{
if
([
str
containsString
:
@"时"
]
&&
[
str
containsString
:
@"分"
])
{
weakSelf
.
timeString
=
[
str
stringByReplacingOccurrencesOfString
:
@"时"
withString
:
@""
];
...
...
@@ -174,6 +208,31 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
case
4
:
{
// 重复
ZJReminderTimeController
*
vc
=
[
ZJReminderTimeController
new
];
vc
.
timeBlock
=
^
(
NSDictionary
*
_Nonnull
times
,
NSArray
*
_Nonnull
ids
)
{
weakSelf
.
weekSetting
=
times
;
weakSelf
.
ids
=
ids
;
NSString
*
repStr
=
@""
;
NSArray
*
weeks
=
@[
@"一"
,
@"二"
,
@"三"
,
@"四"
,
@"五"
,
@"六"
,
@"日"
];
NSInteger
idx
=
0
;
NSInteger
count
=
0
;
for
(
NSString
*
item
in
ids
)
{
if
([
item
isEqualToString
:
@"1"
])
{
repStr
=
[
repStr
stringByAppendingFormat
:
@" 周%@"
,
weeks
[
idx
]];
count
++
;
}
idx
++
;
}
if
(
count
==
7
)
{
repStr
=
@"每天"
;
}
if
(
weakSelf
.
dataArray
.
count
)
{
ZJChooseIcon
*
model
=
self
.
dataArray
[
4
];
model
.
subName
=
repStr
;
[
weakSelf
.
tableView
reloadData
];
}
};
vc
.
ids
=
self
.
ids
;;
[
self
.
navigationController
pushViewController
:
vc
animated
:
YES
];
}
break
;
...
...
Dolphins/Classes/Reminder/Controller/ZJReminderMainController.m
View file @
b75065f0
...
...
@@ -11,6 +11,8 @@
#import "ZJReminderBottom.h"
#import "ZJReminder.h"
#import "ZJReminderCateAddController.h"
#import "GYEmptyView.h"
#import "UIScrollView+GYEmpty.h"
static
NSString
*
ZJReminderMainCellID
=
@"ZJReminderMainCellID"
;
@interface
ZJReminderMainController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
...
...
@@ -33,6 +35,13 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
return
_dataArray
;
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
self
requestData
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
...
...
@@ -44,13 +53,11 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
self
.
navigationItem
.
rightBarButtonItem
.
tintColor
=
[
UIColor
blackColor
];
[
self
setupUI
];
[
self
requestData
];
}
-
(
void
)
setupUI
{
self
.
view
.
backgroundColor
=
[
UIColor
colorWithHexString
:
@"FAFAFA"
];
[
self
.
view
addSubview
:
self
.
tableView
];
[
self
.
tableView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
mas_equalTo
(
0
);
...
...
@@ -59,6 +66,11 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
make
.
bottom
.
mas_equalTo
(
0
);
}];
self
.
tableView
.
gy_emptyView
=
[
GYEmptyView
emptyViewWithImageStr
:
@"LocationHint_bg"
titleStr
:
@" "
detailStr
:
@"暂时还没有设置提醒呢,去添加一个吧~"
];
self
.
tableView
.
gy_emptyView
.
autoShowEmptyView
=
NO
;
self
.
bottomView
=
[[
ZJReminderBottom
alloc
]
init
];
[
self
.
view
addSubview
:
self
.
bottomView
];
[
self
.
bottomView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
...
...
@@ -75,15 +87,41 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
if
(
weakSelf
.
isManger
)
{
NSLog
(
@"删除整个分类"
);
[
weakSelf
deleteCategory
];
}
else
{
NSLog
(
@"添加提醒"
);
ZJReminderCateAddController
*
vc
=
[
ZJReminderCateAddController
new
];
vc
.
model
=
s
elf
.
model
;
vc
.
model
=
weakS
elf
.
model
;
[
weakSelf
.
navigationController
pushViewController
:
vc
animated
:
YES
];
}
};
}
-
(
void
)
deleteCategory
{
if
(
self
.
model
==
nil
)
return
;
NSDictionary
*
dict
=
@{
@"locationRemindId"
:
@
(
self
.
model
.
id
)};
[[
TQNetworkTools
shared
]
postWithAction
:
reminderDeleteAllReminder
parameters
:
dict
success
:^
(
id
_Nonnull
response
)
{
if
([
response
[
@"status"
]
intValue
]
==
200
)
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
else
{
[
MBProgressHUD
showMessage
:
response
[
@"msg"
]];
}
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
}];
// NSDictionary *dict = @{@"remindTypeId":@(self.model.id)};
// [[TQNetworkTools shared] postWithAction:reminderDeleteCategory parameters:dict success:^(id _Nonnull response) {
// if ([response[@"status"] intValue] == 200) {
// [self.navigationController popViewControllerAnimated:YES];
// }else{
// [MBProgressHUD showMessage:response[@"msg"]];
// }
// } failure:^(NSError * _Nonnull error) {
//
// }];
}
-
(
void
)
chooseAction
{
NSString
*
name
=
self
.
navigationItem
.
rightBarButtonItem
.
title
;
...
...
@@ -117,10 +155,15 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
{
if
(
self
.
model
==
nil
)
return
;
[[
TQNetworkTools
shared
]
getWithAction
:
userRemindInfo
parameters
:@{
@"typeId"
:
@
(
self
.
model
.
id
)}
success
:^
(
id
_Nonnull
response
)
{
if
([[
response
objectForKey
:
@"status"
]
integerValue
]
==
200
){
self
.
tableView
.
gy_emptyView
.
autoShowEmptyView
=
YES
;
if
([
response
[
@"status"
]
integerValue
]
==
200
){
[
self
.
dataArray
removeAllObjects
];
if
([
response
[
@"result"
][
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
for
(
NSDictionary
*
dict
in
response
[
@"result"
][
@"data"
])
{
ZJReminder
*
model
=
[
ZJReminder
yy_modelWithJSON
:
dict
];
[
self
.
dataArray
addObject
:
model
];
}
}
}
else
{
[
MBProgressHUD
showError
:[
NSString
stringWithFormat
:
@"%@"
,
response
[
@"msg"
]]
toView
:
self
.
view
];
}
...
...
@@ -144,14 +187,24 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
[
cell
.
deleteBtn
addTarget
:
self
action
:
@selector
(
deleteAction
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
cell
.
deleteBtn
.
hidden
=
!
self
.
isManger
;
if
(
self
.
dataArray
.
count
)
{
ZJReminder
*
model
=
self
.
dataArray
[
indexPath
.
row
];
cell
.
model
=
model
;
}
return
cell
;
}
-
(
void
)
deleteAction
:
(
UIButton
*
)
sender
{
ZJReminderMainCell
*
cell
=
(
ZJReminderMainCell
*
)
sender
.
superview
.
superview
;
NSIndexPath
*
indexPath
=
[
self
.
tableView
indexPathForCell
:
cell
];
ZJReminder
*
model
=
self
.
dataArray
[
indexPath
.
row
];
UIAlertController
*
alert
=
[
UIAlertController
alertControllerWithTitle
:
@"温馨提示"
message
:
@"删除后,好友将收不到此分类下的所有提醒通知,确定要删除吗?"
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
cancel
=
[
UIAlertAction
actionWithTitle
:
@"在想想"
style
:
UIAlertActionStyleCancel
handler
:
nil
];
UIAlertAction
*
delete
=
[
UIAlertAction
actionWithTitle
:
@"删除"
style
:
UIAlertActionStyleDestructive
handler
:
nil
];
UIAlertAction
*
delete
=
[
UIAlertAction
actionWithTitle
:
@"删除"
style
:
UIAlertActionStyleDestructive
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
[
self
deleteReminder
:
model
];
}];
[
alert
addAction
:
cancel
];
[
alert
addAction
:
delete
];
...
...
@@ -159,6 +212,21 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
}
-
(
void
)
deleteReminder
:
(
ZJReminder
*
)
model
{
NSDictionary
*
dict
=
@{
@"locationRemindId"
:
@
(
model
.
id
)};
[[
TQNetworkTools
shared
]
postWithAction
:
reminderDeleteReminder
parameters
:
dict
success
:^
(
id
_Nonnull
response
)
{
if
([
response
[
@"status"
]
intValue
]
==
200
)
{
[
MBProgressHUD
showMessage
:
@"删除成功"
];
[
self
requestData
];
}
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
}];
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
[
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
...
...
Dolphins/Classes/Reminder/Controller/ZJReminderTimeController.h
View file @
b75065f0
...
...
@@ -12,6 +12,14 @@ NS_ASSUME_NONNULL_BEGIN
@interface
ZJReminderTimeController
:
UIViewController
@property
(
nonatomic
,
copy
)
void
(
^
timeBlock
)(
NSDictionary
*
times
,
NSArray
*
ids
);
// 选取参数
@property
(
nonatomic
,
strong
)
NSArray
*
ids
;
@end
NS_ASSUME_NONNULL_END
Dolphins/Classes/Reminder/Controller/ZJReminderTimeController.m
View file @
b75065f0
...
...
@@ -68,17 +68,50 @@ static NSString * const ZJReminderTimeCellID = @"ZJReminderTimeCellID";
-
(
void
)
buttonAction
:
(
UIButton
*
)
sender
{
NSLog
(
@"确定"
);
NSMutableDictionary
*
dict
=
@{}.
mutableCopy
;
NSMutableArray
*
idsArr
=
@[].
mutableCopy
;
NSInteger
idx
=
0
;
for
(
ZJReminderTime
*
model
in
self
.
dataArray
)
{
if
(
model
.
choose
)
{
dict
[
model
.
key
]
=
@"1"
;
[
idsArr
addObject
:
@"1"
];
}
else
{
dict
[
model
.
key
]
=
@"0"
;
[
idsArr
addObject
:
@"0"
];
}
idx
++
;
}
if
(
self
.
timeBlock
)
{
self
.
timeBlock
(
dict
,
idsArr
);
}
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
-
(
void
)
requestData
{
[
self
.
dataArray
removeAllObjects
];
NSArray
*
res
=
@[
@"星期一"
,
@"星期二"
,
@"星期三"
,
@"星期四"
,
@"星期五"
,
@"星期六"
,
@"星期日"
];
for
(
NSString
*
name
in
res
)
{
ZJReminderTime
*
model
=
[
ZJReminderTime
new
];
model
.
name
=
name
;
model
.
choose
=
YES
;
NSArray
*
res
=
@[@{
@"key"
:
@"monday"
,
@"name"
:
@"每周一"
},
@{
@"key"
:
@"tuesday"
,
@"name"
:
@"每周二"
},
@{
@"key"
:
@"wednesday"
,
@"name"
:
@"每周三"
},
@{
@"key"
:
@"thursday"
,
@"name"
:
@"每周四"
},
@{
@"key"
:
@"friday"
,
@"name"
:
@"每周五"
},
@{
@"key"
:
@"saturday"
,
@"name"
:
@"每周六"
},
@{
@"key"
:
@"sunday"
,
@"name"
:
@"每周日"
}];
NSInteger
idx
=
0
;
for
(
NSDictionary
*
dict
in
res
)
{
ZJReminderTime
*
model
=
[
ZJReminderTime
yy_modelWithJSON
:
dict
];
if
(
self
.
ids
.
count
==
res
.
count
)
{
NSString
*
tag
=
self
.
ids
[
idx
];
if
([
tag
isEqualToString
:
@"1"
])
{
model
.
choose
=
YES
;
}
else
{
model
.
choose
=
NO
;
}
}
else
{
model
.
choose
=
YES
;
}
[
self
.
dataArray
addObject
:
model
];
idx
++
;
}
[
self
.
tableView
reloadData
];
...
...
Dolphins/Classes/Reminder/Others/GYEmptyView/GYEmptyView.m
View file @
b75065f0
...
...
@@ -124,7 +124,7 @@
//重新设置self的frame(大小为content的大小)
self
.
size
=
CGSizeMake
(
contentWidth
,
contentHeight
);
CGFloat
emptyViewCenterX
=
scrollViewWidth
*
0
.
5
f
;
CGFloat
emptyViewCenterY
=
scrollViewHeight
*
0
.
5
f
;
CGFloat
emptyViewCenterY
=
scrollViewHeight
*
0
.
3
f
;
self
.
center
=
CGPointMake
(
emptyViewCenterX
,
emptyViewCenterY
);
//设置contentView
...
...
Dolphins/Classes/Reminder/Others/QFTimePickerView.m
View file @
b75065f0
...
...
@@ -224,19 +224,20 @@
if
(
component
==
0
)
{
selectedHour
=
hourArray
[
row
];
if
([
selectedHour
isEqualToString
:[
hourArray
lastObject
]])
{
[
pickerView
selectRow
:
0
inComponent
:
1
animated
:
YES
];
selectedMin
=
@"00"
;
}
//
if ([selectedHour isEqualToString:[hourArray lastObject]]) {
//
[pickerView selectRow:0 inComponent:1 animated:YES];
//
selectedMin = @"00";
//
}
// [pickerView reloadComponent:1];
}
else
{
if
([
selectedHour
isEqualToString
:[
hourArray
lastObject
]])
{
[
pickerView
selectRow
:
0
inComponent
:
1
animated
:
YES
];
selectedMin
=
@"00"
;
}
else
{
selectedMin
=
minArray
[
row
];
}
selectedMin
=
minArray
[
row
];
// if ([selectedHour isEqualToString:[hourArray lastObject]]) {
// [pickerView selectRow:0 inComponent:1 animated:YES];
// selectedMin = @"00";
// } else {
// selectedMin = minArray[row];
// }
}
}
@end
Dolphins/Classes/Reminder/Others/ZJReminder.h
View file @
b75065f0
...
...
@@ -13,8 +13,12 @@ NS_ASSUME_NONNULL_BEGIN
@interface
ZJReminder
:
NSObject
@property
(
nonatomic
,
assign
)
BOOL
choose
;
@property
(
nonatomic
,
copy
)
NSString
*
headImage
;
@property
(
nonatomic
,
copy
)
NSString
*
name
;
@property
(
nonatomic
,
assign
)
NSInteger
countdownSecond
;
@property
(
nonatomic
,
assign
)
NSInteger
friendId
;
@property
(
nonatomic
,
assign
)
NSInteger
id
;
@property
(
nonatomic
,
assign
)
NSInteger
status
;
@end
...
...
@@ -23,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
)
NSString
*
name
;
@property
(
nonatomic
,
copy
)
NSString
*
key
;
@property
(
nonatomic
,
assign
)
BOOL
choose
;
@end
...
...
Dolphins/Classes/Reminder/View/ZJReminderCareCell.xib
View file @
b75065f0
...
...
@@ -28,6 +28,12 @@
<constraint
firstAttribute=
"width"
constant=
"40"
id=
"3z7-Gr-4on"
/>
<constraint
firstAttribute=
"height"
constant=
"40"
id=
"D9t-Xg-lRp"
/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"clipsToBounds"
value=
"YES"
/>
<userDefinedRuntimeAttribute
type=
"number"
keyPath=
"layer.cornerRadius"
>
<integer
key=
"value"
value=
"20"
/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"name"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Jmb-kr-BOC"
>
<rect
key=
"frame"
x=
"75"
y=
"0.0"
width=
"256"
height=
"74"
/>
...
...
Dolphins/Classes/Reminder/View/ZJReminderMainCell.h
View file @
b75065f0
...
...
@@ -10,10 +10,13 @@
NS_ASSUME_NONNULL_BEGIN
@class
ZJReminder
;
@interface
ZJReminderMainCell
:
UITableViewCell
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
deleteBtn
;
@property
(
nonatomic
,
strong
)
ZJReminder
*
model
;
@end
...
...
Dolphins/Classes/Reminder/View/ZJReminderMainCell.m
View file @
b75065f0
...
...
@@ -7,6 +7,7 @@
//
#import "ZJReminderMainCell.h"
#import "ZJReminder.h"
@interface
ZJReminderMainCell
()
...
...
@@ -43,4 +44,23 @@
// Configure the view for the selected state
}
-
(
void
)
setModel
:
(
ZJReminder
*
)
model
{
_model
=
model
;
[
self
.
icon
sd_setImageWithURL
:[
NSURL
URLWithString
:
model
.
headImage
]
placeholderImage
:[
UIImage
imageNamed
:
@"map_card_profile"
]];
self
.
phone
.
text
=
model
.
name
;
self
.
timeLabel
.
text
=
[
self
getMMSSFromSS
:[
NSString
stringWithFormat
:
@"%ld"
,
model
.
countdownSecond
]];
}
-
(
NSString
*
)
getMMSSFromSS
:
(
NSString
*
)
totalTime
{
NSInteger
seconds
=
[
totalTime
integerValue
];
NSString
*
str_hour
=
[
NSString
stringWithFormat
:
@"%02ld"
,
seconds
/
3600
];
NSString
*
str_minute
=
[
NSString
stringWithFormat
:
@"%02ld"
,(
seconds
%
3600
)
/
60
];
// NSString *str_second = [NSString stringWithFormat:@"%02ld",seconds%60];
NSString
*
format_time
=
[
NSString
stringWithFormat
:
@"%@时%@分"
,
str_hour
,
str_minute
];
return
format_time
;
}
@end
Dolphins/Classes/Tools/Network/TQNetworkTools.h
View file @
b75065f0
...
...
@@ -49,7 +49,7 @@ typedef enum : NSUInteger {
addFriendHintStyle
,
//用户注销
userRemindInfo
,
//用户提醒列表信息 typeId = 1 电量
reminderIconList
,
// 图标列表
reminderTypeList
reminderTypeList
,
// 提醒类型列表
}
TQNetwortGetAction
;
...
...
@@ -98,7 +98,10 @@ typedef enum : NSUInteger {
appPush
,
// 个推
userRemindInfoSet
,
//上报用户提醒信息
reminderAddRemindType
// 添加提醒类型
reminderAddRemindType
,
// 添加提醒类型
reminderDeleteReminder
,
// 删除提醒
reminderDeleteCategory
,
// 删除分类
reminderDeleteAllReminder
,
// 删除所有提醒和分类
}
TQNetwortPostAction
;
...
...
Dolphins/Classes/Tools/Network/TQNetworkTools.m
View file @
b75065f0
...
...
@@ -411,6 +411,14 @@ static TQNetworkTools* _tools = nil;
return
@"/app/v1/location/remind/remind"
;
case
reminderAddRemindType
:
return
@"/app/v1/location/remind/add-remind-type"
;
case
reminderDeleteReminder
:
return
@"/app/v1/location/remind/delete-remind"
;
case
reminderDeleteCategory
:
return
@"/app/v1/location/remind/delete-reType"
;
case
reminderDeleteAllReminder
:
return
@"/app/v1/location/remind/delete-all-remind"
;
default
:
return
@""
;
}
...
...
Pods/Pods.xcodeproj/xcuserdata/zhangguangyi.xcuserdatad/xcschemes/xcschememanagement.plist
0 → 100644
View file @
b75065f0
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
SchemeUserState
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
AFNetworking.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
1
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
AMap3DMap.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
AMapFoundation.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
3
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
AMapLocation.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
AMapSearch.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
5
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
Bugly.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
6
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
CL_ShanYanSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
7
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
GTSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
8
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
IQKeyboardManager.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
9
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
MBProgressHUD.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
11
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
MJExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
12
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
MJRefresh.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
13
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
Masonry.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
10
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
Pods-Dolphins.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
14
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
RTRootNavigationController.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
15
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
SDCycleScrollView.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
16
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
SDWebImage.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
17
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
SwiftyStoreKit.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
18
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
UMCCommon.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
19
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
YYModel.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
20
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
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